// SPDX-License-Identifier: GPL-2.0-or-later /* * Powermac setup and early boot code plus other random bits. * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) * * Adapted for Power Macintosh by Paul Mackerras * Copyright (C) 1996 Paul Mackerras (paulus@samba.org) * * Derived from "arch/alpha/kernel/setup.c" * Copyright (C) 1995 Linus Torvalds * * Maintained by Benjamin Herrenschmidt (benh@kernel.crashing.org)
*/
if (!dn) return 0;
of_node_put(dn);
printk("WARNING ! Your machine is CUDA-based but your kernel\n");
printk(" wasn't compiled with CONFIG_ADB_CUDA option !\n"); return 0;
} #endif
if (!dn) return 0;
of_node_put(dn);
printk("WARNING ! Your machine is PMU-based but your kernel\n");
printk(" wasn't compiled with CONFIG_ADB_PMU option !\n"); return 0;
} #endif
#ifndef CONFIG_PMAC_SMU int __init smu_init(void)
{ /* should check and warn if SMU is present */ return 0;
} #endif
/* this area has the CPU identification register
and some registers used by smp boards */
sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000);
/* * Turn on the L2 cache. * We assume that we have a PSX memory controller iff * we have an ohare I/O controller.
*/
dn = of_find_node_by_name(NULL, "ohare"); if (dn) {
of_node_put(dn); if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) { if (sysctrl_regs[4] & 0x10)
sysctrl_regs[4] |= 0x04000020; else
sysctrl_regs[4] |= 0x04000000; if(has_l2cache)
printk(KERN_INFO "Level 2 cache enabled\n");
}
}
}
staticvoid __init l2cr_init(void)
{ /* Checks "l2cr-value" property in the registry */ if (cpu_has_feature(CPU_FTR_L2CR)) { struct device_node *np;
void note_bootable_part(dev_t dev, int part, int goodness); /* * This is __ref because we check for "initializing" before * touching any of the __init sensitive things and "initializing" * will be false after __init time. This can't be __init because it * can be called whenever a disk is first accessed.
*/ void __ref note_bootable_part(dev_t dev, int part, int goodness)
{ char *p;
if (!initializing) return; if ((goodness <= current_root_goodness) &&
ROOT_DEV != DEFAULT_ROOT_DEVICE) return;
p = strstr(boot_command_line, "root="); if (p != NULL && (p == boot_command_line || p[-1] == ' ')) return;
ROOT_DEV = dev + part;
current_root_goodness = goodness;
}
/* SMP Init has to be done early as we need to patch up * cpu_possible_mask before interrupt stacks are allocated * or kaboom...
*/ #ifdef CONFIG_SMP
pmac_setup_smp(); #endif
}
#ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE /* * This is called very early, as part of console_init() (typically just after * time_init()). This function is respondible for trying to find a good * default console on serial ports. It tries to match the open firmware * default output with one of the available serial console drivers.
*/ staticint __init check_pmac_serial_console(void)
{ struct device_node *prom_stdout = NULL; int offset = 0; constchar *name; #ifdef CONFIG_SERIAL_PMACZILOG_TTYS char *devname = "ttyS"; #else char *devname = "ttyPZ"; #endif
pr_debug(" -> check_pmac_serial_console()\n");
/* The user has requested a console so this is already set up. */ if (strstr(boot_command_line, "console=")) {
pr_debug(" console was specified !\n"); return -EBUSY;
}
if (!of_chosen) {
pr_debug(" of_chosen is NULL !\n"); return -ENODEV;
}
/* We are getting a weird phandle from OF ... */ /* ... So use the full path instead */
name = of_get_property(of_chosen, "linux,stdout-path", NULL); if (name == NULL) {
pr_debug(" no linux,stdout-path !\n"); return -ENODEV;
}
prom_stdout = of_find_node_by_path(name); if (!prom_stdout) {
pr_debug(" can't find stdout package %s !\n", name); return -ENODEV;
}
pr_debug("stdout is %pOF\n", prom_stdout);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.