nokia_rx51.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  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_BOOTMENU /* ANSI terminal Boot Menu */
  127. #define CONFIG_CMD_CLEAR /* ANSI terminal clear screen command */
  128. #ifdef ONENAND_SUPPORT
  129. #define CONFIG_CMD_ONENAND /* ONENAND support */
  130. #define CONFIG_CMD_MTDPARTS /* mtd parts support */
  131. #ifdef UBIFS_SUPPORT
  132. #define CONFIG_CMD_UBI /* UBI Support */
  133. #define CONFIG_CMD_UBIFS /* UBIFS Support */
  134. #endif
  135. #endif
  136. /* commands not needed from config_cmd_default.h */
  137. #undef CONFIG_CMD_FPGA /* FPGA configuration Support */
  138. #undef CONFIG_CMD_IMI /* iminfo */
  139. #undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
  140. #undef CONFIG_CMD_NFS /* NFS support */
  141. #undef CONFIG_CMD_SAVEENV /* saveenv */
  142. #undef CONFIG_CMD_SETGETDCR /* DCR support on 4xx */
  143. #define CONFIG_OMAP3_SPI
  144. #define CONFIG_HARD_I2C
  145. #define CONFIG_SYS_I2C_SPEED 100000
  146. #define CONFIG_SYS_I2C_SLAVE 1
  147. #define CONFIG_DRIVER_OMAP34XX_I2C
  148. /*
  149. * TWL4030
  150. */
  151. #define CONFIG_TWL4030_POWER
  152. #define CONFIG_TWL4030_LED
  153. #define CONFIG_TWL4030_KEYPAD
  154. #define CONFIG_OMAP_GPIO
  155. #define GPIO_SLIDE 71
  156. /*
  157. * Board ONENAND Info.
  158. */
  159. #define PART1_NAME "bootloader"
  160. #define PART1_SIZE 128
  161. #define PART1_MULL 1024
  162. #define PART1_SUFF "k"
  163. #define PART1_OFFS 0x00000000
  164. #define PART1_MASK 0x00000003
  165. #define PART2_NAME "config"
  166. #define PART2_SIZE 384
  167. #define PART2_MULL 1024
  168. #define PART2_SUFF "k"
  169. #define PART2_OFFS 0x00020000
  170. #define PART2_MASK 0x00000000
  171. #define PART3_NAME "log"
  172. #define PART3_SIZE 256
  173. #define PART3_MULL 1024
  174. #define PART3_SUFF "k"
  175. #define PART3_OFFS 0x00080000
  176. #define PART3_MASK 0x00000000
  177. #define PART4_NAME "kernel"
  178. #define PART4_SIZE 2
  179. #define PART4_MULL 1024*1024
  180. #define PART4_SUFF "m"
  181. #define PART4_OFFS 0x000c0000
  182. #define PART4_MASK 0x00000000
  183. #define PART5_NAME "initfs"
  184. #define PART5_SIZE 2
  185. #define PART5_MULL 1024*1024
  186. #define PART5_SUFF "m"
  187. #define PART5_OFFS 0x002c0000
  188. #define PART5_MASK 0x00000000
  189. #define PART6_NAME "rootfs"
  190. #define PART6_SIZE 257280
  191. #define PART6_MULL 1024
  192. #define PART6_SUFF "k"
  193. #define PART6_OFFS 0x004c0000
  194. #define PART6_MASK 0x00000000
  195. #ifdef ONENAND_SUPPORT
  196. #define PISMO1_NAND_SIZE GPMC_SIZE_128M
  197. #define PISMO1_ONEN_SIZE GPMC_SIZE_128M
  198. #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
  199. #define CONFIG_MTD_DEVICE
  200. #define CONFIG_MTD_PARTITIONS
  201. #ifdef UBIFS_SUPPORT
  202. #define CONFIG_RBTREE
  203. #define CONFIG_LZO
  204. #endif
  205. #define MTDIDS_DEFAULT "onenand0=onenand"
  206. #define MTDPARTS_DEFAULT "mtdparts=onenand:" \
  207. __stringify(PART1_SIZE) PART1_SUFF "(" PART1_NAME ")ro," \
  208. __stringify(PART2_SIZE) PART2_SUFF "(" PART2_NAME ")," \
  209. __stringify(PART3_SIZE) PART3_SUFF "(" PART3_NAME ")," \
  210. __stringify(PART4_SIZE) PART4_SUFF "(" PART4_NAME ")," \
  211. __stringify(PART5_SIZE) PART5_SUFF "(" PART5_NAME ")," \
  212. "-(" PART6_NAME ")"
  213. #endif
  214. /* Watchdog support */
  215. #define CONFIG_HW_WATCHDOG
  216. /*
  217. * Framebuffer
  218. */
  219. /* Video console */
  220. #define CONFIG_VIDEO
  221. #define CONFIG_CFB_CONSOLE
  222. #define CONFIG_CFB_CONSOLE_ANSI /* Enable ANSI escape codes in framebuffer */
  223. #define CONFIG_VIDEO_LOGO
  224. #define VIDEO_FB_16BPP_PIXEL_SWAP
  225. #define VIDEO_FB_16BPP_WORD_SWAP
  226. #define CONFIG_VIDEO_SW_CURSOR
  227. #define CONFIG_SPLASH_SCREEN
  228. /* functions for cfb_console */
  229. #define VIDEO_KBD_INIT_FCT rx51_kp_init()
  230. #define VIDEO_TSTC_FCT rx51_kp_tstc
  231. #define VIDEO_GETC_FCT rx51_kp_getc
  232. #ifndef __ASSEMBLY__
  233. int rx51_kp_init(void);
  234. int rx51_kp_tstc(void);
  235. int rx51_kp_getc(void);
  236. #endif
  237. #ifndef MTDPARTS_DEFAULT
  238. #define MTDPARTS_DEFAULT
  239. #endif
  240. /* Environment information */
  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. "menucmd=bootmenu\0" \
  313. "bootmenu_0=Attached kernel=run attachboot\0" \
  314. "bootmenu_1=Internal eMMC=run emmcboot\0" \
  315. "bootmenu_2=External SD card=run sdboot\0" \
  316. "bootmenu_3=U-Boot boot order=boot\0" \
  317. "bootmenu_delay=30\0" \
  318. ""
  319. #define CONFIG_PREBOOT \
  320. "setenv mmcnum 1; setenv mmcpart 1;" \
  321. "setenv mmcscriptfile bootmenu.scr;" \
  322. "if run switchmmc; then " \
  323. "setenv mmcdone true;" \
  324. "setenv mmctype fat;" \
  325. "if run scriptload; then true; else " \
  326. "setenv mmctype ext2;" \
  327. "if run scriptload; then true; else " \
  328. "setenv mmctype ext4;" \
  329. "if run scriptload; then true; else " \
  330. "setenv mmcdone false;" \
  331. "fi;" \
  332. "fi;" \
  333. "fi;" \
  334. "if ${mmcdone}; then " \
  335. "run scriptboot;" \
  336. "fi;" \
  337. "fi;" \
  338. "if run slide; then true; else " \
  339. "setenv bootmenu_delay 0;" \
  340. "setenv bootdelay 0;" \
  341. "fi"
  342. #define CONFIG_POSTBOOTMENU \
  343. "echo;" \
  344. "echo Extra commands:;" \
  345. "echo run sercon - Use serial port for control.;" \
  346. "echo run usbcon - Use usbtty for control.;" \
  347. "echo run vgacon - Use framebuffer/keyboard.;" \
  348. "echo run sdboot - Boot from SD card slot.;" \
  349. "echo run emmcboot - Boot internal eMMC memory.;" \
  350. "echo run attachboot - Boot attached kernel image.;" \
  351. "echo"
  352. #define CONFIG_BOOTCOMMAND \
  353. "run sdboot;" \
  354. "run emmcboot;" \
  355. "run attachboot;" \
  356. "echo"
  357. #define CONFIG_BOOTDELAY 30
  358. #define CONFIG_AUTOBOOT_KEYED
  359. #define CONFIG_MENU
  360. #define CONFIG_MENU_SHOW
  361. /*
  362. * Miscellaneous configurable options
  363. */
  364. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  365. #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
  366. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  367. #define CONFIG_SYS_PROMPT "Nokia RX-51 # "
  368. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  369. /* Print Buffer Size */
  370. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  371. sizeof(CONFIG_SYS_PROMPT) + 16)
  372. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  373. /* Boot Argument Buffer Size */
  374. #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
  375. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
  376. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + 0x01F00000)/*31MB*/
  377. /* default load address */
  378. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0)
  379. /*
  380. * OMAP3 has 12 GP timers, they can be driven by the system clock
  381. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  382. * This rate is divided by a local divisor.
  383. */
  384. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  385. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  386. #define CONFIG_SYS_HZ 1000
  387. /*
  388. * Stack sizes
  389. *
  390. * The stack sizes are set up in start.S using the settings below
  391. */
  392. #define CONFIG_STACKSIZE (128 << 10) /* regular stack 128 KiB */
  393. /*
  394. * Physical Memory Map
  395. */
  396. #define CONFIG_NR_DRAM_BANKS 2
  397. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  398. /*
  399. * FLASH and environment organization
  400. */
  401. #define CONFIG_ENV_IS_NOWHERE
  402. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  403. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  404. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  405. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  406. CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  407. /*
  408. * Attached kernel image
  409. */
  410. #define SDRAM_SIZE 0x10000000 /* 256 MB */
  411. #define SDRAM_END (CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
  412. #define IMAGE_MAXSIZE 0x1FF800 /* 2 MB - 2 kB */
  413. #define KERNEL_OFFSET 0x40000 /* 256 kB */
  414. #define KERNEL_MAXSIZE (IMAGE_MAXSIZE-KERNEL_OFFSET)
  415. #define KERNEL_ADDRESS (SDRAM_END-KERNEL_MAXSIZE)
  416. /* Reserve protected RAM for attached kernel */
  417. #define CONFIG_PRAM ((KERNEL_MAXSIZE >> 10)+1)
  418. #endif /* __CONFIG_H */