prom.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright 2002 Momentum Computer Inc.
  3. * Author: Matthew Dharm <mdharm@momenco.com>
  4. *
  5. * Based on Ocelot Linux port, which is
  6. * Copyright 2001 MontaVista Software Inc.
  7. * Author: jsun@mvista.com or jsun@junsun.net
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. */
  14. #include <linux/init.h>
  15. #include <linux/mm.h>
  16. #include <linux/sched.h>
  17. #include <linux/bootmem.h>
  18. #include <asm/addrspace.h>
  19. #include <asm/bootinfo.h>
  20. #include <asm/pmon.h>
  21. #include <asm/gt64240.h>
  22. #include "ocelot_pld.h"
  23. struct callvectors* debug_vectors;
  24. extern unsigned long marvell_base;
  25. extern unsigned long bus_clock;
  26. #ifdef CONFIG_GALILLEO_GT64240_ETH
  27. extern unsigned char prom_mac_addr_base[6];
  28. #endif
  29. const char *get_system_type(void)
  30. {
  31. return "Momentum Ocelot";
  32. }
  33. void __init prom_init(void)
  34. {
  35. int argc = fw_arg0;
  36. char **arg = (char **) fw_arg1;
  37. char **env = (char **) fw_arg2;
  38. struct callvectors *cv = (struct callvectors *) fw_arg3;
  39. int i;
  40. /* save the PROM vectors for debugging use */
  41. debug_vectors = cv;
  42. /* arg[0] is "g", the rest is boot parameters */
  43. arcs_cmdline[0] = '\0';
  44. for (i = 1; i < argc; i++) {
  45. if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
  46. >= sizeof(arcs_cmdline))
  47. break;
  48. strcat(arcs_cmdline, arg[i]);
  49. strcat(arcs_cmdline, " ");
  50. }
  51. mips_machgroup = MACH_GROUP_MOMENCO;
  52. mips_machtype = MACH_MOMENCO_OCELOT_G;
  53. #ifdef CONFIG_GALILLEO_GT64240_ETH
  54. /* get the base MAC address for on-board ethernet ports */
  55. memcpy(prom_mac_addr_base, (void*)0xfc807cf2, 6);
  56. #endif
  57. while (*env) {
  58. if (strncmp("gtbase", *env, strlen("gtbase")) == 0) {
  59. marvell_base = simple_strtol(*env + strlen("gtbase="),
  60. NULL, 16);
  61. }
  62. if (strncmp("busclock", *env, strlen("busclock")) == 0) {
  63. bus_clock = simple_strtol(*env + strlen("busclock="),
  64. NULL, 10);
  65. }
  66. env++;
  67. }
  68. }
  69. unsigned long __init prom_free_prom_memory(void)
  70. {
  71. return 0;
  72. }