Release 4.14 arch/m68k/sun3x/prom.c
// SPDX-License-Identifier: GPL-2.0
/* Prom access routines for the sun3x */
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/setup.h>
#include <asm/traps.h>
#include <asm/sun3xprom.h>
#include <asm/idprom.h>
#include <asm/segment.h>
#include <asm/sun3ints.h>
#include <asm/openprom.h>
#include <asm/machines.h>
void (*sun3x_putchar)(int);
int (*sun3x_getchar)(void);
int (*sun3x_mayget)(void);
int (*sun3x_mayput)(int);
void (*sun3x_prom_reboot)(void);
e_vector sun3x_prom_abort;
struct linux_romvec *romvec;
/* prom vector table */
e_vector *sun3x_prom_vbr;
/* Handle returning to the prom */
void sun3x_halt(void)
{
unsigned long flags;
/* Disable interrupts while we mess with things */
local_irq_save(flags);
/* Restore prom vbr */
asm volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
/* Restore prom NMI clock */
// sun3x_disable_intreg(5);
sun3_enable_irq(7);
/* Let 'er rip */
asm volatile ("trap #14");
/* Restore everything */
sun3_disable_irq(7);
sun3_enable_irq(5);
asm volatile ("movec %0,%%vbr" : : "r" ((void*)vectors));
local_irq_restore(flags);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 44 | 86.27% | 1 | 33.33% |
Roman Zippel | 5 | 9.80% | 1 | 33.33% |
Geert Uytterhoeven | 2 | 3.92% | 1 | 33.33% |
Total | 51 | 100.00% | 3 | 100.00% |
void sun3x_reboot(void)
{
/* This never returns, don't bother saving things */
local_irq_disable();
/* Restore prom vbr */
asm volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
/* Restore prom NMI clock */
sun3_disable_irq(5);
sun3_enable_irq(7);
/* Let 'er rip */
(*romvec->pv_reboot)("vmlinux");
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 35 | 94.59% | 1 | 33.33% |
Geert Uytterhoeven | 1 | 2.70% | 1 | 33.33% |
Roman Zippel | 1 | 2.70% | 1 | 33.33% |
Total | 37 | 100.00% | 3 | 100.00% |
static void sun3x_prom_write(struct console *co, const char *s,
unsigned int count)
{
while (count--) {
if (*s == '\n')
sun3x_putchar('\r');
sun3x_putchar(*s++);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 46 | 100.00% | 1 | 100.00% |
Total | 46 | 100.00% | 1 | 100.00% |
/* debug console - write-only */
static struct console sun3x_debug = {
.name = "debug",
.write = sun3x_prom_write,
.flags = CON_PRINTBUFFER,
.index = -1,
};
void __init sun3x_prom_init(void)
{
/* Read the vector table */
sun3x_putchar = *(void (**)(int)) (SUN3X_P_PUTCHAR);
sun3x_getchar = *(int (**)(void)) (SUN3X_P_GETCHAR);
sun3x_mayget = *(int (**)(void)) (SUN3X_P_MAYGET);
sun3x_mayput = *(int (**)(int)) (SUN3X_P_MAYPUT);
sun3x_prom_reboot = *(void (**)(void)) (SUN3X_P_REBOOT);
sun3x_prom_abort = *(e_vector *) (SUN3X_P_ABORT);
romvec = (struct linux_romvec *)SUN3X_PROM_BASE;
idprom_init();
if (!((idprom->id_machtype & SM_ARCH_MASK) == SM_SUN3X)) {
pr_warn("Machine reports strange type %02x\n",
idprom->id_machtype);
pr_warn("Pretending it's a 3/80, but very afraid...\n");
idprom->id_machtype = SM_SUN3X | SM_3_80;
}
/* point trap #14 at abort.
* XXX this is futile since we restore the vbr first - oops
*/
vectors[VEC_TRAP14] = sun3x_prom_abort;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 148 | 90.24% | 1 | 16.67% |
Geert Uytterhoeven | 13 | 7.93% | 2 | 33.33% |
Roman Zippel | 2 | 1.22% | 2 | 33.33% |
Al Viro | 1 | 0.61% | 1 | 16.67% |
Total | 164 | 100.00% | 6 | 100.00% |
static int __init sun3x_debug_setup(char *arg)
{
/* If debug=prom was specified, start the debug console */
if (MACH_IS_SUN3X && !strcmp(arg, "prom"))
register_console(&sun3x_debug);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 17 | 51.52% | 1 | 50.00% |
Roman Zippel | 16 | 48.48% | 1 | 50.00% |
Total | 33 | 100.00% | 2 | 100.00% |
early_param("debug", sun3x_debug_setup);
/* some prom functions to export */
int prom_getintdefault(int node, char *property, int deflt)
{
return deflt;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 18 | 100.00% | 1 | 100.00% |
Total | 18 | 100.00% | 1 | 100.00% |
int prom_getbool (int node, char *prop)
{
return 1;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
void prom_printf(char *fmt, ...)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 9 | 90.00% | 1 | 50.00% |
Roman Zippel | 1 | 10.00% | 1 | 50.00% |
Total | 10 | 100.00% | 2 | 100.00% |
void prom_halt (void)
{
sun3x_halt();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 10 | 100.00% | 1 | 100.00% |
Total | 10 | 100.00% | 1 | 100.00% |
/* Get the idprom and stuff it into buffer 'idbuf'. Returns the
* format type. 'num_bytes' is the number of bytes that your idbuf
* has space for. Returns 0xff on error.
*/
unsigned char
prom_get_idprom(char *idbuf, int num_bytes)
{
int i;
/* make a copy of the idprom structure */
for (i = 0; i < num_bytes; i++)
idbuf[i] = ((char *)SUN3X_IDPROM)[i];
return idbuf[0];
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Geert Uytterhoeven | 52 | 100.00% | 1 | 100.00% |
Total | 52 | 100.00% | 1 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds | 470 | 80.20% | 1 | 11.11% |
Geert Uytterhoeven | 69 | 11.77% | 3 | 33.33% |
Roman Zippel | 32 | 5.46% | 2 | 22.22% |
Al Viro | 14 | 2.39% | 2 | 22.22% |
Greg Kroah-Hartman | 1 | 0.17% | 1 | 11.11% |
Total | 586 | 100.00% | 9 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.