evm.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Board specific initialization for J721E EVM
  4. *
  5. * Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/
  6. * Lokesh Vutla <lokeshvutla@ti.com>
  7. *
  8. */
  9. #include <common.h>
  10. #include <init.h>
  11. #include <asm/io.h>
  12. #include <spl.h>
  13. #include <asm/arch/sys_proto.h>
  14. DECLARE_GLOBAL_DATA_PTR;
  15. int board_init(void)
  16. {
  17. return 0;
  18. }
  19. int dram_init(void)
  20. {
  21. #ifdef CONFIG_PHYS_64BIT
  22. gd->ram_size = 0x100000000;
  23. #else
  24. gd->ram_size = 0x80000000;
  25. #endif
  26. return 0;
  27. }
  28. ulong board_get_usable_ram_top(ulong total_size)
  29. {
  30. #ifdef CONFIG_PHYS_64BIT
  31. /* Limit RAM used by U-Boot to the DDR low region */
  32. if (gd->ram_top > 0x100000000)
  33. return 0x100000000;
  34. #endif
  35. return gd->ram_top;
  36. }
  37. int dram_init_banksize(void)
  38. {
  39. /* Bank 0 declares the memory available in the DDR low region */
  40. gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
  41. gd->bd->bi_dram[0].size = 0x80000000;
  42. gd->ram_size = 0x80000000;
  43. #ifdef CONFIG_PHYS_64BIT
  44. /* Bank 1 declares the memory available in the DDR high region */
  45. gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE1;
  46. gd->bd->bi_dram[1].size = 0x80000000;
  47. gd->ram_size = 0x100000000;
  48. #endif
  49. return 0;
  50. }
  51. #ifdef CONFIG_SPL_LOAD_FIT
  52. int board_fit_config_name_match(const char *name)
  53. {
  54. if (!strcmp(name, "k3-j721e-common-proc-board"))
  55. return 0;
  56. return -1;
  57. }
  58. #endif
  59. #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
  60. int ft_board_setup(void *blob, bd_t *bd)
  61. {
  62. int ret;
  63. ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000", "sram@70000000");
  64. if (ret)
  65. printf("%s: fixing up msmc ram failed %d\n", __func__, ret);
  66. return ret;
  67. }
  68. #endif