rpi_b.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * (C) Copyright 2012 Stephen Warren
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #include <common.h>
  17. #include <asm/arch/mbox.h>
  18. #include <asm/global_data.h>
  19. DECLARE_GLOBAL_DATA_PTR;
  20. struct msg_get_arm_mem {
  21. struct bcm2835_mbox_hdr hdr;
  22. struct bcm2835_mbox_tag_get_arm_mem get_arm_mem;
  23. u32 end_tag;
  24. };
  25. int dram_init(void)
  26. {
  27. ALLOC_ALIGN_BUFFER(struct msg_get_arm_mem, msg, 1, 16);
  28. int ret;
  29. BCM2835_MBOX_INIT_HDR(msg);
  30. BCM2835_MBOX_INIT_TAG(&msg->get_arm_mem, GET_ARM_MEMORY);
  31. ret = bcm2835_mbox_call_prop(BCM2835_MBOX_PROP_CHAN, &msg->hdr);
  32. if (ret) {
  33. printf("bcm2835: Could not query ARM memory size\n");
  34. return -1;
  35. }
  36. gd->ram_size = msg->get_arm_mem.body.resp.mem_size;
  37. return 0;
  38. }
  39. int board_init(void)
  40. {
  41. gd->bd->bi_boot_params = 0x100;
  42. return 0;
  43. }