vinco.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Configuration settings for the VInCo platform.
  4. *
  5. * Based on the settings for the SAMA5-EK board
  6. * Copyright (C) 2014 Atmel
  7. * Bo Shen <voice.shen@atmel.com>
  8. * Copyright (C) 2015 Free Electrons
  9. * Gregory CLEMENT gregory.clement@free-electrons.com
  10. */
  11. #ifndef __CONFIG_H
  12. #define __CONFIG_H
  13. #include "at91-sama5_common.h"
  14. /* The value in the common file is too far away for the VInCo platform */
  15. /* serial console */
  16. #define CONFIG_ATMEL_USART
  17. #define CONFIG_USART_BASE 0xfc00c000
  18. #define CONFIG_USART_ID 30
  19. /* Timer */
  20. #define CONFIG_SYS_TIMER_COUNTER 0xfc06863c
  21. /* SDRAM */
  22. #define CONFIG_SYS_SDRAM_BASE 0x20000000
  23. #define CONFIG_SYS_SDRAM_SIZE 0x4000000
  24. #define CONFIG_SYS_INIT_SP_ADDR \
  25. (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
  26. #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
  27. /* SerialFlash */
  28. #ifdef CONFIG_CMD_SF
  29. #define CONFIG_ATMEL_SPI0
  30. #define CONFIG_SPI_FLASH_STMICRO
  31. #endif
  32. /* MMC */
  33. #ifdef CONFIG_CMD_MMC
  34. #define CONFIG_GENERIC_ATMEL_MCI
  35. #define ATMEL_BASE_MMCI 0xfc000000
  36. #define CONFIG_SYS_MMC_CLK_OD 500000
  37. /* For generating MMC partitions */
  38. #endif
  39. /* USB device */
  40. /* Ethernet Hardware */
  41. #define CONFIG_PHY_SMSC
  42. #define CONFIG_MACB
  43. #define CONFIG_RMII
  44. #define CONFIG_NET_RETRY_COUNT 20
  45. #define CONFIG_MACB_SEARCH_PHY
  46. #ifdef CONFIG_SPI_BOOT
  47. /* bootstrap + u-boot + env + linux in serial flash */
  48. /* Use our own mapping for the VInCo platform */
  49. /* Update the bootcommand according to our mapping for the VInCo platform */
  50. #undef CONFIG_BOOTCOMMAND
  51. #define CONFIG_BOOTCOMMAND "mmc dev 0 0;" \
  52. "mmc read ${loadaddr} ${k_offset} ${k_blksize};" \
  53. "mmc read ${oftaddr} ${dtb_offset} ${dtb_blksize};" \
  54. "bootz ${loadaddr} - ${oftaddr}"
  55. #define CONFIG_EXTRA_ENV_SETTINGS \
  56. "kernel_start=0x20000\0" \
  57. "kernel_size=0x800000\0" \
  58. "mmcblksize=0x200\0" \
  59. "oftaddr=0x21000000\0" \
  60. "loadaddr=0x22000000\0" \
  61. "update_uboot=tftp ${loadaddr} u-boot.bin;sf probe 0;" \
  62. "sf erase 0x20000 0x4B000; sf write ${loadaddr} 0x20000 0x4B000\0" \
  63. "create_partition=setexpr dtb_start ${kernel_start} + 0x400000;" \
  64. "setexpr rootfs_start ${kernel_start} + ${kernel_size};" \
  65. "setenv partitions 'name=kernel,size=${kernel_size}," \
  66. "start=${kernel_start};name=rootfs,size=-';" \
  67. "gpt write mmc 0 ${partitions} \0"\
  68. "f2blk_size=setexpr fileblksize ${filesize} / ${mmcblksize};" \
  69. "setexpr fileblksize ${fileblksize} + 1\0" \
  70. "store_kernel=tftp ${loadaddr} zImage; run f2blk_size;" \
  71. "setexpr k_blksize ${fileblksize};" \
  72. "setexpr k_offset ${kernel_start} / ${mmcblksize};" \
  73. "mmc write ${fileaddr} ${k_offset} ${fileblksize}\0" \
  74. "store_dtb=tftp ${loadaddr} at91-vinco.dtb; run f2blk_size;" \
  75. "setexpr dtb_blksize ${fileblksize};" \
  76. "setexpr dtb_offset ${dtb_start} / ${mmcblksize};" \
  77. "mmc write ${fileaddr} ${dtb_offset} ${fileblksize}\0" \
  78. "store_rootfs=tftp ${loadaddr} vinco-gateway-image-vinco.ext4;" \
  79. "setexpr rootfs_offset ${rootfs_start} / ${mmcblksize};" \
  80. "mmc write ${fileaddr} ${rootfs_offset} ${fileblksize}\0" \
  81. "bootdelay=0\0"
  82. #endif
  83. #endif