spear600.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2009
  4. * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
  5. */
  6. #include <common.h>
  7. #include <miiphy.h>
  8. #include <net.h>
  9. #include <netdev.h>
  10. #include <nand.h>
  11. #include <asm/io.h>
  12. #include <linux/mtd/fsmc_nand.h>
  13. #include <asm/mach-types.h>
  14. #include <asm/arch/hardware.h>
  15. #include <asm/arch/spr_defs.h>
  16. #include <asm/arch/spr_misc.h>
  17. static struct nand_chip nand_chip[CONFIG_SYS_MAX_NAND_DEVICE];
  18. int board_init(void)
  19. {
  20. return spear_board_init(MACH_TYPE_SPEAR600);
  21. }
  22. /*
  23. * board_nand_init - Board specific NAND initialization
  24. * @nand: mtd private chip structure
  25. *
  26. * Called by nand_init_chip to initialize the board specific functions
  27. */
  28. void board_nand_init()
  29. {
  30. struct misc_regs *const misc_regs_p =
  31. (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
  32. struct nand_chip *nand = &nand_chip[0];
  33. #if defined(CONFIG_NAND_FSMC)
  34. if (!(readl(&misc_regs_p->auto_cfg_reg) & MISC_NANDDIS))
  35. fsmc_nand_init(nand);
  36. #endif
  37. return;
  38. }
  39. int board_eth_init(struct bd_info *bis)
  40. {
  41. int ret = 0;
  42. #if defined(CONFIG_ETH_DESIGNWARE)
  43. u32 interface = PHY_INTERFACE_MODE_MII;
  44. if (designware_initialize(CONFIG_SPEAR_ETHBASE, interface) >= 0)
  45. ret++;
  46. #endif
  47. return ret;
  48. }