dns325.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*
  2. * Copyright (C) 2011
  3. * Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
  4. *
  5. * Based on Kirkwood support:
  6. * (C) Copyright 2009
  7. * Marvell Semiconductor <www.marvell.com>
  8. * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
  9. *
  10. * SPDX-License-Identifier: GPL-2.0+
  11. */
  12. #ifndef _CONFIG_DNS325_H
  13. #define _CONFIG_DNS325_H
  14. /*
  15. * Machine number definition
  16. */
  17. #define MACH_TYPE_DNS325 3800
  18. #define CONFIG_MACH_TYPE MACH_TYPE_DNS325
  19. /*
  20. * High Level Configuration Options (easy to change)
  21. */
  22. #define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
  23. #define CONFIG_KW88F6281 /* SOC Name */
  24. #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
  25. /*
  26. * Commands configuration
  27. */
  28. #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
  29. #define CONFIG_CMD_ENV
  30. #define CONFIG_CMD_NAND
  31. #define CONFIG_CMD_IDE
  32. #define CONFIG_CMD_DATE
  33. #define CONFIG_SYS_MVFS
  34. #define CONFIG_NR_DRAM_BANKS 1
  35. /*
  36. * mv-common.h should be defined after CMD configs since it used them
  37. * to enable certain macros
  38. */
  39. #include "mv-common.h"
  40. /* Remove or override few declarations from mv-common.h */
  41. /*
  42. * Ethernet Driver configuration
  43. */
  44. #ifdef CONFIG_CMD_NET
  45. #define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
  46. #define CONFIG_NETCONSOLE
  47. #endif
  48. /*
  49. * SATA Driver configuration
  50. */
  51. #ifdef CONFIG_MVSATA_IDE
  52. #define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
  53. #define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
  54. #endif
  55. /*
  56. * RTC driver configuration
  57. */
  58. #ifdef CONFIG_CMD_DATE
  59. #define CONFIG_RTC_MV
  60. #endif
  61. /*
  62. * Enable GPI0 support
  63. */
  64. #define CONFIG_KIRKWOOD_GPIO
  65. /*
  66. * Environment variables configurations
  67. */
  68. #ifdef CONFIG_CMD_NAND
  69. #define CONFIG_ENV_IS_IN_NAND
  70. #define CONFIG_ENV_SECT_SIZE 0x20000 /* 128KB */
  71. #else
  72. #define CONFIG_ENV_IS_NOWHERE
  73. #endif
  74. #define CONFIG_ENV_SIZE 0x20000 /* 128KB */
  75. #define CONFIG_ENV_ADDR 0xe0000
  76. #define CONFIG_ENV_OFFSET 0xe0000 /* env starts here */
  77. /*
  78. * Default environment variables
  79. */
  80. #define MTDIDS_DEFAULT "nand0=orion_nand"
  81. #define MTDPARTS_DEFAULT "mtdparts=orion_nand:" \
  82. "896k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)\0"
  83. #define CONFIG_EXTRA_ENV_SETTINGS \
  84. "stdin=serial\0" \
  85. "stdout=serial\0" \
  86. "stderr=serial\0" \
  87. "loadaddr=0x800000\0" \
  88. "autoload=no\0" \
  89. "console=ttyS0,115200\0" \
  90. "mtdparts="MTDPARTS_DEFAULT \
  91. "optargs=\0" \
  92. "bootenv=uEnv.txt\0" \
  93. "importbootenv=echo Importing environment ...; " \
  94. "env import -t ${loadaddr} ${filesize}\0" \
  95. "loadbootenv=fatload usb 0 ${loadaddr} ${bootenv}\0" \
  96. "setbootargs=setenv bootargs console=${console} " \
  97. "${optargs} " \
  98. "${mtdparts} " \
  99. "root=${bootenvroot} " \
  100. "rootfstype=${bootenvrootfstype}\0" \
  101. "subbootcmd=run setbootargs; " \
  102. "if run bootenvloadimage; then " \
  103. "bootm ${loadaddr};" \
  104. "fi;\0" \
  105. "nandroot=ubi0:rootfs ubi.mtd=rootfs\0" \
  106. "nandrootfstype=ubifs\0" \
  107. "nandloadimage=nand read ${loadaddr} kernel\0" \
  108. "setnandbootenv=echo Booting from nand ...; " \
  109. "setenv bootenvroot ${nandroot}; " \
  110. "setenv bootenvrootfstype ${nandrootfstype}; " \
  111. "setenv bootenvloadimage ${nandloadimage}\0"
  112. #define CONFIG_BOOTCOMMAND \
  113. "if test -n ${bootenv} && usb start; then " \
  114. "if run loadbootenv; then " \
  115. "echo Loaded environment ${bootenv} from usb;" \
  116. "run importbootenv;" \
  117. "fi;" \
  118. "if test -n ${bootenvcmd}; then " \
  119. "echo Running bootenvcmd ...;" \
  120. "run bootenvcmd;" \
  121. "fi;" \
  122. "fi;" \
  123. "run setnandbootenv subbootcmd;"
  124. #endif /* _CONFIG_DNS325_H */