nokia_rx51.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2011-2012
  4. * Pali Rohár <pali.rohar@gmail.com>
  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. /*
  25. * Nokia X-Loader loading secondary image to address 0x80400000
  26. * NOLO loading boot image to random place, so it doesn't really
  27. * matter what we set this to. We have to copy u-boot to this address
  28. */
  29. #include <asm/arch/cpu.h> /* get chip and board defs */
  30. #include <asm/arch/omap.h>
  31. #include <asm/arch/mem.h>
  32. #include <linux/stringify.h>
  33. /* Clock Defines */
  34. #define V_OSCK 26000000 /* Clock output from T2 */
  35. #define V_SCLK (V_OSCK >> 1)
  36. #define CONFIG_SKIP_LOWLEVEL_INIT /* X-Loader set everything up */
  37. #define CONFIG_CMDLINE_TAG /* enable passing kernel command line string */
  38. #define CONFIG_INITRD_TAG /* enable passing initrd */
  39. #define CONFIG_REVISION_TAG /* enable passing revision tag*/
  40. #define CONFIG_SETUP_MEMORY_TAGS /* enable memory tag */
  41. /*
  42. * Size of malloc() pool
  43. */
  44. #define CONFIG_UBI_SIZE (512 << 10)
  45. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + CONFIG_UBI_SIZE + \
  46. (128 << 10))
  47. /*
  48. * Hardware drivers
  49. */
  50. /*
  51. * NS16550 Configuration
  52. */
  53. #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  54. #define CONFIG_SYS_NS16550_SERIAL
  55. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  56. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  57. /*
  58. * select serial console configuration
  59. */
  60. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  61. /* allow to overwrite serial and ethaddr */
  62. #define CONFIG_ENV_OVERWRITE
  63. #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
  64. /* USB device configuration */
  65. #define CONFIG_USB_DEVICE
  66. #define CONFIG_USBD_VENDORID 0x0421
  67. #define CONFIG_USBD_PRODUCTID 0x01c8
  68. #define CONFIG_USBD_MANUFACTURER "Nokia"
  69. #define CONFIG_USBD_PRODUCT_NAME "N900"
  70. /* commands to include */
  71. #define CONFIG_SYS_I2C
  72. /*
  73. * TWL4030
  74. */
  75. #define GPIO_SLIDE 71
  76. /*
  77. * Board ONENAND Info.
  78. */
  79. #define PART1_NAME "bootloader"
  80. #define PART1_SIZE 128
  81. #define PART1_MULL 1024
  82. #define PART1_SUFF "k"
  83. #define PART1_OFFS 0x00000000
  84. #define PART1_MASK 0x00000003
  85. #define PART2_NAME "config"
  86. #define PART2_SIZE 384
  87. #define PART2_MULL 1024
  88. #define PART2_SUFF "k"
  89. #define PART2_OFFS 0x00020000
  90. #define PART2_MASK 0x00000000
  91. #define PART3_NAME "log"
  92. #define PART3_SIZE 256
  93. #define PART3_MULL 1024
  94. #define PART3_SUFF "k"
  95. #define PART3_OFFS 0x00080000
  96. #define PART3_MASK 0x00000000
  97. #define PART4_NAME "kernel"
  98. #define PART4_SIZE 2
  99. #define PART4_MULL 1024*1024
  100. #define PART4_SUFF "m"
  101. #define PART4_OFFS 0x000c0000
  102. #define PART4_MASK 0x00000000
  103. #define PART5_NAME "initfs"
  104. #define PART5_SIZE 2
  105. #define PART5_MULL 1024*1024
  106. #define PART5_SUFF "m"
  107. #define PART5_OFFS 0x002c0000
  108. #define PART5_MASK 0x00000000
  109. #define PART6_NAME "rootfs"
  110. #define PART6_SIZE 257280
  111. #define PART6_MULL 1024
  112. #define PART6_SUFF "k"
  113. #define PART6_OFFS 0x004c0000
  114. #define PART6_MASK 0x00000000
  115. #ifdef ONENAND_SUPPORT
  116. #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
  117. #endif
  118. /* Watchdog support */
  119. #define CONFIG_HW_WATCHDOG
  120. /*
  121. * Framebuffer
  122. */
  123. /* Video console */
  124. #define CONFIG_VIDEO_LOGO
  125. #define VIDEO_FB_16BPP_PIXEL_SWAP
  126. #define VIDEO_FB_16BPP_WORD_SWAP
  127. #define CONFIG_SPLASH_SCREEN
  128. /* functions for cfb_console */
  129. #define VIDEO_KBD_INIT_FCT rx51_kp_init()
  130. #define VIDEO_TSTC_FCT rx51_kp_tstc
  131. #define VIDEO_GETC_FCT rx51_kp_getc
  132. #ifndef __ASSEMBLY__
  133. struct stdio_dev;
  134. int rx51_kp_init(void);
  135. int rx51_kp_tstc(struct stdio_dev *sdev);
  136. int rx51_kp_getc(struct stdio_dev *sdev);
  137. #endif
  138. /* Environment information */
  139. #ifdef CONFIG_MTDPARTS_DEFAULT
  140. #define MTDPARTS "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
  141. #else
  142. #define MTDPARTS
  143. #endif
  144. #define CONFIG_EXTRA_ENV_SETTINGS \
  145. MTDPARTS \
  146. "usbtty=cdc_acm\0" \
  147. "stdin=vga\0" \
  148. "stdout=vga\0" \
  149. "stderr=vga\0" \
  150. "setcon=setenv stdin ${con};" \
  151. "setenv stdout ${con};" \
  152. "setenv stderr ${con}\0" \
  153. "sercon=setenv con serial; run setcon\0" \
  154. "usbcon=setenv con usbtty; run setcon\0" \
  155. "vgacon=setenv con vga; run setcon\0" \
  156. "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
  157. "switchmmc=mmc dev ${mmcnum}\0" \
  158. "kernaddr=0x82008000\0" \
  159. "initrdaddr=0x84008000\0" \
  160. "scriptaddr=0x86008000\0" \
  161. "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \
  162. "${loadaddr} ${mmcfile}\0" \
  163. "kernload=setenv loadaddr ${kernaddr};" \
  164. "setenv mmcfile ${mmckernfile};" \
  165. "run fileload\0" \
  166. "initrdload=setenv loadaddr ${initrdaddr};" \
  167. "setenv mmcfile ${mmcinitrdfile};" \
  168. "run fileload\0" \
  169. "scriptload=setenv loadaddr ${scriptaddr};" \
  170. "setenv mmcfile ${mmcscriptfile};" \
  171. "run fileload\0" \
  172. "scriptboot=echo Running ${mmcscriptfile} from mmc " \
  173. "${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
  174. "kernboot=echo Booting ${mmckernfile} from mmc " \
  175. "${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
  176. "kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
  177. "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
  178. "attachboot=echo Booting attached kernel image ...;" \
  179. "setenv setup_omap_atag 1;" \
  180. "bootm ${attkernaddr};" \
  181. "setenv setup_omap_atag\0" \
  182. "trymmcscriptboot=if run switchmmc; then " \
  183. "if run scriptload; then " \
  184. "run scriptboot;" \
  185. "fi;" \
  186. "fi\0" \
  187. "trymmckernboot=if run switchmmc; then " \
  188. "if run kernload; then " \
  189. "run kernboot;" \
  190. "fi;" \
  191. "fi\0" \
  192. "trymmckerninitrdboot=if run switchmmc; then " \
  193. "if run initrdload; then " \
  194. "if run kernload; then " \
  195. "run kerninitrdboot;" \
  196. "fi;" \
  197. "fi; " \
  198. "fi\0" \
  199. "trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
  200. "setenv mmckernfile uImage; run trymmckernboot\0" \
  201. "trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
  202. "setenv mmcpart 2; run trymmcpartboot;" \
  203. "setenv mmcpart 3; run trymmcpartboot;" \
  204. "setenv mmcpart 4; run trymmcpartboot\0" \
  205. "trymmcboot=if run switchmmc; then " \
  206. "setenv mmctype fat;" \
  207. "run trymmcallpartboot;" \
  208. "setenv mmctype ext2;" \
  209. "run trymmcallpartboot;" \
  210. "setenv mmctype ext4;" \
  211. "run trymmcallpartboot;" \
  212. "fi\0" \
  213. "emmcboot=setenv mmcnum 1; run trymmcboot\0" \
  214. "sdboot=setenv mmcnum 0; run trymmcboot\0" \
  215. "menucmd=bootmenu\0" \
  216. "bootmenu_0=Attached kernel=run attachboot\0" \
  217. "bootmenu_1=Internal eMMC=run emmcboot\0" \
  218. "bootmenu_2=External SD card=run sdboot\0" \
  219. "bootmenu_3=U-Boot boot order=boot\0" \
  220. "bootmenu_delay=30\0" \
  221. ""
  222. #define CONFIG_POSTBOOTMENU \
  223. "echo;" \
  224. "echo Extra commands:;" \
  225. "echo run sercon - Use serial port for control.;" \
  226. "echo run usbcon - Use usbtty for control.;" \
  227. "echo run vgacon - Use framebuffer/keyboard.;" \
  228. "echo run sdboot - Boot from SD card slot.;" \
  229. "echo run emmcboot - Boot internal eMMC memory.;" \
  230. "echo run attachboot - Boot attached kernel image.;" \
  231. "echo"
  232. #define CONFIG_BOOTCOMMAND \
  233. "run sdboot;" \
  234. "run emmcboot;" \
  235. "run attachboot;" \
  236. "echo"
  237. /*
  238. * Miscellaneous configurable options
  239. */
  240. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
  241. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + 0x01F00000)/*31MB*/
  242. /* default load address */
  243. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0)
  244. /*
  245. * OMAP3 has 12 GP timers, they can be driven by the system clock
  246. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  247. * This rate is divided by a local divisor.
  248. */
  249. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  250. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  251. /*
  252. * Physical Memory Map
  253. */
  254. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  255. /*
  256. * FLASH and environment organization
  257. */
  258. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  259. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  260. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  261. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  262. CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  263. /*
  264. * Attached kernel image
  265. */
  266. #define SDRAM_SIZE 0x10000000 /* 256 MB */
  267. #define SDRAM_END (CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
  268. #define IMAGE_MAXSIZE 0x1FF800 /* 2 MB - 2 kB */
  269. #define KERNEL_OFFSET 0x40000 /* 256 kB */
  270. #define KERNEL_MAXSIZE (IMAGE_MAXSIZE-KERNEL_OFFSET)
  271. #define KERNEL_ADDRESS (SDRAM_END-KERNEL_MAXSIZE)
  272. /* Reserve protected RAM for attached kernel */
  273. #define CONFIG_PRAM ((KERNEL_MAXSIZE >> 10)+1)
  274. #endif /* __CONFIG_H */