nokia_rx51.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
  57. /* USB device configuration */
  58. #define CONFIG_USB_DEVICE
  59. #define CONFIG_USBD_VENDORID 0x0421
  60. #define CONFIG_USBD_PRODUCTID 0x01c8
  61. #define CONFIG_USBD_MANUFACTURER "Nokia"
  62. #define CONFIG_USBD_PRODUCT_NAME "N900"
  63. /* commands to include */
  64. #define CONFIG_SYS_I2C
  65. /*
  66. * TWL4030
  67. */
  68. #define GPIO_SLIDE 71
  69. /*
  70. * Board ONENAND Info.
  71. */
  72. #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
  73. /* Watchdog support */
  74. #define CONFIG_HW_WATCHDOG
  75. /*
  76. * Framebuffer
  77. */
  78. /* Video console */
  79. #define CONFIG_VIDEO_LOGO
  80. #define VIDEO_FB_16BPP_PIXEL_SWAP
  81. #define VIDEO_FB_16BPP_WORD_SWAP
  82. /* functions for cfb_console */
  83. #define VIDEO_KBD_INIT_FCT rx51_kp_init()
  84. #define VIDEO_TSTC_FCT rx51_kp_tstc
  85. #define VIDEO_GETC_FCT rx51_kp_getc
  86. #ifndef __ASSEMBLY__
  87. struct stdio_dev;
  88. int rx51_kp_init(void);
  89. int rx51_kp_tstc(struct stdio_dev *sdev);
  90. int rx51_kp_getc(struct stdio_dev *sdev);
  91. #endif
  92. /* Environment information */
  93. #define CONFIG_EXTRA_ENV_SETTINGS \
  94. "usbtty=cdc_acm\0" \
  95. "stdin=serial,vga\0" \
  96. "stdout=serial,vga\0" \
  97. "stderr=serial,vga\0" \
  98. "setcon=setenv stdin ${con};" \
  99. "setenv stdout ${con};" \
  100. "setenv stderr ${con}\0" \
  101. "sercon=setenv con serial; run setcon\0" \
  102. "usbcon=setenv con usbtty; run setcon\0" \
  103. "vgacon=setenv con vga; run setcon\0" \
  104. "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
  105. "switchmmc=mmc dev ${mmcnum}\0" \
  106. "kernaddr=0x82008000\0" \
  107. "initrdaddr=0x84008000\0" \
  108. "scriptaddr=0x86008000\0" \
  109. "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \
  110. "${loadaddr} ${mmcfile}\0" \
  111. "kernload=setenv loadaddr ${kernaddr};" \
  112. "setenv mmcfile ${mmckernfile};" \
  113. "run fileload\0" \
  114. "initrdload=setenv loadaddr ${initrdaddr};" \
  115. "setenv mmcfile ${mmcinitrdfile};" \
  116. "run fileload\0" \
  117. "scriptload=setenv loadaddr ${scriptaddr};" \
  118. "setenv mmcfile ${mmcscriptfile};" \
  119. "run fileload\0" \
  120. "scriptboot=echo Running ${mmcscriptfile} from mmc " \
  121. "${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
  122. "kernboot=echo Booting ${mmckernfile} from mmc " \
  123. "${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
  124. "kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
  125. "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
  126. "attachboot=echo Booting attached kernel image ...;" \
  127. "setenv setup_omap_atag 1;" \
  128. "bootm ${attkernaddr};" \
  129. "setenv setup_omap_atag\0" \
  130. "trymmcscriptboot=if run switchmmc; then " \
  131. "if run scriptload; then " \
  132. "run scriptboot;" \
  133. "fi;" \
  134. "fi\0" \
  135. "trymmckernboot=if run switchmmc; then " \
  136. "if run kernload; then " \
  137. "run kernboot;" \
  138. "fi;" \
  139. "fi\0" \
  140. "trymmckerninitrdboot=if run switchmmc; then " \
  141. "if run initrdload; then " \
  142. "if run kernload; then " \
  143. "run kerninitrdboot;" \
  144. "fi;" \
  145. "fi; " \
  146. "fi\0" \
  147. "trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
  148. "setenv mmckernfile uImage; run trymmckernboot\0" \
  149. "trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
  150. "setenv mmcpart 2; run trymmcpartboot;" \
  151. "setenv mmcpart 3; run trymmcpartboot;" \
  152. "setenv mmcpart 4; run trymmcpartboot\0" \
  153. "trymmcboot=if run switchmmc; then " \
  154. "setenv mmctype fat;" \
  155. "run trymmcallpartboot;" \
  156. "setenv mmctype ext2;" \
  157. "run trymmcallpartboot;" \
  158. "setenv mmctype ext4;" \
  159. "run trymmcallpartboot;" \
  160. "fi\0" \
  161. "emmcboot=setenv mmcnum 1; run trymmcboot\0" \
  162. "sdboot=setenv mmcnum 0; run trymmcboot\0" \
  163. "preboot=setenv mmcnum 1; setenv mmcpart 1;" \
  164. "setenv mmcscriptfile bootmenu.scr;" \
  165. "if run switchmmc; then " \
  166. "setenv mmcdone true;" \
  167. "setenv mmctype fat;" \
  168. "if run scriptload; then true; else " \
  169. "setenv mmctype ext2;" \
  170. "if run scriptload; then true; else " \
  171. "setenv mmctype ext4;" \
  172. "if run scriptload; then true; else " \
  173. "setenv mmcdone false;" \
  174. "fi;" \
  175. "fi;" \
  176. "fi;" \
  177. "if ${mmcdone}; then " \
  178. "run scriptboot;" \
  179. "fi;" \
  180. "fi;" \
  181. "if run slide; then true; else " \
  182. "setenv bootmenu_delay 0;" \
  183. "setenv bootdelay 0;" \
  184. "fi\0" \
  185. "menucmd=bootmenu\0" \
  186. "bootmenu_0=Attached kernel=run attachboot\0" \
  187. "bootmenu_1=Internal eMMC=run emmcboot\0" \
  188. "bootmenu_2=External SD card=run sdboot\0" \
  189. "bootmenu_3=U-Boot boot order=boot\0" \
  190. "bootmenu_delay=30\0" \
  191. ""
  192. #define CONFIG_POSTBOOTMENU \
  193. "echo;" \
  194. "echo Extra commands:;" \
  195. "echo run sercon - Use serial port for control.;" \
  196. "echo run usbcon - Use usbtty for control.;" \
  197. "echo run vgacon - Use framebuffer/keyboard.;" \
  198. "echo run sdboot - Boot from SD card slot.;" \
  199. "echo run emmcboot - Boot internal eMMC memory.;" \
  200. "echo run attachboot - Boot attached kernel image.;" \
  201. "echo"
  202. #define CONFIG_BOOTCOMMAND \
  203. "run sdboot;" \
  204. "run emmcboot;" \
  205. "run attachboot;" \
  206. "echo"
  207. /*
  208. * Miscellaneous configurable options
  209. */
  210. /* default load address */
  211. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0)
  212. /*
  213. * OMAP3 has 12 GP timers, they can be driven by the system clock
  214. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  215. * This rate is divided by a local divisor.
  216. */
  217. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  218. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  219. /*
  220. * Physical Memory Map
  221. */
  222. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  223. /*
  224. * FLASH and environment organization
  225. */
  226. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  227. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  228. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  229. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  230. CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  231. /*
  232. * Attached kernel image
  233. */
  234. #define SDRAM_SIZE 0x10000000 /* 256 MB */
  235. #define SDRAM_END (CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
  236. #define IMAGE_MAXSIZE 0x1FF800 /* 2 MB - 2 kB */
  237. #define KERNEL_OFFSET 0x40000 /* 256 kB */
  238. #define KERNEL_MAXSIZE (IMAGE_MAXSIZE-KERNEL_OFFSET)
  239. #define KERNEL_ADDRESS (SDRAM_END-KERNEL_MAXSIZE)
  240. /* Reserve protected RAM for attached kernel */
  241. #define CONFIG_PRAM ((KERNEL_MAXSIZE >> 10)+1)
  242. #endif /* __CONFIG_H */