nokia_rx51.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. /*
  2. * (C) Copyright 2011-2012
  3. * Pali Rohár <pali.rohar@gmail.com>
  4. *
  5. * (C) Copyright 2010
  6. * Alistair Buxton <a.j.buxton@gmail.com>
  7. *
  8. * Derived from Beagle Board code:
  9. * (C) Copyright 2006-2008
  10. * Texas Instruments.
  11. * Richard Woodruff <r-woodruff2@ti.com>
  12. * Syed Mohammed Khasim <x0khasim@ti.com>
  13. *
  14. * Configuration settings for the Nokia RX-51 aka N900.
  15. *
  16. * See file CREDITS for list of people who contributed to this
  17. * project.
  18. *
  19. * This program is free software; you can redistribute it and/or
  20. * modify it under the terms of the GNU General Public License as
  21. * published by the Free Software Foundation; either version 2 of
  22. * the License, or (at your option) any later version.
  23. *
  24. * This program is distributed in the hope that it will be useful,
  25. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. * GNU General Public License for more details.
  28. *
  29. * You should have received a copy of the GNU General Public License
  30. * along with this program; if not, write to the Free Software
  31. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  32. * MA 02111-1307 USA
  33. */
  34. #ifndef __CONFIG_H
  35. #define __CONFIG_H
  36. /*
  37. * High Level Configuration Options
  38. */
  39. #define CONFIG_OMAP /* in a TI OMAP core */
  40. #define CONFIG_OMAP34XX /* which is a 34XX */
  41. #define CONFIG_OMAP3430 /* which is in a 3430 */
  42. #define CONFIG_OMAP3_RX51 /* working with RX51 */
  43. #define CONFIG_SYS_L2CACHE_OFF /* pretend there is no L2 CACHE */
  44. #define CONFIG_MACH_TYPE MACH_TYPE_NOKIA_RX51
  45. /*
  46. * Nokia X-Loader loading secondary image to address 0x80400000
  47. * NOLO loading boot image to random place, so it doesn't really
  48. * matter what we set this to. We have to copy u-boot to this address
  49. */
  50. #define CONFIG_SYS_TEXT_BASE 0x80008000
  51. #define CONFIG_SDRC /* The chip has SDRC controller */
  52. #include <asm/arch/cpu.h> /* get chip and board defs */
  53. #include <asm/arch/omap3.h>
  54. #include <asm/arch/mem.h>
  55. #include <linux/stringify.h>
  56. /*
  57. * Display CPU and Board information
  58. */
  59. #define CONFIG_DISPLAY_CPUINFO
  60. #define CONFIG_DISPLAY_BOARDINFO
  61. /* Clock Defines */
  62. #define V_OSCK 26000000 /* Clock output from T2 */
  63. #define V_SCLK (V_OSCK >> 1)
  64. #undef CONFIG_USE_IRQ /* no support for IRQs */
  65. #define CONFIG_MISC_INIT_R
  66. #define CONFIG_SKIP_LOWLEVEL_INIT /* X-Loader set everything up */
  67. #define CONFIG_CMDLINE_TAG /* enable passing kernel command line string */
  68. #define CONFIG_INITRD_TAG /* enable passing initrd */
  69. #define CONFIG_REVISION_TAG /* enable passing revision tag*/
  70. #define CONFIG_SETUP_MEMORY_TAGS /* enable memory tag */
  71. /*
  72. * Size of malloc() pool
  73. */
  74. #define CONFIG_ENV_SIZE (128 << 10)
  75. #define CONFIG_UBI_SIZE (512 << 10)
  76. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + CONFIG_UBI_SIZE + \
  77. (128 << 10))
  78. /*
  79. * Hardware drivers
  80. */
  81. /*
  82. * NS16550 Configuration
  83. */
  84. #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  85. #define CONFIG_SYS_NS16550
  86. #define CONFIG_SYS_NS16550_SERIAL
  87. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  88. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  89. /*
  90. * select serial console configuration
  91. */
  92. #define CONFIG_CONS_INDEX 3
  93. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  94. #define CONFIG_SERIAL3 3 /* UART3 on RX-51 */
  95. /* allow to overwrite serial and ethaddr */
  96. #define CONFIG_ENV_OVERWRITE
  97. #define CONFIG_BAUDRATE 115200
  98. #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
  99. #define CONFIG_MMC
  100. #define CONFIG_GENERIC_MMC
  101. #define CONFIG_OMAP_HSMMC
  102. #define CONFIG_DOS_PARTITION
  103. /* USB */
  104. #define CONFIG_MUSB_UDC
  105. #define CONFIG_MUSB_HDC
  106. #define CONFIG_USB_OMAP3
  107. #define CONFIG_TWL4030_USB
  108. /* USB device configuration */
  109. #define CONFIG_USB_DEVICE
  110. #define CONFIG_USBD_VENDORID 0x0421
  111. #define CONFIG_USBD_PRODUCTID 0x01c8
  112. #define CONFIG_USBD_MANUFACTURER "Nokia"
  113. #define CONFIG_USBD_PRODUCT_NAME "N900"
  114. #define CONFIG_SYS_CONSOLE_IS_IN_ENV
  115. #define CONFIG_SYS_NO_FLASH
  116. /* commands to include */
  117. #include <config_cmd_default.h>
  118. #define CONFIG_CMD_EXT2 /* EXT2 Support */
  119. #define CONFIG_CMD_EXT4 /* EXT4 Support */
  120. #define CONFIG_CMD_FAT /* FAT support */
  121. #define CONFIG_CMD_I2C /* I2C serial bus support */
  122. #define CONFIG_CMD_MMC /* MMC support */
  123. #define CONFIG_CMD_GPIO /* Enable gpio command */
  124. #define CONFIG_CMDLINE_EDITING /* add command line history */
  125. #define CONFIG_AUTO_COMPLETE /* add autocompletion support */
  126. #define CONFIG_CMD_CLEAR /* ANSI terminal clear screen command */
  127. #ifdef ONENAND_SUPPORT
  128. #define CONFIG_CMD_ONENAND /* ONENAND support */
  129. #define CONFIG_CMD_MTDPARTS /* mtd parts support */
  130. #ifdef UBIFS_SUPPORT
  131. #define CONFIG_CMD_UBI /* UBI Support */
  132. #define CONFIG_CMD_UBIFS /* UBIFS Support */
  133. #endif
  134. #endif
  135. /* commands not needed from config_cmd_default.h */
  136. #undef CONFIG_CMD_FPGA /* FPGA configuration Support */
  137. #undef CONFIG_CMD_IMI /* iminfo */
  138. #undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
  139. #undef CONFIG_CMD_NFS /* NFS support */
  140. #undef CONFIG_CMD_SAVEENV /* saveenv */
  141. #undef CONFIG_CMD_SETGETDCR /* DCR support on 4xx */
  142. #define CONFIG_OMAP3_SPI
  143. #define CONFIG_HARD_I2C
  144. #define CONFIG_SYS_I2C_SPEED 100000
  145. #define CONFIG_SYS_I2C_SLAVE 1
  146. #define CONFIG_DRIVER_OMAP34XX_I2C
  147. /*
  148. * TWL4030
  149. */
  150. #define CONFIG_TWL4030_POWER
  151. #define CONFIG_TWL4030_LED
  152. #define CONFIG_TWL4030_KEYPAD
  153. #define CONFIG_OMAP_GPIO
  154. #define GPIO_SLIDE 71
  155. /*
  156. * Board ONENAND Info.
  157. */
  158. #define PART1_NAME "bootloader"
  159. #define PART1_SIZE 128
  160. #define PART1_MULL 1024
  161. #define PART1_SUFF "k"
  162. #define PART1_OFFS 0x00000000
  163. #define PART1_MASK 0x00000003
  164. #define PART2_NAME "config"
  165. #define PART2_SIZE 384
  166. #define PART2_MULL 1024
  167. #define PART2_SUFF "k"
  168. #define PART2_OFFS 0x00020000
  169. #define PART2_MASK 0x00000000
  170. #define PART3_NAME "log"
  171. #define PART3_SIZE 256
  172. #define PART3_MULL 1024
  173. #define PART3_SUFF "k"
  174. #define PART3_OFFS 0x00080000
  175. #define PART3_MASK 0x00000000
  176. #define PART4_NAME "kernel"
  177. #define PART4_SIZE 2
  178. #define PART4_MULL 1024*1024
  179. #define PART4_SUFF "m"
  180. #define PART4_OFFS 0x000c0000
  181. #define PART4_MASK 0x00000000
  182. #define PART5_NAME "initfs"
  183. #define PART5_SIZE 2
  184. #define PART5_MULL 1024*1024
  185. #define PART5_SUFF "m"
  186. #define PART5_OFFS 0x002c0000
  187. #define PART5_MASK 0x00000000
  188. #define PART6_NAME "rootfs"
  189. #define PART6_SIZE 257280
  190. #define PART6_MULL 1024
  191. #define PART6_SUFF "k"
  192. #define PART6_OFFS 0x004c0000
  193. #define PART6_MASK 0x00000000
  194. #ifdef ONENAND_SUPPORT
  195. #define PISMO1_NAND_SIZE GPMC_SIZE_128M
  196. #define PISMO1_ONEN_SIZE GPMC_SIZE_128M
  197. #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
  198. #define CONFIG_MTD_DEVICE
  199. #define CONFIG_MTD_PARTITIONS
  200. #ifdef UBIFS_SUPPORT
  201. #define CONFIG_RBTREE
  202. #define CONFIG_LZO
  203. #endif
  204. #define MTDIDS_DEFAULT "onenand0=onenand"
  205. #define MTDPARTS_DEFAULT "mtdparts=onenand:" \
  206. __stringify(PART1_SIZE) PART1_SUFF "(" PART1_NAME ")ro," \
  207. __stringify(PART2_SIZE) PART2_SUFF "(" PART2_NAME ")," \
  208. __stringify(PART3_SIZE) PART3_SUFF "(" PART3_NAME ")," \
  209. __stringify(PART4_SIZE) PART4_SUFF "(" PART4_NAME ")," \
  210. __stringify(PART5_SIZE) PART5_SUFF "(" PART5_NAME ")," \
  211. "-(" PART6_NAME ")"
  212. #endif
  213. /* Watchdog support */
  214. #define CONFIG_HW_WATCHDOG
  215. /*
  216. * Framebuffer
  217. */
  218. /* Video console */
  219. #define CONFIG_VIDEO
  220. #define CONFIG_CFB_CONSOLE
  221. #define CONFIG_CFB_CONSOLE_ANSI /* Enable ANSI escape codes in framebuffer */
  222. #define CONFIG_VIDEO_LOGO
  223. #define VIDEO_FB_16BPP_PIXEL_SWAP
  224. #define VIDEO_FB_16BPP_WORD_SWAP
  225. #define CONFIG_VIDEO_SW_CURSOR
  226. #define CONFIG_SPLASH_SCREEN
  227. /* functions for cfb_console */
  228. #define VIDEO_KBD_INIT_FCT rx51_kp_init()
  229. #define VIDEO_TSTC_FCT rx51_kp_tstc
  230. #define VIDEO_GETC_FCT rx51_kp_getc
  231. #ifndef __ASSEMBLY__
  232. int rx51_kp_init(void);
  233. int rx51_kp_tstc(void);
  234. int rx51_kp_getc(void);
  235. #endif
  236. #ifndef MTDPARTS_DEFAULT
  237. #define MTDPARTS_DEFAULT
  238. #endif
  239. /* Environment information */
  240. #define CONFIG_BOOTDELAY 3
  241. #define CONFIG_EXTRA_ENV_SETTINGS \
  242. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  243. "usbtty=cdc_acm\0" \
  244. "stdin=vga\0" \
  245. "stdout=vga\0" \
  246. "stderr=vga\0" \
  247. "setcon=setenv stdin ${con};" \
  248. "setenv stdout ${con};" \
  249. "setenv stderr ${con}\0" \
  250. "sercon=setenv con serial; run setcon\0" \
  251. "usbcon=setenv con usbtty; run setcon\0" \
  252. "vgacon=setenv con vga; run setcon\0" \
  253. "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
  254. "switchmmc=mmc dev ${mmcnum}\0" \
  255. "kernaddr=0x82008000\0" \
  256. "initrdaddr=0x84008000\0" \
  257. "scriptaddr=0x86008000\0" \
  258. "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \
  259. "${loadaddr} ${mmcfile}\0" \
  260. "kernload=setenv loadaddr ${kernaddr};" \
  261. "setenv mmcfile ${mmckernfile};" \
  262. "run fileload\0" \
  263. "initrdload=setenv loadaddr ${initrdaddr};" \
  264. "setenv mmcfile ${mmcinitrdfile};" \
  265. "run fileload\0" \
  266. "scriptload=setenv loadaddr ${scriptaddr};" \
  267. "setenv mmcfile ${mmcscriptfile};" \
  268. "run fileload\0" \
  269. "scriptboot=echo Running ${mmcscriptfile} from mmc " \
  270. "${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
  271. "kernboot=echo Booting ${mmckernfile} from mmc " \
  272. "${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
  273. "kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
  274. "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
  275. "attachboot=echo Booting attached kernel image ...;" \
  276. "setenv setup_omap_atag 1;" \
  277. "bootm ${attkernaddr};" \
  278. "setenv setup_omap_atag\0" \
  279. "trymmcscriptboot=if run switchmmc; then " \
  280. "if run scriptload; then " \
  281. "run scriptboot;" \
  282. "fi;" \
  283. "fi\0" \
  284. "trymmckernboot=if run switchmmc; then " \
  285. "if run kernload; then " \
  286. "run kernboot;" \
  287. "fi;" \
  288. "fi\0" \
  289. "trymmckerninitrdboot=if run switchmmc; then " \
  290. "if run initrdload; then " \
  291. "if run kernload; then " \
  292. "run kerninitrdboot;" \
  293. "fi;" \
  294. "fi; " \
  295. "fi\0" \
  296. "trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
  297. "setenv mmckernfile uImage; run trymmckernboot\0" \
  298. "trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
  299. "setenv mmcpart 2; run trymmcpartboot;" \
  300. "setenv mmcpart 3; run trymmcpartboot;" \
  301. "setenv mmcpart 4; run trymmcpartboot\0" \
  302. "trymmcboot=if run switchmmc; then " \
  303. "setenv mmctype fat;" \
  304. "run trymmcallpartboot;" \
  305. "setenv mmctype ext2;" \
  306. "run trymmcallpartboot;" \
  307. "setenv mmctype ext4;" \
  308. "run trymmcallpartboot;" \
  309. "fi\0" \
  310. "emmcboot=setenv mmcnum 1; run trymmcboot\0" \
  311. "sdboot=setenv mmcnum 0; run trymmcboot\0" \
  312. ""
  313. #define CONFIG_PREBOOT \
  314. "if run slide; then true; else run attachboot; fi;" \
  315. "echo Extra commands:;" \
  316. "echo run sercon - Use serial port for control.;" \
  317. "echo run usbcon - Use usbtty for control.;" \
  318. "echo run vgacon - Use framebuffer/keyboard.;" \
  319. "echo run sdboot - Boot from SD card slot.;" \
  320. "echo run emmcboot - Boot internal eMMC memory.;" \
  321. "echo run attachboot - Boot attached kernel image.;" \
  322. "echo"
  323. #define CONFIG_BOOTCOMMAND \
  324. "run sdboot;" \
  325. "run emmcboot;" \
  326. "run attachboot;" \
  327. "echo"
  328. /*
  329. * Miscellaneous configurable options
  330. */
  331. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  332. #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
  333. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  334. #define CONFIG_SYS_PROMPT "Nokia RX-51 # "
  335. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  336. /* Print Buffer Size */
  337. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  338. sizeof(CONFIG_SYS_PROMPT) + 16)
  339. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  340. /* Boot Argument Buffer Size */
  341. #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
  342. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
  343. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + 0x01F00000)/*31MB*/
  344. /* default load address */
  345. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0)
  346. /*
  347. * OMAP3 has 12 GP timers, they can be driven by the system clock
  348. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  349. * This rate is divided by a local divisor.
  350. */
  351. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  352. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  353. #define CONFIG_SYS_HZ 1000
  354. /*
  355. * Stack sizes
  356. *
  357. * The stack sizes are set up in start.S using the settings below
  358. */
  359. #define CONFIG_STACKSIZE (128 << 10) /* regular stack 128 KiB */
  360. /*
  361. * Physical Memory Map
  362. */
  363. #define CONFIG_NR_DRAM_BANKS 2
  364. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  365. /*
  366. * FLASH and environment organization
  367. */
  368. #define CONFIG_ENV_IS_NOWHERE
  369. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  370. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  371. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  372. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  373. CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  374. /*
  375. * Attached kernel image
  376. */
  377. #define SDRAM_SIZE 0x10000000 /* 256 MB */
  378. #define SDRAM_END (CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
  379. #define IMAGE_MAXSIZE 0x1FF800 /* 2 MB - 2 kB */
  380. #define KERNEL_OFFSET 0x40000 /* 256 kB */
  381. #define KERNEL_MAXSIZE (IMAGE_MAXSIZE-KERNEL_OFFSET)
  382. #define KERNEL_ADDRESS (SDRAM_END-KERNEL_MAXSIZE)
  383. /* Reserve protected RAM for attached kernel */
  384. #define CONFIG_PRAM ((KERNEL_MAXSIZE >> 10)+1)
  385. #endif /* __CONFIG_H */