sniper.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /*
  2. * LG Optimus Black codename sniper config
  3. *
  4. * Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #ifndef __CONFIG_H
  9. #define __CONFIG_H
  10. #include <asm/arch/cpu.h>
  11. #include <asm/arch/omap.h>
  12. /*
  13. * CPU
  14. */
  15. #define CONFIG_ARM_ARCH_CP15_ERRATA
  16. #define CONFIG_ARM_ERRATA_454179
  17. #define CONFIG_ARM_ERRATA_430973
  18. #define CONFIG_ARM_ERRATA_621766
  19. /*
  20. * Platform
  21. */
  22. #define CONFIG_OMAP
  23. /*
  24. * Board
  25. */
  26. #define CONFIG_MISC_INIT_R
  27. /*
  28. * Clocks
  29. */
  30. #define CONFIG_SYS_TIMERBASE OMAP34XX_GPT2
  31. #define CONFIG_SYS_PTV 2
  32. #define V_NS16550_CLK 48000000
  33. #define V_OSCK 26000000
  34. #define V_SCLK (V_OSCK >> 1)
  35. /*
  36. * DRAM
  37. */
  38. #define CONFIG_SDRC
  39. #define CONFIG_NR_DRAM_BANKS 2
  40. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  41. #define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
  42. /*
  43. * Memory
  44. */
  45. #define CONFIG_SYS_TEXT_BASE 0x80100000
  46. #define CONFIG_SYS_SDRAM_BASE 0x80000000
  47. #define CONFIG_SYS_INIT_SP_ADDR (NON_SECURE_SRAM_END - \
  48. GENERATED_GBL_DATA_SIZE)
  49. #define CONFIG_SYS_MALLOC_LEN (1024 * 1024 + CONFIG_ENV_SIZE)
  50. /*
  51. * GPIO
  52. */
  53. #define CONFIG_OMAP_GPIO
  54. #define CONFIG_OMAP3_GPIO_2
  55. #define CONFIG_OMAP3_GPIO_3
  56. #define CONFIG_OMAP3_GPIO_4
  57. #define CONFIG_OMAP3_GPIO_5
  58. #define CONFIG_OMAP3_GPIO_6
  59. /*
  60. * I2C
  61. */
  62. #define CONFIG_SYS_I2C
  63. #define CONFIG_SYS_OMAP24_I2C_SPEED 400000
  64. #define CONFIG_SYS_OMAP24_I2C_SLAVE 1
  65. #define CONFIG_SYS_I2C_OMAP34XX
  66. #define CONFIG_I2C_MULTI_BUS
  67. /*
  68. * Flash
  69. */
  70. #define CONFIG_SYS_NO_FLASH
  71. /*
  72. * MMC
  73. */
  74. #define CONFIG_GENERIC_MMC
  75. #define CONFIG_OMAP_HSMMC
  76. /*
  77. * Power
  78. */
  79. #define CONFIG_TWL4030_POWER
  80. /*
  81. * Input
  82. */
  83. #define CONFIG_TWL4030_INPUT
  84. /*
  85. * Partitions
  86. */
  87. #define CONFIG_PARTITION_UUIDS
  88. #define CONFIG_CMD_PART
  89. /*
  90. * SPL
  91. */
  92. #define CONFIG_SPL_FRAMEWORK
  93. #define CONFIG_SPL_TEXT_BASE 0x40200000
  94. #define CONFIG_SPL_MAX_SIZE (SRAM_SCRATCH_SPACE_ADDR - \
  95. CONFIG_SPL_TEXT_BASE)
  96. #define CONFIG_SPL_BSS_START_ADDR 0x80000000
  97. #define CONFIG_SPL_BSS_MAX_SIZE (512 * 1024)
  98. #define CONFIG_SYS_SPL_MALLOC_START 0x80208000
  99. #define CONFIG_SYS_SPL_MALLOC_SIZE (1024 * 1024)
  100. #define CONFIG_SPL_STACK LOW_LEVEL_SRAM_STACK
  101. #define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
  102. #define CONFIG_SPL_BOARD_INIT
  103. #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 2
  104. #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
  105. #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
  106. #define CONFIG_AUTO_COMPLETE
  107. #define CONFIG_SYS_LONGHELP
  108. #define CONFIG_SYS_MAXARGS 16
  109. #define CONFIG_SYS_CBSIZE 512
  110. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) \
  111. + 16)
  112. /*
  113. * Serial
  114. */
  115. #ifdef CONFIG_SPL_BUILD
  116. #define CONFIG_SYS_NS16550_SERIAL
  117. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  118. #endif
  119. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  120. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  121. #define CONFIG_CONS_INDEX 3
  122. #define CONFIG_BAUDRATE 115200
  123. #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, \
  124. 115200 }
  125. /*
  126. * USB gadget
  127. */
  128. #define CONFIG_USB_MUSB_PIO_ONLY
  129. #define CONFIG_USB_MUSB_OMAP2PLUS
  130. #define CONFIG_TWL4030_USB
  131. /*
  132. * Fastboot
  133. */
  134. #define CONFIG_USB_FUNCTION_FASTBOOT
  135. #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
  136. #define CONFIG_FASTBOOT_BUF_SIZE 0x2000000
  137. #define CONFIG_FASTBOOT_FLASH
  138. #define CONFIG_FASTBOOT_FLASH_MMC_DEV 0
  139. #define CONFIG_CMD_FASTBOOT
  140. /*
  141. * Environment
  142. */
  143. #define CONFIG_ENV_SIZE (128 * 1024)
  144. #define CONFIG_ENV_IS_NOWHERE
  145. #define CONFIG_ENV_OVERWRITE
  146. #define CONFIG_EXTRA_ENV_SETTINGS \
  147. "kernel_addr_r=0x82000000\0" \
  148. "loadaddr=0x82000000\0" \
  149. "fdt_addr_r=0x88000000\0" \
  150. "fdtaddr=0x88000000\0" \
  151. "ramdisk_addr_r=0x88080000\0" \
  152. "pxefile_addr_r=0x80100000\0" \
  153. "scriptaddr=0x80000000\0" \
  154. "bootm_size=0x10000000\0" \
  155. "boot_mmc_dev=0\0" \
  156. "kernel_mmc_part=3\0" \
  157. "recovery_mmc_part=4\0" \
  158. "fdtfile=omap3-sniper.dtb\0" \
  159. "bootfile=/boot/extlinux/extlinux.conf\0" \
  160. "bootargs=console=ttyO2,115200 vram=5M,0x9FA00000 omapfb.vram=0:5M\0"
  161. /*
  162. * ATAGs
  163. */
  164. #define CONFIG_SETUP_MEMORY_TAGS
  165. #define CONFIG_CMDLINE_TAG
  166. #define CONFIG_INITRD_TAG
  167. #define CONFIG_REVISION_TAG
  168. #define CONFIG_SERIAL_TAG
  169. /*
  170. * Boot
  171. */
  172. #define CONFIG_SYS_LOAD_ADDR 0x82000000
  173. #define CONFIG_ANDROID_BOOT_IMAGE
  174. #define CONFIG_BOOTCOMMAND \
  175. "setenv boot_mmc_part ${kernel_mmc_part}; " \
  176. "if test reboot-${reboot-mode} = reboot-r; then " \
  177. "echo recovery; setenv boot_mmc_part ${recovery_mmc_part}; fi; " \
  178. "if test reboot-${reboot-mode} = reboot-b; then " \
  179. "echo fastboot; fastboot 0; fi; " \
  180. "part start mmc ${boot_mmc_dev} ${boot_mmc_part} boot_mmc_start; " \
  181. "part size mmc ${boot_mmc_dev} ${boot_mmc_part} boot_mmc_size; " \
  182. "mmc dev ${boot_mmc_dev}; " \
  183. "mmc read ${kernel_addr_r} ${boot_mmc_start} ${boot_mmc_size} && " \
  184. "bootm ${kernel_addr_r};"
  185. /*
  186. * Defaults
  187. */
  188. #include <config_defaults.h>
  189. #include <config_distro_defaults.h>
  190. #endif