muas3001.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. /*
  2. * (C) Copyright 2008
  3. * Heiko Schocher, DENX Software Engineering, hs@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <common.h>
  24. #include <mpc8260.h>
  25. #include <ioports.h>
  26. #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
  27. #include <libfdt.h>
  28. #endif
  29. /*
  30. * I/O Port configuration table
  31. *
  32. * if conf is 1, then that port pin will be configured at boot time
  33. * according to the five values podr/pdir/ppar/psor/pdat for that entry
  34. */
  35. const iop_conf_t iop_conf_tab[4][32] = {
  36. /* Port A */
  37. { /* conf ppar psor pdir podr pdat */
  38. /* PA31 */ { 0, 0, 0, 0, 0, 0 }, /* PA31 */
  39. /* PA30 */ { 0, 0, 0, 0, 0, 0 }, /* PA30 */
  40. /* PA29 */ { 1, 1, 1, 1, 0, 0 }, /* FCC1 TXER */
  41. /* PA28 */ { 1, 1, 1, 1, 0, 0 }, /* FCC1 TXEN */
  42. /* PA27 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 RXDV */
  43. /* PA26 */ { 1, 1, 1, 0, 0, 0 }, /* FCC1 RXER */
  44. /* PA25 */ { 1, 0, 0, 1, 0, 0 }, /* ETH_PWRDWN */
  45. /* PA24 */ { 1, 0, 0, 1, 0, 1 }, /* ETH_RESET */
  46. /* PA23 */ { 0, 0, 0, 0, 0, 0 }, /* PA23 */
  47. /* PA22 */ { 0, 0, 0, 0, 0, 0 }, /* PA22 */
  48. /* PA21 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 TXD3 */
  49. /* PA20 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 TXD2 */
  50. /* PA19 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 TXD1 */
  51. /* PA18 */ { 1, 1, 0, 1, 0, 0 }, /* FCC1 TXD0 */
  52. /* PA17 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 RXD0 */
  53. /* PA16 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 RXD1 */
  54. /* PA15 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 RXD2 */
  55. /* PA14 */ { 1, 1, 0, 0, 0, 0 }, /* FCC1 RXD3 */
  56. /* PA13 */ { 0, 0, 0, 0, 0, 0 }, /* PA13 */
  57. /* PA12 */ { 1, 0, 0, 1, 0, 0 }, /* ETH_SLEEP */
  58. /* PA11 */ { 0, 0, 0, 0, 0, 0 }, /* PA11 */
  59. /* PA10 */ { 1, 0, 0, 1, 0, 0 }, /* MDIO */
  60. /* PA9 */ { 1, 0, 0, 1, 0, 0 }, /* MDC */
  61. /* PA8 */ { 1, 1, 0, 0, 0, 0 }, /* SMC2 RxD */
  62. /* PA7 */ { 0, 0, 0, 0, 0, 0 }, /* PA7 */
  63. /* PA6 */ { 0, 0, 0, 0, 0, 0 }, /* PA6 */
  64. /* PA5 */ { 0, 0, 0, 0, 0, 0 }, /* PA5 */
  65. /* PA4 */ { 0, 0, 0, 0, 0, 0 }, /* PA4 */
  66. /* PA3 */ { 0, 0, 0, 0, 0, 0 }, /* PA3 */
  67. /* PA2 */ { 0, 0, 0, 0, 0, 0 }, /* PA2 */
  68. /* PA1 */ { 0, 0, 0, 0, 0, 0 }, /* PA1 */
  69. /* PA0 */ { 0, 0, 0, 0, 0, 0 } /* PA0 */
  70. },
  71. /* Port B */
  72. { /* conf ppar psor pdir podr pdat */
  73. /* PB31 */ { 0, 0, 0, 0, 0, 0 }, /* PB31 */
  74. /* PB30 */ { 0, 0, 0, 0, 0, 0 }, /* PB30 */
  75. /* PB29 */ { 0, 0, 0, 0, 0, 0 }, /* PB29 */
  76. /* PB28 */ { 1, 1, 1, 1, 0, 0 }, /* SCC1 TxD */
  77. /* PB27 */ { 0, 0, 0, 0, 0, 0 }, /* PB27 */
  78. /* PB26 */ { 0, 0, 0, 0, 0, 0 }, /* PB26 */
  79. /* PB25 */ { 0, 0, 0, 0, 0, 0 }, /* PB25 */
  80. /* PB24 */ { 0, 0, 0, 0, 0, 0 }, /* PB24 */
  81. /* PB23 */ { 0, 0, 0, 0, 0, 0 }, /* PB23 */
  82. /* PB22 */ { 0, 0, 0, 0, 0, 0 }, /* PB22 */
  83. /* PB21 */ { 0, 0, 0, 0, 0, 0 }, /* PB21 */
  84. /* PB20 */ { 0, 0, 0, 0, 0, 0 }, /* PB20 */
  85. /* PB19 */ { 0, 0, 0, 0, 0, 0 }, /* PB19 */
  86. /* PB18 */ { 0, 0, 0, 0, 0, 0 }, /* PB18 */
  87. /* PB17 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  88. /* PB16 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  89. /* PB15 */ { 1, 1, 0, 0, 0, 0 }, /* SCC2 RxD */
  90. /* PB14 */ { 1, 1, 0, 0, 0, 0 }, /* SCC3 RxD */
  91. /* PB13 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  92. /* PB12 */ { 1, 1, 1, 1, 0, 0 }, /* SCC2 TxD */
  93. /* PB11 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  94. /* PB10 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  95. /* PB9 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  96. /* PB8 */ { 1, 1, 1, 1, 0, 0 }, /* SCC3 TxD */
  97. /* PB7 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  98. /* PB6 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  99. /* PB5 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  100. /* PB4 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  101. /* PB3 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  102. /* PB2 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  103. /* PB1 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  104. /* PB0 */ { 0, 0, 0, 0, 0, 0 } /* non-existent */
  105. },
  106. /* Port C */
  107. { /* conf ppar psor pdir podr pdat */
  108. /* PC31 */ { 0, 0, 0, 0, 0, 0 }, /* PC31 */
  109. /* PC30 */ { 1, 1, 1, 1, 0, 0 }, /* Timer1 OUT */
  110. /* PC29 */ { 0, 0, 0, 0, 0, 0 }, /* PC29 */
  111. /* PC28 */ { 0, 0, 0, 0, 0, 0 }, /* PC28 */
  112. /* PC27 */ { 0, 0, 0, 0, 0, 0 }, /* PC27 */
  113. /* PC26 */ { 0, 0, 0, 0, 0, 0 }, /* PC26 */
  114. /* PC25 */ { 0, 0, 0, 0, 0, 0 }, /* PC25 */
  115. /* PC24 */ { 0, 0, 0, 0, 0, 0 }, /* PC24 */
  116. /* PC23 */ { 0, 0, 0, 0, 0, 0 }, /* PC23 */
  117. /* PC22 */ { 0, 0, 0, 0, 0, 0 }, /* PC22 */
  118. /* PC21 */ { 1, 1, 0, 0, 0, 0 }, /* FCC RxCLK 11 */
  119. /* PC20 */ { 1, 1, 0, 0, 0, 0 }, /* FCC TxCLK 12 */
  120. /* PC19 */ { 0, 0, 0, 0, 0, 0 }, /* PC19 */
  121. /* PC18 */ { 0, 0, 0, 0, 0, 0 }, /* PC18 */
  122. /* PC17 */ { 0, 0, 0, 0, 0, 0 }, /* PC17 */
  123. /* PC16 */ { 0, 0, 0, 0, 0, 0 }, /* PC16 */
  124. /* PC15 */ { 1, 1, 0, 1, 0, 0 }, /* SMC2 TxD */
  125. /* PC14 */ { 0, 0, 0, 0, 0, 0 }, /* PC14 */
  126. /* PC13 */ { 0, 0, 0, 0, 0, 0 }, /* PC13 */
  127. /* PC12 */ { 1, 0, 0, 1, 0, 0 }, /* TX OUTPUT SLEW1 */
  128. /* PC11 */ { 1, 0, 0, 1, 0, 0 }, /* TX OUTPUT SLEW0 */
  129. /* PC10 */ { 0, 0, 0, 0, 0, 0 }, /* PC10 */
  130. /* PC9 */ { 1, 0, 0, 1, 0, 1 }, /* SPA_TX_EN */
  131. /* PC8 */ { 0, 0, 0, 0, 0, 0 }, /* PC8 */
  132. /* PC7 */ { 0, 0, 0, 0, 0, 0 }, /* PC7 */
  133. /* PC6 */ { 0, 0, 0, 0, 0, 0 }, /* PC6 */
  134. /* PC5 */ { 0, 0, 0, 0, 0, 0 }, /* PC5 */
  135. /* PC4 */ { 0, 0, 0, 0, 0, 0 }, /* PC4 */
  136. /* PC3 */ { 0, 0, 0, 0, 0, 0 }, /* PC3 */
  137. /* PC2 */ { 0, 0, 0, 0, 0, 0 }, /* PC2 */
  138. /* PC1 */ { 0, 0, 0, 0, 0, 0 }, /* PC1 */
  139. /* PC0 */ { 0, 0, 0, 0, 0, 0 }, /* PC0 */
  140. },
  141. /* Port D */
  142. { /* conf ppar psor pdir podr pdat */
  143. /* PD31 */ { 1, 1, 0, 0, 0, 0 }, /* SCC1 RxD */
  144. /* PD30 */ { 0, 0, 0, 0, 0, 0 }, /* PD30 */
  145. /* PD29 */ { 0, 0, 0, 0, 0, 0 }, /* PD29 */
  146. /* PD28 */ { 0, 0, 0, 0, 0, 0 }, /* PD28 */
  147. /* PD27 */ { 0, 0, 0, 0, 0, 0 }, /* PD27 */
  148. /* PD26 */ { 0, 0, 0, 0, 0, 0 }, /* PD26 */
  149. /* PD25 */ { 0, 0, 0, 0, 0, 0 }, /* PD25 */
  150. /* PD24 */ { 0, 0, 0, 0, 0, 0 }, /* PD24 */
  151. /* PD23 */ { 0, 0, 0, 0, 0, 0 }, /* PD23 */
  152. /* PD22 */ { 1, 1, 0, 0, 0, 0 }, /* SCC4: RXD */
  153. /* PD21 */ { 1, 1, 0, 1, 0, 0 }, /* SCC4: TXD */
  154. /* PD20 */ { 0, 0, 0, 0, 0, 0 }, /* PD18 */
  155. /* PD19 */ { 0, 0, 0, 0, 0, 0 }, /* PD19 */
  156. /* PD18 */ { 0, 0, 0, 0, 0, 0 }, /* PD18 */
  157. /* PD17 */ { 0, 0, 0, 0, 0, 0 }, /* PD17 */
  158. /* PD16 */ { 0, 0, 0, 0, 0, 0 }, /* PD16 */
  159. #if defined(CONFIG_HARD_I2C)
  160. /* PD15 */ { 1, 1, 1, 0, 1, 0 }, /* I2C SDA */
  161. /* PD14 */ { 1, 1, 1, 0, 1, 0 }, /* I2C SCL */
  162. #else
  163. /* PD15 */ { 1, 0, 0, 0, 1, 1 }, /* PD15 */
  164. /* PD14 */ { 1, 0, 0, 1, 1, 1 }, /* PD14 */
  165. #endif
  166. /* PD13 */ { 0, 0, 0, 0, 0, 0 }, /* PD13 */
  167. /* PD12 */ { 0, 0, 0, 0, 0, 0 }, /* PD12 */
  168. /* PD11 */ { 0, 0, 0, 0, 0, 0 }, /* PD11 */
  169. /* PD10 */ { 0, 0, 0, 0, 0, 0 }, /* PD10 */
  170. /* PD9 */ { 1, 1, 0, 1, 0, 0 }, /* SMC1 TxD */
  171. /* PD8 */ { 1, 1, 0, 0, 0, 0 }, /* SMC1 RxD */
  172. /* PD7 */ { 0, 0, 0, 0, 0, 0 }, /* PD7 */
  173. /* PD6 */ { 0, 0, 0, 0, 0, 0 }, /* PD6 */
  174. /* PD5 */ { 0, 0, 0, 0, 0, 0 }, /* PD5 */
  175. /* PD4 */ { 0, 0, 0, 0, 0, 0 }, /* PD4 */
  176. /* PD3 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  177. /* PD2 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  178. /* PD1 */ { 0, 0, 0, 0, 0, 0 }, /* non-existent */
  179. /* PD0 */ { 0, 0, 0, 0, 0, 0 } /* non-existent */
  180. }
  181. };
  182. /* Try SDRAM initialization with P/LSDMR=sdmr and ORx=orx
  183. *
  184. * This routine performs standard 8260 initialization sequence
  185. * and calculates the available memory size. It may be called
  186. * several times to try different SDRAM configurations on both
  187. * 60x and local buses.
  188. */
  189. static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
  190. ulong orx, volatile uchar * base)
  191. {
  192. volatile uchar c = 0xff;
  193. volatile uint *sdmr_ptr;
  194. volatile uint *orx_ptr;
  195. ulong maxsize, size;
  196. int i;
  197. /* We must be able to test a location outsize the maximum legal size
  198. * to find out THAT we are outside; but this address still has to be
  199. * mapped by the controller. That means, that the initial mapping has
  200. * to be (at least) twice as large as the maximum expected size.
  201. */
  202. maxsize = (1 + (~orx | 0x7fff))/* / 2*/;
  203. sdmr_ptr = &memctl->memc_psdmr;
  204. orx_ptr = &memctl->memc_or1;
  205. *orx_ptr = orx;
  206. /*
  207. * Quote from 8260 UM (10.4.2 SDRAM Power-On Initialization, 10-35):
  208. *
  209. * "At system reset, initialization software must set up the
  210. * programmable parameters in the memory controller banks registers
  211. * (ORx, BRx, P/LSDMR). After all memory parameters are configured,
  212. * system software should execute the following initialization sequence
  213. * for each SDRAM device.
  214. *
  215. * 1. Issue a PRECHARGE-ALL-BANKS command
  216. * 2. Issue eight CBR REFRESH commands
  217. * 3. Issue a MODE-SET command to initialize the mode register
  218. *
  219. * The initial commands are executed by setting P/LSDMR[OP] and
  220. * accessing the SDRAM with a single-byte transaction."
  221. *
  222. * The appropriate BRx/ORx registers have already been set when we
  223. * get here. The SDRAM can be accessed at the address CONFIG_SYS_SDRAM_BASE.
  224. */
  225. *sdmr_ptr = sdmr | PSDMR_OP_PREA;
  226. *base = c;
  227. *sdmr_ptr = sdmr | PSDMR_OP_CBRR;
  228. for (i = 0; i < 8; i++)
  229. *base = c;
  230. *sdmr_ptr = sdmr | PSDMR_OP_MRW;
  231. *(base + CONFIG_SYS_MRS_OFFS) = c; /* setting MR on address lines */
  232. *sdmr_ptr = sdmr | PSDMR_OP_NORM | PSDMR_RFEN;
  233. *base = c;
  234. size = get_ram_size ((long *)base, maxsize);
  235. *orx_ptr = orx | ~(size - 1);
  236. return (size);
  237. }
  238. phys_size_t initdram (int board_type)
  239. {
  240. volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
  241. volatile memctl8260_t *memctl = &immap->im_memctl;
  242. long psize;
  243. #ifndef CONFIG_SYS_RAMBOOT
  244. long sizelittle, sizebig;
  245. #endif
  246. memctl->memc_psrt = CONFIG_SYS_PSRT;
  247. memctl->memc_mptpr = CONFIG_SYS_MPTPR;
  248. #ifndef CONFIG_SYS_RAMBOOT
  249. /* 60x SDRAM setup:
  250. */
  251. sizelittle = try_init (memctl, CONFIG_SYS_PSDMR_LITTLE, CONFIG_SYS_OR1_LITTLE,
  252. (uchar *) CONFIG_SYS_SDRAM_BASE);
  253. sizebig = try_init (memctl, CONFIG_SYS_PSDMR_BIG, CONFIG_SYS_OR1_BIG,
  254. (uchar *) CONFIG_SYS_SDRAM_BASE);
  255. if (sizelittle < sizebig) {
  256. psize = sizebig;
  257. } else {
  258. psize = try_init (memctl, CONFIG_SYS_PSDMR_LITTLE, CONFIG_SYS_OR1_LITTLE,
  259. (uchar *) CONFIG_SYS_SDRAM_BASE);
  260. }
  261. #endif /* CONFIG_SYS_RAMBOOT */
  262. icache_enable ();
  263. return (psize);
  264. }
  265. int checkboard (void)
  266. {
  267. puts ("Board: MUAS3001\n");
  268. return 0;
  269. }
  270. /*
  271. * Early board initalization.
  272. */
  273. int board_early_init_r (void)
  274. {
  275. return 0;
  276. }
  277. #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
  278. /*
  279. * update "memory" property in the blob
  280. */
  281. void ft_blob_update (void *blob, bd_t *bd)
  282. {
  283. int ret, nodeoffset = 0;
  284. ulong memory_data[2] = {0};
  285. ulong flash_data[4] = {0};
  286. ulong freq = 0;
  287. ulong speed = 0;
  288. memory_data[0] = cpu_to_be32 (bd->bi_memstart);
  289. memory_data[1] = cpu_to_be32 (bd->bi_memsize);
  290. nodeoffset = fdt_path_offset (blob, "/memory");
  291. if (nodeoffset >= 0) {
  292. ret = fdt_setprop (blob, nodeoffset, "reg", memory_data,
  293. sizeof(memory_data));
  294. if (ret < 0)
  295. printf ("ft_blob_update): cannot set /memory/reg "
  296. "property err:%s\n", fdt_strerror (ret));
  297. } else {
  298. /* memory node is required in dts */
  299. printf ("ft_blob_update(): cannot find /memory node "
  300. "err:%s\n", fdt_strerror(nodeoffset));
  301. }
  302. /* update Flash addr, size */
  303. flash_data[2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
  304. flash_data[3] = cpu_to_be32 (CONFIG_SYS_FLASH_SIZE);
  305. nodeoffset = fdt_path_offset (blob, "/localbus");
  306. if (nodeoffset >= 0) {
  307. ret = fdt_setprop (blob, nodeoffset, "ranges", flash_data,
  308. sizeof (flash_data));
  309. if (ret < 0)
  310. printf ("ft_blob_update): cannot set /localbus/ranges "
  311. "property err:%s\n", fdt_strerror(ret));
  312. } else {
  313. /* memory node is required in dts */
  314. printf ("ft_blob_update(): cannot find /localbus node "
  315. "err:%s\n", fdt_strerror (nodeoffset));
  316. }
  317. /* MAC Adresse */
  318. nodeoffset = fdt_path_offset (blob, "/soc/cpm/ethernet");
  319. if (nodeoffset >= 0) {
  320. uchar ethaddr[6];
  321. eth_getenv_enetaddr("ethaddr", ethaddr);
  322. ret = fdt_setprop (blob, nodeoffset, "mac-address", ethaddr,
  323. sizeof (uchar) * 6);
  324. if (ret < 0)
  325. printf ("ft_blob_update): cannot set /soc/cpm/ethernet/mac-address "
  326. "property err:%s\n", fdt_strerror (ret));
  327. } else {
  328. /* memory node is required in dts */
  329. printf ("ft_blob_update(): cannot find /soc/cpm/ethernet node "
  330. "err:%s\n", fdt_strerror (nodeoffset));
  331. }
  332. /* brg clock */
  333. nodeoffset = fdt_path_offset (blob, "/soc/cpm/brg");
  334. if (nodeoffset >= 0) {
  335. freq = cpu_to_be32 (bd->bi_brgfreq);
  336. ret = fdt_setprop (blob, nodeoffset, "clock-frequency", &freq,
  337. sizeof (unsigned long));
  338. if (ret < 0)
  339. printf ("ft_blob_update): cannot set /soc/cpm/brg/clock-frequency "
  340. "property err:%s\n", fdt_strerror (ret));
  341. } else {
  342. /* memory node is required in dts */
  343. printf ("ft_blob_update(): cannot find /soc/cpm/brg/clock-frequency node "
  344. "err:%s\n", fdt_strerror (nodeoffset));
  345. }
  346. /* baudrate */
  347. nodeoffset = fdt_path_offset (blob, "/soc/cpm/serial");
  348. if (nodeoffset >= 0) {
  349. speed = cpu_to_be32 (bd->bi_baudrate);
  350. ret = fdt_setprop (blob, nodeoffset, "current-speed", &speed,
  351. sizeof (unsigned long));
  352. if (ret < 0)
  353. printf ("ft_blob_update): cannot set /soc/cpm/serial/current-speed "
  354. "property err:%s\n", fdt_strerror (ret));
  355. } else {
  356. /* baudrate is required in dts */
  357. printf ("ft_blob_update(): cannot find /soc/cpm/smc2/current-speed node "
  358. "err:%s\n", fdt_strerror (nodeoffset));
  359. }
  360. }
  361. void ft_board_setup (void *blob, bd_t *bd)
  362. {
  363. ft_cpu_setup (blob, bd);
  364. ft_blob_update (blob, bd);
  365. }
  366. #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */