prom.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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/config.h>
  15. #include <linux/init.h>
  16. #include <linux/mm.h>
  17. #include <linux/sched.h>
  18. #include <linux/bootmem.h>
  19. #include <asm/addrspace.h>
  20. #include <asm/bootinfo.h>
  21. #include <asm/pmon.h>
  22. #include <asm/gt64240.h>
  23. #include "ocelot_pld.h"
  24. struct callvectors* debug_vectors;
  25. extern unsigned long marvell_base;
  26. extern unsigned long bus_clock;
  27. #ifdef CONFIG_GALILLEO_GT64240_ETH
  28. extern unsigned char prom_mac_addr_base[6];
  29. #endif
  30. const char *get_system_type(void)
  31. {
  32. return "Momentum Ocelot";
  33. }
  34. void __init prom_init(void)
  35. {
  36. int argc = fw_arg0;
  37. char **arg = (char **) fw_arg1;
  38. char **env = (char **) fw_arg2;
  39. struct callvectors *cv = (struct callvectors *) fw_arg3;
  40. int i;
  41. /* save the PROM vectors for debugging use */
  42. debug_vectors = cv;
  43. /* arg[0] is "g", the rest is boot parameters */
  44. arcs_cmdline[0] = '\0';
  45. for (i = 1; i < argc; i++) {
  46. if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
  47. >= sizeof(arcs_cmdline))
  48. break;
  49. strcat(arcs_cmdline, arg[i]);
  50. strcat(arcs_cmdline, " ");
  51. }
  52. mips_machgroup = MACH_GROUP_MOMENCO;
  53. mips_machtype = MACH_MOMENCO_OCELOT_G;
  54. #ifdef CONFIG_GALILLEO_GT64240_ETH
  55. /* get the base MAC address for on-board ethernet ports */
  56. memcpy(prom_mac_addr_base, (void*)0xfc807cf2, 6);
  57. #endif
  58. while (*env) {
  59. if (strncmp("gtbase", *env, strlen("gtbase")) == 0) {
  60. marvell_base = simple_strtol(*env + strlen("gtbase="),
  61. NULL, 16);
  62. }
  63. if (strncmp("busclock", *env, strlen("busclock")) == 0) {
  64. bus_clock = simple_strtol(*env + strlen("busclock="),
  65. NULL, 10);
  66. }
  67. env++;
  68. }
  69. }
  70. unsigned long __init prom_free_prom_memory(void)
  71. {
  72. return 0;
  73. }