Exemple #1
0
static void __init bcm47xx_register_ssb(void)
{
	int err;
	char buf[100];
	struct ssb_mipscore *mcore;

	err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom_ssb);
	if (err)
		printk(KERN_WARNING "bcm47xx: someone else already registered"
			" a ssb SPROM callback handler (err %d)\n", err);

	err = ssb_bus_ssbbus_register(&(bcm47xx_bus.ssb), SSB_ENUM_BASE,
				      bcm47xx_get_invariants);
	if (err)
		panic("Failed to initialize SSB bus (err %d)", err);

	mcore = &bcm47xx_bus.ssb.mipscore;
	if (bcm47xx_nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) {
		if (strstr(buf, "console=ttyS1")) {
			struct ssb_serial_port port;

			printk(KERN_DEBUG "Swapping serial ports!\n");
			/* swap serial ports */
			memcpy(&port, &mcore->serial_ports[0], sizeof(port));
			memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1],
			       sizeof(port));
			memcpy(&mcore->serial_ports[1], &port, sizeof(port));
		}
	}
}
Exemple #2
0
static void __init bcm47xx_register_ssb(void)
{
	int err;
	char buf[100];
	struct ssb_mipscore *mcore;

	err = ssb_bus_ssbbus_register(&bcm47xx_bus.ssb, SSB_ENUM_BASE,
				      bcm47xx_get_invariants);
	if (err)
		panic("Failed to initialize SSB bus (err %d)", err);

	mcore = &bcm47xx_bus.ssb.mipscore;
	if (bcm47xx_nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) {
		if (strstr(buf, "console=ttyS1")) {
			struct ssb_serial_port port;

			pr_debug("Swapping serial ports!\n");
			/* swap serial ports */
			memcpy(&port, &mcore->serial_ports[0], sizeof(port));
			memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1],
			       sizeof(port));
			memcpy(&mcore->serial_ports[1], &port, sizeof(port));
		}
	}
}
Exemple #3
0
void __init plat_mem_setup(void)
{
	int i, err;
	char *s;
	struct ssb_mipscore *mcore;

	err = ssb_bus_ssbbus_register(&ssb, SSB_ENUM_BASE, bcm47xx_fill_sprom);
	if (err) {
		const char *msg = "Failed to initialize SSB bus (err %d)\n";
		cfe_printk(msg, err); /* Make sure the message gets out of the box. */
		panic(msg, err);
	}
	mcore = &ssb.mipscore;

	/* FIXME: the nvram init depends on the ssb being fully initializes,
	 * can't use the fill_sprom callback yet! */
	bcm47xx_fill_sprom_nvram(&ssb.sprom);
	
	s = nvram_get("kernel_args");
	if (s && !strncmp(s, "console=ttyS1", 13)) {
		struct ssb_serial_port port;

		cfe_printk("Swapping serial ports!\n");
		/* swap serial ports */
		memcpy(&port, &mcore->serial_ports[0], sizeof(port));
		memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1], sizeof(port));
		memcpy(&mcore->serial_ports[1], &port, sizeof(port));
	}

	for (i = 0; i < mcore->nr_serial_ports; i++) {
		struct ssb_serial_port *port = &(mcore->serial_ports[i]);
		struct uart_port s;
	
		memset(&s, 0, sizeof(s));
		s.line = i;
		s.membase = port->regs;
		s.irq = port->irq + 2;//FIXME?
		s.uartclk = port->baud_base;
		s.flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
		s.iotype = SERIAL_IO_MEM;
		s.regshift = port->reg_shift;

		early_serial_setup(&s);
	}
	cfe_printk("Serial init done.\n");

	_machine_restart = bcm47xx_machine_restart;
	_machine_halt = bcm47xx_machine_halt;
	pm_power_off = bcm47xx_machine_halt;

	board_time_init = bcm47xx_time_init;//FIXME move into ssb
}
void __init plat_mem_setup(void)
{
	int err;

	err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE,
				      bcm47xx_get_invariants);
	if (err)
		panic("Failed to initialize SSB bus (err %d)\n", err);

	_machine_restart = bcm47xx_machine_restart;
	_machine_halt = bcm47xx_machine_halt;
	pm_power_off = bcm47xx_machine_halt;
}