ls1012afrdm.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright 2016 Freescale Semiconductor, Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <i2c.h>
  8. #include <asm/io.h>
  9. #include <asm/arch/clock.h>
  10. #include <asm/arch/fsl_serdes.h>
  11. #include <asm/arch/soc.h>
  12. #include <hwconfig.h>
  13. #include <environment.h>
  14. #include <fsl_mmdc.h>
  15. #include <netdev.h>
  16. DECLARE_GLOBAL_DATA_PTR;
  17. int checkboard(void)
  18. {
  19. puts("Board: LS1012AFRDM ");
  20. return 0;
  21. }
  22. int dram_init(void)
  23. {
  24. static const struct fsl_mmdc_info mparam = {
  25. 0x04180000, /* mdctl */
  26. 0x00030035, /* mdpdc */
  27. 0x12554000, /* mdotc */
  28. 0xbabf7954, /* mdcfg0 */
  29. 0xdb328f64, /* mdcfg1 */
  30. 0x01ff00db, /* mdcfg2 */
  31. 0x00001680, /* mdmisc */
  32. 0x0f3c8000, /* mdref */
  33. 0x00002000, /* mdrwd */
  34. 0x00bf1023, /* mdor */
  35. 0x0000003f, /* mdasp */
  36. 0x0000022a, /* mpodtctrl */
  37. 0xa1390003, /* mpzqhwctrl */
  38. };
  39. mmdc_init(&mparam);
  40. gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
  41. return 0;
  42. }
  43. int board_eth_init(bd_t *bis)
  44. {
  45. return pci_eth_init(bis);
  46. }
  47. int board_early_init_f(void)
  48. {
  49. fsl_lsch2_early_init_f();
  50. return 0;
  51. }
  52. int board_init(void)
  53. {
  54. struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
  55. /*
  56. * Set CCI-400 control override register to enable barrier
  57. * transaction
  58. */
  59. out_le32(&cci->ctrl_ord, CCI400_CTRLORD_EN_BARRIER);
  60. #ifdef CONFIG_ENV_IS_NOWHERE
  61. gd->env_addr = (ulong)&default_environment[0];
  62. #endif
  63. return 0;
  64. }
  65. int ft_board_setup(void *blob, bd_t *bd)
  66. {
  67. arch_fixup_fdt(blob);
  68. ft_cpu_setup(blob, bd);
  69. return 0;
  70. }