2019-05-29 17:17:56 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2010-01-22 03:53:02 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 Google, Inc.
|
|
|
|
*
|
|
|
|
* Author:
|
|
|
|
* Colin Cross <ccross@google.com>
|
|
|
|
* Erik Gilling <konkers@google.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MACH_TEGRA_IOMAP_H
|
|
|
|
#define __MACH_TEGRA_IOMAP_H
|
|
|
|
|
2020-06-09 07:32:38 +03:00
|
|
|
#include <linux/pgtable.h>
|
2019-05-15 01:46:51 +03:00
|
|
|
#include <linux/sizes.h>
|
2010-01-22 03:53:02 +03:00
|
|
|
|
2010-07-28 08:34:38 +04:00
|
|
|
#define TEGRA_IRAM_BASE 0x40000000
|
|
|
|
#define TEGRA_IRAM_SIZE SZ_256K
|
|
|
|
|
2010-01-22 03:53:02 +03:00
|
|
|
#define TEGRA_ARM_PERIF_BASE 0x50040000
|
|
|
|
#define TEGRA_ARM_PERIF_SIZE SZ_8K
|
|
|
|
|
|
|
|
#define TEGRA_ARM_INT_DIST_BASE 0x50041000
|
|
|
|
#define TEGRA_ARM_INT_DIST_SIZE SZ_4K
|
|
|
|
|
|
|
|
#define TEGRA_TMR1_BASE 0x60005000
|
|
|
|
#define TEGRA_TMR1_SIZE SZ_8
|
|
|
|
|
|
|
|
#define TEGRA_TMR2_BASE 0x60005008
|
|
|
|
#define TEGRA_TMR2_SIZE SZ_8
|
|
|
|
|
|
|
|
#define TEGRA_TMRUS_BASE 0x60005010
|
|
|
|
#define TEGRA_TMRUS_SIZE SZ_64
|
|
|
|
|
|
|
|
#define TEGRA_TMR3_BASE 0x60005050
|
|
|
|
#define TEGRA_TMR3_SIZE SZ_8
|
|
|
|
|
|
|
|
#define TEGRA_TMR4_BASE 0x60005058
|
|
|
|
#define TEGRA_TMR4_SIZE SZ_8
|
|
|
|
|
|
|
|
#define TEGRA_CLK_RESET_BASE 0x60006000
|
|
|
|
#define TEGRA_CLK_RESET_SIZE SZ_4K
|
|
|
|
|
|
|
|
#define TEGRA_FLOW_CTRL_BASE 0x60007000
|
|
|
|
#define TEGRA_FLOW_CTRL_SIZE 20
|
|
|
|
|
2012-02-10 03:47:45 +04:00
|
|
|
#define TEGRA_SB_BASE 0x6000C200
|
|
|
|
#define TEGRA_SB_SIZE 256
|
|
|
|
|
2010-01-22 03:53:02 +03:00
|
|
|
#define TEGRA_EXCEPTION_VECTORS_BASE 0x6000F000
|
|
|
|
#define TEGRA_EXCEPTION_VECTORS_SIZE SZ_4K
|
|
|
|
|
|
|
|
#define TEGRA_APB_MISC_BASE 0x70000000
|
|
|
|
#define TEGRA_APB_MISC_SIZE SZ_4K
|
|
|
|
|
|
|
|
#define TEGRA_UARTA_BASE 0x70006000
|
|
|
|
#define TEGRA_UARTA_SIZE SZ_64
|
|
|
|
|
|
|
|
#define TEGRA_UARTB_BASE 0x70006040
|
|
|
|
#define TEGRA_UARTB_SIZE SZ_64
|
|
|
|
|
|
|
|
#define TEGRA_UARTC_BASE 0x70006200
|
|
|
|
#define TEGRA_UARTC_SIZE SZ_256
|
|
|
|
|
|
|
|
#define TEGRA_UARTD_BASE 0x70006300
|
|
|
|
#define TEGRA_UARTD_SIZE SZ_256
|
|
|
|
|
|
|
|
#define TEGRA_UARTE_BASE 0x70006400
|
|
|
|
#define TEGRA_UARTE_SIZE SZ_256
|
|
|
|
|
|
|
|
#define TEGRA_PMC_BASE 0x7000E400
|
|
|
|
#define TEGRA_PMC_SIZE SZ_256
|
|
|
|
|
|
|
|
#define TEGRA_EMC_BASE 0x7000F400
|
|
|
|
#define TEGRA_EMC_SIZE SZ_1K
|
|
|
|
|
ARM: tegra: add LP1 suspend support for Tegra114
The LP1 suspend mode will power off the CPU, clock gated the PLLs and put
SDRAM to self-refresh mode. Any interrupt can wake up device from LP1. The
sequence when LP1 suspending:
* tunning off L1 data cache and the MMU
* storing some EMC registers, DPD (deep power down) status, clk source of
mselect and SCLK burst policy
* putting SDRAM into self-refresh
* switching CPU to CLK_M (12MHz OSC)
* tunning off PLLM, PLLP, PLLA, PLLC and PLLX
* switching SCLK to CLK_S (32KHz OSC)
* shutting off the CPU rail
The sequence of LP1 resuming:
* re-enabling PLLM, PLLP, PLLA, PLLC and PLLX
* restoring the clk source of mselect and SCLK burst policy
* setting up CCLK burst policy to PLLX
* restoring DPD status and some EMC registers
* resuming SDRAM to normal mode
* jumping to the "tegra_resume" from PMC_SCRATCH41
Due to the SDRAM will be put into self-refresh mode, the low level
procedures of LP1 suspending and resuming should be copied to
TEGRA_IRAM_CODE_AREA (TEGRA_IRAM_BASE + SZ_4K) when suspending. Before
restoring the CPU context when resuming, the SDRAM needs to be switched
back to normal mode. And the PLLs need to be re-enabled, SCLK burst policy
be restored. Then jumping to "tegra_resume" that was expected to be stored
in PMC_SCRATCH41 to restore CPU context and back to kernel.
Based on the work by: Bo Yan <byan@nvidia.com>
Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2013-08-12 13:40:06 +04:00
|
|
|
#define TEGRA_EMC0_BASE 0x7001A000
|
|
|
|
#define TEGRA_EMC0_SIZE SZ_2K
|
|
|
|
|
|
|
|
#define TEGRA_EMC1_BASE 0x7001A800
|
|
|
|
#define TEGRA_EMC1_SIZE SZ_2K
|
|
|
|
|
2013-10-11 13:58:38 +04:00
|
|
|
#define TEGRA124_EMC_BASE 0x7001B000
|
|
|
|
#define TEGRA124_EMC_SIZE SZ_2K
|
|
|
|
|
2010-01-22 03:53:02 +03:00
|
|
|
#define TEGRA_CSITE_BASE 0x70040000
|
|
|
|
#define TEGRA_CSITE_SIZE SZ_256K
|
|
|
|
|
2012-02-11 07:22:00 +04:00
|
|
|
/* On TEGRA, many peripherals are very closely packed in
|
|
|
|
* two 256MB io windows (that actually only use about 64KB
|
|
|
|
* at the start of each).
|
|
|
|
*
|
2013-10-29 23:47:21 +04:00
|
|
|
* We will just map the first MMU section of each window (to minimize
|
2012-02-11 07:22:00 +04:00
|
|
|
* pt entries needed) and provide a macro to transform physical
|
|
|
|
* io addresses to an appropriate void __iomem *.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define IO_IRAM_PHYS 0x40000000
|
|
|
|
#define IO_IRAM_VIRT IOMEM(0xFE400000)
|
|
|
|
#define IO_IRAM_SIZE SZ_256K
|
|
|
|
|
2013-10-29 23:47:21 +04:00
|
|
|
#define IO_CPU_PHYS 0x50040000
|
|
|
|
#define IO_CPU_VIRT IOMEM(0xFE440000)
|
2012-02-11 07:22:00 +04:00
|
|
|
#define IO_CPU_SIZE SZ_16K
|
|
|
|
|
|
|
|
#define IO_PPSB_PHYS 0x60000000
|
|
|
|
#define IO_PPSB_VIRT IOMEM(0xFE200000)
|
2013-10-29 23:47:21 +04:00
|
|
|
#define IO_PPSB_SIZE SECTION_SIZE
|
2012-02-11 07:22:00 +04:00
|
|
|
|
|
|
|
#define IO_APB_PHYS 0x70000000
|
2013-10-29 23:47:21 +04:00
|
|
|
#define IO_APB_VIRT IOMEM(0xFE000000)
|
|
|
|
#define IO_APB_SIZE SECTION_SIZE
|
2012-02-11 07:22:00 +04:00
|
|
|
|
|
|
|
#define IO_TO_VIRT_BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz)))
|
|
|
|
#define IO_TO_VIRT_XLATE(p, pst, vst) (((p) - (pst) + (vst)))
|
|
|
|
|
|
|
|
#define IO_TO_VIRT(n) ( \
|
|
|
|
IO_TO_VIRT_BETWEEN((n), IO_PPSB_PHYS, IO_PPSB_SIZE) ? \
|
|
|
|
IO_TO_VIRT_XLATE((n), IO_PPSB_PHYS, IO_PPSB_VIRT) : \
|
|
|
|
IO_TO_VIRT_BETWEEN((n), IO_APB_PHYS, IO_APB_SIZE) ? \
|
|
|
|
IO_TO_VIRT_XLATE((n), IO_APB_PHYS, IO_APB_VIRT) : \
|
|
|
|
IO_TO_VIRT_BETWEEN((n), IO_CPU_PHYS, IO_CPU_SIZE) ? \
|
|
|
|
IO_TO_VIRT_XLATE((n), IO_CPU_PHYS, IO_CPU_VIRT) : \
|
|
|
|
IO_TO_VIRT_BETWEEN((n), IO_IRAM_PHYS, IO_IRAM_SIZE) ? \
|
|
|
|
IO_TO_VIRT_XLATE((n), IO_IRAM_PHYS, IO_IRAM_VIRT) : \
|
|
|
|
NULL)
|
|
|
|
|
|
|
|
#define IO_ADDRESS(n) (IO_TO_VIRT(n))
|
|
|
|
|
2010-01-22 03:53:02 +03:00
|
|
|
#endif
|