const char *get_system_type(void) { u16 chip_id = ar7_chip_id(); u16 titan_variant_id = titan_chip_id(); switch (chip_id) { case AR7_CHIP_7100: return "TI AR7 (TNETD7100)"; case AR7_CHIP_7200: return "TI AR7 (TNETD7200)"; case AR7_CHIP_7300: return "TI AR7 (TNETD7300)"; case AR7_CHIP_TITAN: switch (titan_variant_id) { case TITAN_CHIP_1050: return "TI AR7 (TNETV1050)"; case TITAN_CHIP_1055: return "TI AR7 (TNETV1055)"; case TITAN_CHIP_1056: return "TI AR7 (TNETV1056)"; case TITAN_CHIP_1060: return "TI AR7 (TNETV1060)"; } default: return "TI AR7 (unknown)"; } }
void __init plat_mem_setup(void) { unsigned long io_base; _machine_restart = ar7_machine_restart; _machine_halt = ar7_machine_halt; pm_power_off = ar7_machine_power_off; panic_timeout = 3; io_base = (unsigned long)ioremap(AR7_REGS_BASE, 0x10000); if (!io_base) panic("Can't remap IO base!\n"); set_io_port_base(io_base); prom_meminit(); ar7_init_clocks(); ioport_resource.start = 0; ioport_resource.end = ~0; iomem_resource.start = 0; iomem_resource.end = ~0; printk(KERN_INFO "%s, ID: 0x%04x, Revision: 0x%02x\n", get_system_type(), ar7_chip_id(), ar7_chip_rev()); }
static void ar7_wdt_get_regs(void) { u16 chip_id = ar7_chip_id(); switch (chip_id) { case AR7_CHIP_7100: case AR7_CHIP_7200: ar7_regs_wdt = AR7_REGS_WDT; break; default: ar7_regs_wdt = UR8_REGS_WDT; break; } }
const char *get_system_type(void) { u16 chip_id = ar7_chip_id(); switch (chip_id) { case AR7_CHIP_7300: return "TI AR7 (TNETD7300)"; case AR7_CHIP_7100: return "TI AR7 (TNETD7100)"; case AR7_CHIP_7200: return "TI AR7 (TNETD7200)"; default: return "TI AR7 (Unknown)"; } }
static int __init ar7_register_devices(void) { void __iomem *bootcr; u32 val; u16 chip_id; int res; res = ar7_register_uarts(); if (res) pr_err("unable to setup uart(s): %d\n", res); res = platform_device_register(&physmap_flash); if (res) pr_warning("unable to register physmap-flash: %d\n", res); ar7_device_disable(vlynq_low_data.reset_bit); res = platform_device_register(&vlynq_low); if (res) pr_warning("unable to register vlynq-low: %d\n", res); if (ar7_has_high_vlynq()) { ar7_device_disable(vlynq_high_data.reset_bit); res = platform_device_register(&vlynq_high); if (res) pr_warning("unable to register vlynq-high: %d\n", res); } if (ar7_has_high_cpmac()) { res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status); if (!res) { cpmac_get_mac(1, cpmac_high_data.dev_addr); res = platform_device_register(&cpmac_high); if (res) pr_warning("unable to register cpmac-high: %d\n", res); } else pr_warning("unable to add cpmac-high phy: %d\n", res); } else cpmac_low_data.phy_mask = 0xffffffff; res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status); if (!res) { cpmac_get_mac(0, cpmac_low_data.dev_addr); res = platform_device_register(&cpmac_low); if (res) pr_warning("unable to register cpmac-low: %d\n", res); } else pr_warning("unable to add cpmac-low phy: %d\n", res); detect_leds(); res = platform_device_register(&ar7_gpio_leds); if (res) pr_warning("unable to register leds: %d\n", res); res = platform_device_register(&ar7_udc); if (res) pr_warning("unable to register usb slave: %d\n", res); /* Register watchdog only if enabled in hardware */ bootcr = ioremap_nocache(AR7_REGS_DCL, 4); val = readl(bootcr); iounmap(bootcr); if (val & AR7_WDT_HW_ENA) { chip_id = ar7_chip_id(); switch (chip_id) { case AR7_CHIP_7100: case AR7_CHIP_7200: ar7_wdt_res.start = AR7_REGS_WDT; break; case AR7_CHIP_7300: ar7_wdt_res.start = UR8_REGS_WDT; break; default: break; } ar7_wdt_res.end = ar7_wdt_res.start + 0x20; res = platform_device_register(&ar7_wdt); if (res) pr_warning("unable to register watchdog: %d\n", res); } return 0; }