crs305-1g-4s.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2015 Stefan Roese <sr@denx.de>
  4. */
  5. #include <common.h>
  6. #include <i2c.h>
  7. #include <asm/gpio.h>
  8. #include <linux/mbus.h>
  9. #include <linux/io.h>
  10. #include <asm/arch/cpu.h>
  11. #include <asm/arch/soc.h>
  12. DECLARE_GLOBAL_DATA_PTR;
  13. /*
  14. * These values and defines are taken from the Marvell U-Boot version
  15. * "u-boot-2013.01-2016_T1.0.eng_drop_v6"
  16. */
  17. #define DB_DX_AC3_GPP_OUT_ENA_LOW (~(BIT(0) | BIT(2) | BIT(3) | BIT(4) \
  18. | BIT(6) | BIT(12) | BIT(13) \
  19. | BIT(16) | BIT(17) | BIT(20) \
  20. | BIT(29) | BIT(30)))
  21. #define DB_DX_AC3_GPP_OUT_ENA_MID (~(0))
  22. #define DB_DX_AC3_GPP_OUT_VAL_LOW (BIT(0) | BIT(2) | BIT(3) | BIT(4) \
  23. | BIT(6) | BIT(12) | BIT(13) \
  24. | BIT(16) | BIT(17) | BIT(20) \
  25. | BIT(29) | BIT(30))
  26. #define DB_DX_AC3_GPP_OUT_VAL_MID 0x0
  27. #define DB_DX_AC3_GPP_POL_LOW 0x0
  28. #define DB_DX_AC3_GPP_POL_MID 0x0
  29. int board_early_init_f(void)
  30. {
  31. /* Configure MPP */
  32. writel(0x00142222, MVEBU_MPP_BASE + 0x00);
  33. writel(0x11122000, MVEBU_MPP_BASE + 0x04);
  34. writel(0x44444004, MVEBU_MPP_BASE + 0x08);
  35. writel(0x14444444, MVEBU_MPP_BASE + 0x0c);
  36. writel(0x00000001, MVEBU_MPP_BASE + 0x10);
  37. /*
  38. * MVEBU_GPIO0_BASE is the User LED
  39. * MVEBU_GPIO1_BASE is the Reset Button (currently not used)
  40. */
  41. /* Set GPP Out value */
  42. writel(DB_DX_AC3_GPP_OUT_VAL_LOW, MVEBU_GPIO0_BASE + 0x00);
  43. /* writel(DB_DX_AC3_GPP_OUT_VAL_MID, MVEBU_GPIO1_BASE + 0x00); */
  44. /* Set GPP Polarity */
  45. writel(DB_DX_AC3_GPP_POL_LOW, MVEBU_GPIO0_BASE + 0x0c);
  46. /* writel(DB_DX_AC3_GPP_POL_MID, MVEBU_GPIO1_BASE + 0x0c); */
  47. /* Set GPP Out Enable */
  48. writel(DB_DX_AC3_GPP_OUT_ENA_LOW, MVEBU_GPIO0_BASE + 0x04);
  49. /* writel(DB_DX_AC3_GPP_OUT_ENA_MID, MVEBU_GPIO1_BASE + 0x04); */
  50. return 0;
  51. }
  52. int board_init(void)
  53. {
  54. /* address of boot parameters */
  55. gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
  56. return 0;
  57. }
  58. int checkboard(void)
  59. {
  60. puts("Board: " CONFIG_SYS_BOARD "\n");
  61. return 0;
  62. }