crs3xx-98dx3236.c 1.9 KB

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