1 // SPDX-License-Identifier: GPL-2.0-only
3 * Carsten Langgaard, carstenl@mips.com
4 * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved.
6 * Thomas Horsten <thh@lasat.com>
7 * Copyright (C) 2000 LASAT Networks A/S.
9 * Brian Murphy <brian@murphy.dk>
11 * Lasat specific setup.
13 #include <linux/init.h>
14 #include <linux/sched.h>
15 #include <linux/pci.h>
16 #include <linux/interrupt.h>
17 #include <linux/tty.h>
21 #include <asm/bootinfo.h>
23 #include <asm/lasat/lasat.h>
24 #include <asm/lasat/serial.h>
27 #include <linux/notifier.h>
31 #include <asm/lasat/ds1603.h>
32 #include <asm/lasat/picvue.h>
33 #include <asm/lasat/eeprom.h>
37 int lasat_command_line
;
38 void lasatint_init(void);
40 extern void lasat_reboot_setup(void);
41 extern void pcisetup(void);
42 extern void edhac_init(void *, void *, void *);
43 extern void addrflt_init(void);
45 struct lasat_misc lasat_misc_info
[N_MACHTYPES
] = {
47 .reset_reg
= (void *)KSEG1ADDR(0x1c840000),
48 .flash_wp_reg
= (void *)KSEG1ADDR(0x1c800000), 2
50 .reset_reg
= (void *)KSEG1ADDR(0x11080000),
51 .flash_wp_reg
= (void *)KSEG1ADDR(0x11000000), 6
55 struct lasat_misc
*lasat_misc
;
58 static struct ds_defs ds_defs
[N_MACHTYPES
] = {
59 { (void *)DS1603_REG_100
, (void *)DS1603_REG_100
,
60 DS1603_RST_100
, DS1603_CLK_100
, DS1603_DATA_100
,
61 DS1603_DATA_SHIFT_100
, 0, 0 },
62 { (void *)DS1603_REG_200
, (void *)DS1603_DATA_REG_200
,
63 DS1603_RST_200
, DS1603_CLK_200
, DS1603_DATA_200
,
64 DS1603_DATA_READ_SHIFT_200
, 1, 2000 }
70 static struct pvc_defs pvc_defs
[N_MACHTYPES
] = {
71 { (void *)PVC_REG_100
, PVC_DATA_SHIFT_100
, PVC_DATA_M_100
,
72 PVC_E_100
, PVC_RW_100
, PVC_RS_100
},
73 { (void *)PVC_REG_200
, PVC_DATA_SHIFT_200
, PVC_DATA_M_200
,
74 PVC_E_200
, PVC_RW_200
, PVC_RS_200
}
78 static int lasat_panic_display(struct notifier_block
*this,
79 unsigned long event
, void *ptr
)
82 unsigned char *string
= ptr
;
84 string
= "Kernel Panic";
85 pvc_dump_string(string
);
90 static int lasat_panic_prom_monitor(struct notifier_block
*this,
91 unsigned long event
, void *ptr
)
97 static struct notifier_block lasat_panic_block
[] =
100 .notifier_call
= lasat_panic_display
,
103 .notifier_call
= lasat_panic_prom_monitor
,
108 void __init
plat_time_init(void)
110 mips_hpt_frequency
= lasat_board_info
.li_cpu_hz
/ 2;
112 change_c0_status(ST0_IM
, IE_IRQ0
);
115 void __init
plat_mem_setup(void)
118 int lasat_type
= IS_LASAT_200() ? 1 : 0;
120 lasat_misc
= &lasat_misc_info
[lasat_type
];
122 picvue
= &pvc_defs
[lasat_type
];
125 /* Set up panic notifier */
126 for (i
= 0; i
< ARRAY_SIZE(lasat_panic_block
); i
++)
127 atomic_notifier_chain_register(&panic_notifier_list
,
128 &lasat_panic_block
[i
]);
130 lasat_reboot_setup();
133 ds1603
= &ds_defs
[lasat_type
];
136 #ifdef DYNAMIC_SERIAL_INIT
140 pr_info("Lasat specific initialization complete\n");