bubblegum_96.c 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Bubblegum-96 Boards Support
  4. *
  5. * Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  6. */
  7. #include <linux/arm-smccc.h>
  8. #include <linux/psci.h>
  9. #include <common.h>
  10. #include <asm/io.h>
  11. #include <asm/mach-types.h>
  12. #include <asm/psci.h>
  13. DECLARE_GLOBAL_DATA_PTR;
  14. /*
  15. * dram_init - sets uboots idea of sdram size
  16. */
  17. int dram_init(void)
  18. {
  19. gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
  20. return 0;
  21. }
  22. /* This is called after dram_init() so use get_ram_size result */
  23. int dram_init_banksize(void)
  24. {
  25. gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
  26. gd->bd->bi_dram[0].size = gd->ram_size;
  27. return 0;
  28. }
  29. static void show_psci_version(void)
  30. {
  31. struct arm_smccc_res res;
  32. arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
  33. printf("PSCI: v%ld.%ld\n",
  34. PSCI_VERSION_MAJOR(res.a0),
  35. PSCI_VERSION_MINOR(res.a0));
  36. }
  37. int board_init(void)
  38. {
  39. show_psci_version();
  40. return 0;
  41. }
  42. void reset_cpu(ulong addr)
  43. {
  44. psci_system_reset();
  45. }