nokia_rx51.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2011-2012
  4. * Pali Rohár <pali@kernel.org>
  5. *
  6. * (C) Copyright 2010
  7. * Alistair Buxton <a.j.buxton@gmail.com>
  8. *
  9. * Derived from Beagle Board code:
  10. * (C) Copyright 2006-2008
  11. * Texas Instruments.
  12. * Richard Woodruff <r-woodruff2@ti.com>
  13. * Syed Mohammed Khasim <x0khasim@ti.com>
  14. *
  15. * Configuration settings for the Nokia RX-51 aka N900.
  16. */
  17. #ifndef __CONFIG_H
  18. #define __CONFIG_H
  19. /*
  20. * High Level Configuration Options
  21. */
  22. #define CONFIG_SYS_L2CACHE_OFF /* pretend there is no L2 CACHE */
  23. #define CONFIG_MACH_TYPE MACH_TYPE_NOKIA_RX51
  24. #include <asm/arch/cpu.h> /* get chip and board defs */
  25. #include <asm/arch/omap.h>
  26. #include <asm/arch/mem.h>
  27. #include <linux/stringify.h>
  28. /* Clock Defines */
  29. #define V_OSCK 26000000 /* Clock output from T2 */
  30. #define V_SCLK (V_OSCK >> 1)
  31. #define CONFIG_SKIP_LOWLEVEL_INIT /* X-Loader set everything up */
  32. #define CONFIG_CMDLINE_TAG /* enable passing kernel command line string */
  33. #define CONFIG_INITRD_TAG /* enable passing initrd */
  34. #define CONFIG_REVISION_TAG /* enable passing revision tag*/
  35. #define CONFIG_SETUP_MEMORY_TAGS /* enable memory tag */
  36. /*
  37. * Size of malloc() pool
  38. */
  39. #define CONFIG_UBI_SIZE (512 << 10)
  40. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + CONFIG_UBI_SIZE + \
  41. (128 << 10))
  42. /*
  43. * Hardware drivers
  44. */
  45. /*
  46. * NS16550 Configuration
  47. */
  48. #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  49. #define CONFIG_SYS_NS16550_SERIAL
  50. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  51. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  52. /*
  53. * select serial console configuration
  54. */
  55. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  56. /* allow to overwrite serial and ethaddr */
  57. #define CONFIG_ENV_OVERWRITE
  58. #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
  59. /* USB device configuration */
  60. #define CONFIG_USB_DEVICE
  61. #define CONFIG_USBD_VENDORID 0x0421
  62. #define CONFIG_USBD_PRODUCTID 0x01c8
  63. #define CONFIG_USBD_MANUFACTURER "Nokia"
  64. #define CONFIG_USBD_PRODUCT_NAME "N900"
  65. /* commands to include */
  66. #define CONFIG_SYS_I2C
  67. /*
  68. * TWL4030
  69. */
  70. #define GPIO_SLIDE 71
  71. /*
  72. * Board ONENAND Info.
  73. */
  74. #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
  75. /* Watchdog support */
  76. #define CONFIG_HW_WATCHDOG
  77. /*
  78. * Framebuffer
  79. */
  80. /* Video console */
  81. #define CONFIG_VIDEO_LOGO
  82. #define VIDEO_FB_16BPP_PIXEL_SWAP
  83. #define VIDEO_FB_16BPP_WORD_SWAP
  84. #define CONFIG_SPLASH_SCREEN
  85. /* functions for cfb_console */
  86. #define VIDEO_KBD_INIT_FCT rx51_kp_init()
  87. #define VIDEO_TSTC_FCT rx51_kp_tstc
  88. #define VIDEO_GETC_FCT rx51_kp_getc
  89. #ifndef __ASSEMBLY__
  90. struct stdio_dev;
  91. int rx51_kp_init(void);
  92. int rx51_kp_tstc(struct stdio_dev *sdev);
  93. int rx51_kp_getc(struct stdio_dev *sdev);
  94. #endif
  95. /* Environment information */
  96. #define CONFIG_EXTRA_ENV_SETTINGS \
  97. "usbtty=cdc_acm\0" \
  98. "stdin=serial,vga\0" \
  99. "stdout=serial,vga\0" \
  100. "stderr=serial,vga\0" \
  101. "setcon=setenv stdin ${con};" \
  102. "setenv stdout ${con};" \
  103. "setenv stderr ${con}\0" \
  104. "sercon=setenv con serial; run setcon\0" \
  105. "usbcon=setenv con usbtty; run setcon\0" \
  106. "vgacon=setenv con vga; run setcon\0" \
  107. "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
  108. "switchmmc=mmc dev ${mmcnum}\0" \
  109. "kernaddr=0x82008000\0" \
  110. "initrdaddr=0x84008000\0" \
  111. "scriptaddr=0x86008000\0" \
  112. "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \
  113. "${loadaddr} ${mmcfile}\0" \
  114. "kernload=setenv loadaddr ${kernaddr};" \
  115. "setenv mmcfile ${mmckernfile};" \
  116. "run fileload\0" \
  117. "initrdload=setenv loadaddr ${initrdaddr};" \
  118. "setenv mmcfile ${mmcinitrdfile};" \
  119. "run fileload\0" \
  120. "scriptload=setenv loadaddr ${scriptaddr};" \
  121. "setenv mmcfile ${mmcscriptfile};" \
  122. "run fileload\0" \
  123. "scriptboot=echo Running ${mmcscriptfile} from mmc " \
  124. "${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
  125. "kernboot=echo Booting ${mmckernfile} from mmc " \
  126. "${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
  127. "kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
  128. "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
  129. "attachboot=echo Booting attached kernel image ...;" \
  130. "setenv setup_omap_atag 1;" \
  131. "bootm ${attkernaddr};" \
  132. "setenv setup_omap_atag\0" \
  133. "trymmcscriptboot=if run switchmmc; then " \
  134. "if run scriptload; then " \
  135. "run scriptboot;" \
  136. "fi;" \
  137. "fi\0" \
  138. "trymmckernboot=if run switchmmc; then " \
  139. "if run kernload; then " \
  140. "run kernboot;" \
  141. "fi;" \
  142. "fi\0" \
  143. "trymmckerninitrdboot=if run switchmmc; then " \
  144. "if run initrdload; then " \
  145. "if run kernload; then " \
  146. "run kerninitrdboot;" \
  147. "fi;" \
  148. "fi; " \
  149. "fi\0" \
  150. "trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
  151. "setenv mmckernfile uImage; run trymmckernboot\0" \
  152. "trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
  153. "setenv mmcpart 2; run trymmcpartboot;" \
  154. "setenv mmcpart 3; run trymmcpartboot;" \
  155. "setenv mmcpart 4; run trymmcpartboot\0" \
  156. "trymmcboot=if run switchmmc; then " \
  157. "setenv mmctype fat;" \
  158. "run trymmcallpartboot;" \
  159. "setenv mmctype ext2;" \
  160. "run trymmcallpartboot;" \
  161. "setenv mmctype ext4;" \
  162. "run trymmcallpartboot;" \
  163. "fi\0" \
  164. "emmcboot=setenv mmcnum 1; run trymmcboot\0" \
  165. "sdboot=setenv mmcnum 0; run trymmcboot\0" \
  166. "preboot=setenv mmcnum 1; setenv mmcpart 1;" \
  167. "setenv mmcscriptfile bootmenu.scr;" \
  168. "if run switchmmc; then " \
  169. "setenv mmcdone true;" \
  170. "setenv mmctype fat;" \
  171. "if run scriptload; then true; else " \
  172. "setenv mmctype ext2;" \
  173. "if run scriptload; then true; else " \
  174. "setenv mmctype ext4;" \
  175. "if run scriptload; then true; else " \
  176. "setenv mmcdone false;" \
  177. "fi;" \
  178. "fi;" \
  179. "fi;" \
  180. "if ${mmcdone}; then " \
  181. "run scriptboot;" \
  182. "fi;" \
  183. "fi;" \
  184. "if run slide; then true; else " \
  185. "setenv bootmenu_delay 0;" \
  186. "setenv bootdelay 0;" \
  187. "fi\0" \
  188. "menucmd=bootmenu\0" \
  189. "bootmenu_0=Attached kernel=run attachboot\0" \
  190. "bootmenu_1=Internal eMMC=run emmcboot\0" \
  191. "bootmenu_2=External SD card=run sdboot\0" \
  192. "bootmenu_3=U-Boot boot order=boot\0" \
  193. "bootmenu_delay=30\0" \
  194. ""
  195. #define CONFIG_POSTBOOTMENU \
  196. "echo;" \
  197. "echo Extra commands:;" \
  198. "echo run sercon - Use serial port for control.;" \
  199. "echo run usbcon - Use usbtty for control.;" \
  200. "echo run vgacon - Use framebuffer/keyboard.;" \
  201. "echo run sdboot - Boot from SD card slot.;" \
  202. "echo run emmcboot - Boot internal eMMC memory.;" \
  203. "echo run attachboot - Boot attached kernel image.;" \
  204. "echo"
  205. #define CONFIG_BOOTCOMMAND \
  206. "run sdboot;" \
  207. "run emmcboot;" \
  208. "run attachboot;" \
  209. "echo"
  210. /*
  211. * Miscellaneous configurable options
  212. */
  213. /* default load address */
  214. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0)
  215. /*
  216. * OMAP3 has 12 GP timers, they can be driven by the system clock
  217. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  218. * This rate is divided by a local divisor.
  219. */
  220. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  221. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  222. /*
  223. * Physical Memory Map
  224. */
  225. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  226. /*
  227. * FLASH and environment organization
  228. */
  229. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  230. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  231. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  232. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  233. CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  234. /*
  235. * Attached kernel image
  236. */
  237. #define SDRAM_SIZE 0x10000000 /* 256 MB */
  238. #define SDRAM_END (CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
  239. #define IMAGE_MAXSIZE 0x1FF800 /* 2 MB - 2 kB */
  240. #define KERNEL_OFFSET 0x40000 /* 256 kB */
  241. #define KERNEL_MAXSIZE (IMAGE_MAXSIZE-KERNEL_OFFSET)
  242. #define KERNEL_ADDRESS (SDRAM_END-KERNEL_MAXSIZE)
  243. /* Reserve protected RAM for attached kernel */
  244. #define CONFIG_PRAM ((KERNEL_MAXSIZE >> 10)+1)
  245. #endif /* __CONFIG_H */