setup.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * Carsten Langgaard, carstenl@mips.com
  3. * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved.
  4. *
  5. * Thomas Horsten <thh@lasat.com>
  6. * Copyright (C) 2000 LASAT Networks A/S.
  7. *
  8. * Brian Murphy <brian@murphy.dk>
  9. *
  10. * This program is free software; you can distribute it and/or modify it
  11. * under the terms of the GNU General Public License (Version 2) as
  12. * published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope it will be useful, but WITHOUT
  15. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  17. * for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along
  20. * with this program; if not, write to the Free Software Foundation, Inc.,
  21. * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  22. *
  23. * Lasat specific setup.
  24. */
  25. #include <linux/init.h>
  26. #include <linux/sched.h>
  27. #include <linux/pci.h>
  28. #include <linux/interrupt.h>
  29. #include <linux/tty.h>
  30. #include <asm/time.h>
  31. #include <asm/cpu.h>
  32. #include <asm/bootinfo.h>
  33. #include <asm/irq.h>
  34. #include <asm/lasat/lasat.h>
  35. #include <asm/lasat/serial.h>
  36. #ifdef CONFIG_PICVUE
  37. #include <linux/notifier.h>
  38. #endif
  39. #include "ds1603.h"
  40. #include <asm/lasat/ds1603.h>
  41. #include <asm/lasat/picvue.h>
  42. #include <asm/lasat/eeprom.h>
  43. #include "prom.h"
  44. int lasat_command_line;
  45. void lasatint_init(void);
  46. extern void lasat_reboot_setup(void);
  47. extern void pcisetup(void);
  48. extern void edhac_init(void *, void *, void *);
  49. extern void addrflt_init(void);
  50. struct lasat_misc lasat_misc_info[N_MACHTYPES] = {
  51. {
  52. .reset_reg = (void *)KSEG1ADDR(0x1c840000),
  53. .flash_wp_reg = (void *)KSEG1ADDR(0x1c800000), 2
  54. }, {
  55. .reset_reg = (void *)KSEG1ADDR(0x11080000),
  56. .flash_wp_reg = (void *)KSEG1ADDR(0x11000000), 6
  57. }
  58. };
  59. struct lasat_misc *lasat_misc;
  60. #ifdef CONFIG_DS1603
  61. static struct ds_defs ds_defs[N_MACHTYPES] = {
  62. { (void *)DS1603_REG_100, (void *)DS1603_REG_100,
  63. DS1603_RST_100, DS1603_CLK_100, DS1603_DATA_100,
  64. DS1603_DATA_SHIFT_100, 0, 0 },
  65. { (void *)DS1603_REG_200, (void *)DS1603_DATA_REG_200,
  66. DS1603_RST_200, DS1603_CLK_200, DS1603_DATA_200,
  67. DS1603_DATA_READ_SHIFT_200, 1, 2000 }
  68. };
  69. #endif
  70. #ifdef CONFIG_PICVUE
  71. #include "picvue.h"
  72. static struct pvc_defs pvc_defs[N_MACHTYPES] = {
  73. { (void *)PVC_REG_100, PVC_DATA_SHIFT_100, PVC_DATA_M_100,
  74. PVC_E_100, PVC_RW_100, PVC_RS_100 },
  75. { (void *)PVC_REG_200, PVC_DATA_SHIFT_200, PVC_DATA_M_200,
  76. PVC_E_200, PVC_RW_200, PVC_RS_200 }
  77. };
  78. #endif
  79. static int lasat_panic_display(struct notifier_block *this,
  80. unsigned long event, void *ptr)
  81. {
  82. #ifdef CONFIG_PICVUE
  83. unsigned char *string = ptr;
  84. if (string == NULL)
  85. string = "Kernel Panic";
  86. pvc_dump_string(string);
  87. #endif
  88. return NOTIFY_DONE;
  89. }
  90. static int lasat_panic_prom_monitor(struct notifier_block *this,
  91. unsigned long event, void *ptr)
  92. {
  93. prom_monitor();
  94. return NOTIFY_DONE;
  95. }
  96. static struct notifier_block lasat_panic_block[] =
  97. {
  98. {
  99. .notifier_call = lasat_panic_display,
  100. .priority = INT_MAX
  101. }, {
  102. .notifier_call = lasat_panic_prom_monitor,
  103. .priority = INT_MIN
  104. }
  105. };
  106. void __init plat_time_init(void)
  107. {
  108. mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2;
  109. change_c0_status(ST0_IM, IE_IRQ0);
  110. }
  111. void __init plat_mem_setup(void)
  112. {
  113. int i;
  114. int lasat_type = IS_LASAT_200() ? 1 : 0;
  115. lasat_misc = &lasat_misc_info[lasat_type];
  116. #ifdef CONFIG_PICVUE
  117. picvue = &pvc_defs[lasat_type];
  118. #endif
  119. /* Set up panic notifier */
  120. for (i = 0; i < ARRAY_SIZE(lasat_panic_block); i++)
  121. atomic_notifier_chain_register(&panic_notifier_list,
  122. &lasat_panic_block[i]);
  123. lasat_reboot_setup();
  124. #ifdef CONFIG_DS1603
  125. ds1603 = &ds_defs[lasat_type];
  126. #endif
  127. #ifdef DYNAMIC_SERIAL_INIT
  128. serial_init();
  129. #endif
  130. pr_info("Lasat specific initialization complete\n");
  131. }