ramips: add memory detection code for RT5350