sniper.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * LG Optimus Black codename sniper config
  4. *
  5. * Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
  6. */
  7. #ifndef __CONFIG_H
  8. #define __CONFIG_H
  9. #include <asm/arch/cpu.h>
  10. #include <asm/arch/omap.h>
  11. /*
  12. * CPU
  13. */
  14. #define CONFIG_ARM_ARCH_CP15_ERRATA
  15. /*
  16. * Board
  17. */
  18. /*
  19. * Clocks
  20. */
  21. #define CONFIG_SYS_TIMERBASE OMAP34XX_GPT2
  22. #define CONFIG_SYS_PTV 2
  23. #define V_NS16550_CLK 48000000
  24. #define V_OSCK 26000000
  25. #define V_SCLK (V_OSCK >> 1)
  26. /*
  27. * DRAM
  28. */
  29. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  30. #define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
  31. /*
  32. * Memory
  33. */
  34. #define CONFIG_SYS_SDRAM_BASE 0x80000000
  35. #define CONFIG_SYS_INIT_SP_ADDR (NON_SECURE_SRAM_END - \
  36. GENERATED_GBL_DATA_SIZE)
  37. #define CONFIG_SYS_MALLOC_LEN (1024 * 1024 + CONFIG_ENV_SIZE)
  38. /*
  39. * I2C
  40. */
  41. #define CONFIG_SYS_I2C
  42. #define CONFIG_I2C_MULTI_BUS
  43. /*
  44. * Input
  45. */
  46. /*
  47. * SPL
  48. */
  49. #define CONFIG_SPL_MAX_SIZE (SRAM_SCRATCH_SPACE_ADDR - \
  50. CONFIG_SPL_TEXT_BASE)
  51. #define CONFIG_SPL_BSS_START_ADDR 0x80000000
  52. #define CONFIG_SPL_BSS_MAX_SIZE (512 * 1024)
  53. #define CONFIG_SYS_SPL_MALLOC_START 0x80208000
  54. #define CONFIG_SYS_SPL_MALLOC_SIZE (1024 * 1024)
  55. #define CONFIG_SPL_STACK LOW_LEVEL_SRAM_STACK
  56. #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
  57. #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
  58. #define CONFIG_SYS_CBSIZE 512
  59. /*
  60. * Serial
  61. */
  62. #ifdef CONFIG_SPL_BUILD
  63. #define CONFIG_SYS_NS16550_SERIAL
  64. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  65. #endif
  66. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  67. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  68. #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, \
  69. 115200 }
  70. /*
  71. * Environment
  72. */
  73. #define CONFIG_ENV_OVERWRITE
  74. #define CONFIG_EXTRA_ENV_SETTINGS \
  75. "kernel_addr_r=0x82000000\0" \
  76. "loadaddr=0x82000000\0" \
  77. "fdt_addr_r=0x88000000\0" \
  78. "fdtaddr=0x88000000\0" \
  79. "ramdisk_addr_r=0x88080000\0" \
  80. "pxefile_addr_r=0x80100000\0" \
  81. "scriptaddr=0x80000000\0" \
  82. "bootm_size=0x10000000\0" \
  83. "boot_mmc_dev=0\0" \
  84. "kernel_mmc_part=3\0" \
  85. "recovery_mmc_part=4\0" \
  86. "fdtfile=omap3-sniper.dtb\0" \
  87. "bootfile=/boot/extlinux/extlinux.conf\0" \
  88. "bootargs=console=ttyO2,115200 vram=5M,0x9FA00000 omapfb.vram=0:5M\0"
  89. /*
  90. * ATAGs
  91. */
  92. #define CONFIG_SETUP_MEMORY_TAGS
  93. #define CONFIG_CMDLINE_TAG
  94. #define CONFIG_INITRD_TAG
  95. #define CONFIG_REVISION_TAG
  96. #define CONFIG_SERIAL_TAG
  97. /*
  98. * Boot
  99. */
  100. #define CONFIG_SYS_LOAD_ADDR 0x82000000
  101. #define CONFIG_BOOTCOMMAND \
  102. "setenv boot_mmc_part ${kernel_mmc_part}; " \
  103. "if test reboot-${reboot-mode} = reboot-r; then " \
  104. "echo recovery; setenv boot_mmc_part ${recovery_mmc_part}; fi; " \
  105. "if test reboot-${reboot-mode} = reboot-b; then " \
  106. "echo fastboot; fastboot 0; fi; " \
  107. "part start mmc ${boot_mmc_dev} ${boot_mmc_part} boot_mmc_start; " \
  108. "part size mmc ${boot_mmc_dev} ${boot_mmc_part} boot_mmc_size; " \
  109. "mmc dev ${boot_mmc_dev}; " \
  110. "mmc read ${kernel_addr_r} ${boot_mmc_start} ${boot_mmc_size} && " \
  111. "bootm ${kernel_addr_r};"
  112. /*
  113. * Defaults
  114. */
  115. #include <config_defaults.h>
  116. #endif