phycore_am335x_r2.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * phycore_am335x_r2.h
  4. *
  5. * Phytec phyCORE-AM335x R2 (PCL060 / PCM060) boards information header
  6. *
  7. * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
  8. * Copyright (C) 2013 Lars Poeschel, Lemonage Software GmbH
  9. * Copyright (C) 2019 DENX Software Engineering GmbH
  10. */
  11. #ifndef __CONFIG_PHYCORE_AM335x_R2_H
  12. #define __CONFIG_PHYCORE_AM335x_R2_H
  13. #include <configs/ti_am335x_common.h>
  14. #define CONFIG_MACH_TYPE MACH_TYPE_SBC_PHYCORE_AM335X
  15. #define CONFIG_SYS_MMC_ENV_DEV 0
  16. #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
  17. #ifdef CONFIG_MTD_RAW_NAND
  18. #define NANDARGS \
  19. "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
  20. "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
  21. "nandargs=setenv bootargs console=${console} " \
  22. "${optargs} " \
  23. "root=${nandroot} " \
  24. "rootfstype=${nandrootfstype}\0" \
  25. "nandroot=ubi0:root ubi.mtd=NAND.UBI\0" \
  26. "nandrootfstype=ubifs rootwait rw fsck.repair=yes\0" \
  27. "nandboot=echo Booting from nand ...; " \
  28. "run nandargs; " \
  29. "ubi part NAND.UBI; " \
  30. "ubi readvol ${fdtaddr} oftree; " \
  31. "ubi readvol ${loadaddr} kernel; " \
  32. "bootz ${loadaddr} - ${fdtaddr}\0"
  33. #else
  34. #define NANDARGS ""
  35. #endif
  36. /* set to negative value for no autoboot */
  37. #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
  38. "bootcmd_" #devtypel #instance "=" \
  39. "setenv mmcdev " #instance "; "\
  40. "setenv bootpart " #instance ":1 ; "\
  41. "setenv rootpart " #instance ":2 ; "\
  42. "run mmcboot\0"
  43. #define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
  44. #devtypel #instance " "
  45. #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
  46. "bootcmd_" #devtypel #instance "=" \
  47. "run nandboot\0"
  48. #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
  49. #devtypel #instance " "
  50. #define BOOT_TARGET_DEVICES(func) \
  51. func(MMC, mmc, 0) \
  52. func(LEGACY_MMC, legacy_mmc, 0) \
  53. func(MMC, mmc, 1) \
  54. func(LEGACY_MMC, legacy_mmc, 1) \
  55. func(NAND, nand, 0)
  56. #include <config_distro_bootcmd.h>
  57. #include <environment/ti/dfu.h>
  58. #include <environment/ti/mmc.h>
  59. #define CONFIG_EXTRA_ENV_SETTINGS \
  60. DEFAULT_MMC_TI_ARGS \
  61. DEFAULT_LINUX_BOOT_ENV \
  62. "bootfile=zImage\0" \
  63. "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
  64. "console=ttyS0,115200\0" \
  65. "optargs=\0" \
  66. "mmcrootfstype=ext2 rootwait\0" \
  67. "finduuid=part uuid mmc ${rootpart} uuid\0" \
  68. "boot_fit=0\0" \
  69. NANDARGS \
  70. BOOTENV
  71. /* Clock Macros */
  72. #define V_OSCK 25000000 /* Clock output from T2 */
  73. #define V_SCLK V_OSCK
  74. #define CONFIG_POWER_TPS65910
  75. #ifdef CONFIG_MTD_RAW_NAND
  76. /* NAND: device related configs */
  77. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  78. #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
  79. CONFIG_SYS_NAND_PAGE_SIZE)
  80. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  81. #define CONFIG_SYS_NAND_OOBSIZE 64
  82. #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
  83. /* NAND: driver related configs */
  84. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  85. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  86. 10, 11, 12, 13, 14, 15, 16, 17, \
  87. 18, 19, 20, 21, 22, 23, 24, 25, \
  88. 26, 27, 28, 29, 30, 31, 32, 33, \
  89. 34, 35, 36, 37, 38, 39, 40, 41, \
  90. 42, 43, 44, 45, 46, 47, 48, 49, \
  91. 50, 51, 52, 53, 54, 55, 56, 57, }
  92. #define CONFIG_SYS_NAND_ECCSIZE 512
  93. #define CONFIG_SYS_NAND_ECCBYTES 14
  94. #define CONFIG_SYS_NAND_ONFI_DETECTION
  95. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
  96. /* NAND: SPL related configs */
  97. #ifdef CONFIG_SPL_OS_BOOT
  98. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */
  99. #endif
  100. #endif /* !CONFIG_MTD_RAW_NAND */
  101. /* CPU */
  102. #ifdef CONFIG_SPI_BOOT
  103. #define CONFIG_SYS_SPI_U_BOOT_SIZE 0x40000
  104. #elif defined(CONFIG_ENV_IS_IN_NAND)
  105. #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
  106. #endif
  107. #endif /* ! __CONFIG_PHYCORE_AM335x_R2_H */