char prime;
#endif
-#ifndef CONFIG_ARM64
cid = tegra_read_chipid();
nlist = tegra_read_apb_misc_reg(0x860);
-#elif defined(CONFIG_ARCH_TEGRA_13x_SOC) || defined(CONFIG_ARCH_TEGRA_21x_SOC)
- void __iomem *chip_id;
- void __iomem *netlist;
-
- /*
- * tegra_get_tegraid_from_hw can be called really early on when
- * final kernel page tables haven't been set up. Thus, APB_MISC
- * aperature must be mapped into kernel VA before tegra_id can
- * be accessed here. Coincidentally, Tegra UART and ChipId reside
- * in the same memory section (1MB), and UART has been mapped
- * prior to this.
- *
- * On ARM, this is okay b/c Tegra code tells ARM what VA to map.
- * However, ARM64 internally uses EARLYCON_IOBASE as base VA.
- * To workaround this, we have to derive the base VA manually
- * ad-hoc and modify the chip_id and netlist address accordingly
- * for ARM64. Such handling is only needed until Tegra static
- * mapping is done in mach-tegra/io.c.
- */
- void __iomem *early_base;
- extern bool iotable_init_done;
- if (!iotable_init_done) {
- early_base = early_ioremap(TEGRA_APB_MISC_BASE, TEGRA_APB_MISC_SIZE);
- BUG_ON(!early_base);
- /* Map in APB_BASE in case earlyprintk is not enabled */
- chip_id = early_base + 0x804;
- netlist = early_base + 0x860;
- cid = readl(chip_id);
- nlist = readl(netlist);
- early_iounmap(early_base, TEGRA_APB_MISC_SIZE);
- } else {
- cid = tegra_read_apb_misc_reg(0x804);
- nlist = tegra_read_apb_misc_reg(0x860);
- }
-#else
- void __iomem *apb_misc = ioremap(
- TEGRA_APB_MISC_BASE, TEGRA_APB_MISC_SIZE);
- BUG_ON(!apb_misc);
- cid = readl(apb_misc + 0x804);
- nlist = readl(apb_misc + 0x860);
- iounmap(apb_misc);
-#endif
#if defined(CONFIG_ARCH_TEGRA_21x_SOC)
tegra_fuse_cfg_reg_visible();
* Colin Cross <ccross@google.com>
* Erik Gilling <konkers@google.com>
*
- * Copyright (C) 2010-2014, NVIDIA Corporation. All rights reserved.
+ * Copyright (C) 2010-2015, NVIDIA Corporation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
#define MT_DEVICE MT_DEVICE_nGnRE
#endif
-bool iotable_init_done = false;
-
static struct map_desc tegra_io_desc[] __initdata = {
{
.virtual = (unsigned long)IO_PPSB_VIRT,
#endif
};
-static struct map_desc tegra_io_desc_linsim[] __initdata = {
- {
- .virtual = (unsigned long)IO_SMC_VIRT,
- .pfn = __phys_to_pfn(IO_SMC_PHYS),
- .length = IO_SMC_SIZE,
- .type = MT_DEVICE,
- },
- {
- .virtual = (unsigned long)IO_SIM_ESCAPE_VIRT,
- .pfn = __phys_to_pfn(IO_SIM_ESCAPE_PHYS),
- .length = IO_SIM_ESCAPE_SIZE,
- .type = MT_DEVICE,
- },
-};
-
void __init tegra_map_common_io(void)
{
debug_ll_io_init();
iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc));
-
- if (tegra_platform_is_linsim())
- iotable_init(tegra_io_desc_linsim,
- ARRAY_SIZE(tegra_io_desc_linsim));
-
- iotable_init_done = true;
}