nokia_rx51.h 7.4 KB

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