etamin.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2013 Siemens Schweiz AG
  4. * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de.
  5. *
  6. * Based on:
  7. * U-Boot file:/include/configs/am335x_evm.h
  8. *
  9. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
  10. */
  11. #ifndef __CONFIG_ETAMIN_H
  12. #define __CONFIG_ETAMIN_H
  13. #include "siemens-am33x-common.h"
  14. /* NAND specific changes for etamin due to different page size */
  15. #undef CONFIG_SYS_NAND_ECCPOS
  16. #undef CONFIG_SYS_ENV_SECT_SIZE
  17. #undef CONFIG_NAND_OMAP_ECCSCHEME
  18. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH16_CODE_HW
  19. #define CONFIG_SYS_ENV_SECT_SIZE (512 << 10) /* 512 KiB */
  20. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  21. 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \
  22. 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, \
  23. 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, \
  24. 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \
  25. 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, \
  26. 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, \
  27. 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, \
  28. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, \
  29. 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \
  30. 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \
  31. 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, \
  32. 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, \
  33. 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, \
  34. 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, \
  35. 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, \
  36. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, \
  37. 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, \
  38. 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, \
  39. 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, \
  40. 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, \
  41. }
  42. #undef CONFIG_SYS_NAND_ECCSIZE
  43. #undef CONFIG_SYS_NAND_ECCBYTES
  44. #define CONFIG_SYS_NAND_ECCSIZE 512
  45. #define CONFIG_SYS_NAND_ECCBYTES 26
  46. #undef CONFIG_SYS_MAX_NAND_DEVICE
  47. #define CONFIG_SYS_MAX_NAND_DEVICE 3
  48. #define CONFIG_SYS_NAND_BASE2 (0x18000000) /* physical address */
  49. #define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE, \
  50. CONFIG_SYS_NAND_BASE2}
  51. #define DDR_PLL_FREQ 303
  52. /* FWD Button = 27
  53. * SRV Button = 87 */
  54. #define BOARD_DFU_BUTTON_GPIO 27
  55. #define GPIO_LAN9303_NRST 88 /* GPIO2_24 = gpio88 */
  56. /* In dfu mode keep led1 on */
  57. #define CONFIG_ENV_SETTINGS_BUTTONS_AND_LEDS \
  58. "button_dfu0=27\0" \
  59. "button_dfu1=87\0" \
  60. "led0=3,0,1\0" \
  61. "led1=4,0,0\0" \
  62. "led2=5,0,1\0" \
  63. "led3=87,0,1\0" \
  64. "led4=60,0,1\0" \
  65. "led5=63,0,1\0"
  66. /* Physical Memory Map */
  67. #define CONFIG_MAX_RAM_BANK_SIZE (1024 << 20) /* 1GB */
  68. #define EEPROM_ADDR_DDR3 0x90
  69. #define EEPROM_ADDR_CHIP 0x120
  70. #define CONFIG_FACTORYSET
  71. /* use both define to compile a SPL compliance test */
  72. /*
  73. #define CONFIG_SPL_CMT
  74. #define CONFIG_SPL_CMT_DEBUG
  75. */
  76. /* nedded by compliance test in read mode */
  77. #if defined(CONFIG_SPL_CMT)
  78. #define CONFIG_SYS_DCACHE_OFF
  79. #endif
  80. /* Define own nand partitions */
  81. #define CONFIG_ENV_RANGE (4 * CONFIG_SYS_ENV_SECT_SIZE)
  82. #undef COMMON_ENV_DFU_ARGS
  83. #define COMMON_ENV_DFU_ARGS "dfu_args=run bootargs_defaults;" \
  84. "setenv bootargs ${bootargs};" \
  85. "mtdparts default;" \
  86. "draco_led 1;" \
  87. "dfu 0 mtd 0;" \
  88. "draco_led 0;\0" \
  89. #undef DFU_ALT_INFO_NAND_V2
  90. #define DFU_ALT_INFO_NAND_V2 \
  91. "spl mtddev;" \
  92. "spl.backup1 mtddev;" \
  93. "spl.backup2 mtddev;" \
  94. "spl.backup3 mtddev;" \
  95. "u-boot mtddev;" \
  96. "u-boot.env0 mtddev;" \
  97. "u-boot.env1 mtddev;" \
  98. "rootfs mtddevubi" \
  99. #undef CONFIG_ENV_SETTINGS_NAND_V2
  100. #define CONFIG_ENV_SETTINGS_NAND_V2 \
  101. "nand_active_ubi_vol=rootfs_a\0" \
  102. "rootfs_name=rootfs\0" \
  103. "kernel_name=uImage\0"\
  104. "nand_root_fs_type=ubifs rootwait=1\0" \
  105. "nand_args=run bootargs_defaults;" \
  106. "mtdparts default;" \
  107. "setenv ${partitionset_active} true;" \
  108. "if test -n ${A}; then " \
  109. "setenv nand_active_ubi_vol ${rootfs_name}_a;" \
  110. "fi;" \
  111. "if test -n ${B}; then " \
  112. "setenv nand_active_ubi_vol ${rootfs_name}_b;" \
  113. "fi;" \
  114. "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
  115. "ubi.mtd=rootfs,${ubi_off};" \
  116. "setenv bootargs ${bootargs} " \
  117. "root=${nand_root} noinitrd ${mtdparts} " \
  118. "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
  119. "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
  120. "=mtdoops\0" \
  121. COMMON_ENV_DFU_ARGS \
  122. "dfu_alt_info=" DFU_ALT_INFO_NAND_V2 "\0" \
  123. COMMON_ENV_NAND_BOOT \
  124. "ubi part rootfs ${ubi_off};" \
  125. "ubifsmount ubi0:${nand_active_ubi_vol};" \
  126. "ubifsload ${kloadaddr} boot/${kernel_name};" \
  127. "ubifsload ${loadaddr} boot/${dtb_name}.dtb;" \
  128. "bootm ${kloadaddr} - ${loadaddr}\0" \
  129. "nand_boot_backup=ubifsload ${loadaddr} boot/am335x-draco.dtb;" \
  130. "bootm ${kloadaddr} - ${loadaddr}\0" \
  131. COMMON_ENV_NAND_CMDS
  132. #ifndef CONFIG_SPL_BUILD
  133. #define CONFIG_NAND_CS_INIT
  134. #define ETAMIN_NAND_GPMC_CONFIG1 0x00000800
  135. #define ETAMIN_NAND_GPMC_CONFIG2 0x001e1e00
  136. #define ETAMIN_NAND_GPMC_CONFIG3 0x001e1e00
  137. #define ETAMIN_NAND_GPMC_CONFIG4 0x16051807
  138. #define ETAMIN_NAND_GPMC_CONFIG5 0x00151e1e
  139. #define ETAMIN_NAND_GPMC_CONFIG6 0x16000f80
  140. #define CONFIG_MTD_CONCAT
  141. /* Default env settings */
  142. #define CONFIG_EXTRA_ENV_SETTINGS \
  143. "hostname=etamin\0" \
  144. "ubi_off=4096\0"\
  145. "nand_img_size=0x400000\0" \
  146. "optargs=\0" \
  147. "preboot=draco_led 0\0" \
  148. CONFIG_ENV_SETTINGS_BUTTONS_AND_LEDS \
  149. CONFIG_ENV_SETTINGS_V2 \
  150. CONFIG_ENV_SETTINGS_NAND_V2
  151. #ifndef CONFIG_RESTORE_FLASH
  152. #define CONFIG_BOOTCOMMAND \
  153. "if dfubutton; then " \
  154. "run dfu_start; " \
  155. "reset; " \
  156. "fi;" \
  157. "run nand_boot;" \
  158. "run nand_boot_backup;" \
  159. "reset;"
  160. #else
  161. #define CONFIG_BOOTCOMMAND \
  162. "setenv autoload no; " \
  163. "dhcp; " \
  164. "if tftp 80000000 debrick.scr; then " \
  165. "source 80000000; " \
  166. "fi"
  167. #endif
  168. #endif /* CONFIG_SPL_BUILD */
  169. #endif /* ! __CONFIG_ETAMIN_H */