-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add i.MX PSCI CPU off and update i.MX6UL #1577
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ada0045
core: arm: psci: add helper functions
MrVan fa57cee
core: arm: mx6ulevk: refine the tee address map
MrVan 62e2da3
core: arm: imx: use one imx-regs.h file
MrVan 8791bd2
core: arm: imx support psci off and affinity
MrVan 9b143a2
core: imx6ul: switch to use CFG_SECURE_TIME_SOURCE_REE
MrVan b45e18b
core: arm: imx6ul: add platform early init code
MrVan 1b9f60e
core: arm: imx: add 6ULL EVK support
MrVan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (C) 2016 Freescale Semiconductor, Inc. | ||
* Copyright 2017 NXP | ||
* All rights reserved. | ||
* | ||
* Peng Fan <peng.fan@nxp.com> | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#include <console.h> | ||
#include <io.h> | ||
#include <imx.h> | ||
#include <mm/core_mmu.h> | ||
#include <mm/core_memprot.h> | ||
#include <platform_config.h> | ||
|
||
uint32_t imx_get_src_gpr(int cpu) | ||
{ | ||
vaddr_t va = core_mmu_get_va(SRC_BASE, MEM_AREA_IO_SEC); | ||
|
||
return read32(va + SRC_GPR1 + cpu * 8 + 4); | ||
} | ||
|
||
void imx_set_src_gpr(int cpu, uint32_t val) | ||
{ | ||
vaddr_t va = core_mmu_get_va(SRC_BASE, MEM_AREA_IO_SEC); | ||
|
||
write32(val, va + SRC_GPR1 + cpu * 8 + 4); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
/* | ||
* Copyright (C) 2015 Freescale Semiconductor, Inc. | ||
* All rights reserved. | ||
* Copyright (c) 2016, Wind River Systems. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
#ifndef PLAT_IMX_IMX_REGS_H | ||
#define PLAT_IMX_IMX_REGS_H | ||
|
||
#ifdef CFG_MX6 | ||
#define UART1_BASE 0x2020000 | ||
#define IOMUXC_BASE 0x020E0000 | ||
#define IOMUXC_SIZE 0x4000 | ||
#define IOMUXC_GPR_BASE 0x020E4000 | ||
#define SRC_BASE 0x020D8000 | ||
#define SRC_SIZE 0x4000 | ||
#define CCM_BASE 0x020C4000 | ||
#define CCM_SIZE 0x4000 | ||
#define ANATOP_BASE 0x020C8000 | ||
#define ANATOP_SIZE 0x1000 | ||
#define SNVS_BASE 0x020CC000 | ||
#define GPC_BASE 0x020DC000 | ||
#define GPC_SIZE 0x4000 | ||
#define WDOG_BASE 0x020BC000 | ||
#define SEMA4_BASE 0x02290000 | ||
#define SEMA4_SIZE 0x4000 | ||
#define MMDC_P0_BASE 0x021B0000 | ||
#define MMDC_P0_SIZE 0x4000 | ||
#define MMDC_P1_BASE 0x021B4000 | ||
#define MMDC_P1_SIZE 0x4000 | ||
#define TZASC_BASE 0x21D0000 | ||
#define TZASC2_BASE 0x21D4000 | ||
#define UART2_BASE 0x021E8000 | ||
#define UART3_BASE 0x021EC000 | ||
#define UART4_BASE 0x021F0000 | ||
#define UART5_BASE 0x021F4000 | ||
#define AIPS1_BASE 0x02000000 | ||
#define AIPS1_SIZE 0x100000 | ||
#define AIPS2_BASE 0x02100000 | ||
#define AIPS2_SIZE 0x100000 | ||
#define AIPS3_BASE 0x02200000 | ||
#define AIPS3_SIZE 0x100000 | ||
|
||
#define SCU_BASE 0x00A00000 | ||
#define PL310_BASE 0x00A02000 | ||
#define SRC_BASE 0x020D8000 | ||
#define IRAM_BASE 0x00900000 | ||
|
||
#define OCOTP_BASE 0x021BC000 | ||
|
||
#define GIC_BASE 0x00A00000 | ||
#define GICD_OFFSET 0x1000 | ||
|
||
#if defined(CFG_MX6UL) || defined(CFG_MX6ULL) | ||
#define GICC_OFFSET 0x2000 | ||
/* No CAAM on i.MX6ULL */ | ||
#define CAAM_BASE 0x02140000 | ||
#else | ||
#define GICC_OFFSET 0x100 | ||
#define CAAM_BASE 0x02100000 | ||
#endif | ||
|
||
#define GIC_CPU_BASE (GIC_BASE + GICC_OFFSET) | ||
#define GIC_DIST_BASE (GIC_BASE + GICD_OFFSET) | ||
|
||
/* Central Security Unit register values */ | ||
#define CSU_BASE 0x021C0000 | ||
#define CSU_CSL_START 0x0 | ||
#define CSU_CSL_END 0xA0 | ||
#define CSU_CSL5 0x14 | ||
#define CSU_CSL15 0x3C | ||
#define CSU_CSL16 0x40 | ||
#define CSU_ACCESS_ALL 0x00FF00FF | ||
#define CSU_SETTING_LOCK 0x01000100 | ||
|
||
/* Used in suspend/resume and low power idle */ | ||
#define MX6Q_SRC_GPR1 0x20 | ||
#define MX6Q_SRC_GPR2 0x24 | ||
#define MX6Q_MMDC_MISC 0x18 | ||
#define MX6Q_MMDC_MAPSR 0x404 | ||
#define MX6Q_MMDC_MPDGCTRL0 0x83c | ||
#define MX6Q_GPC_IMR1 0x08 | ||
#define MX6Q_GPC_IMR2 0x0c | ||
#define MX6Q_GPC_IMR3 0x10 | ||
#define MX6Q_GPC_IMR4 0x14 | ||
#define MX6Q_CCM_CCR 0x0 | ||
#define MX6Q_ANATOP_CORE 0x140 | ||
|
||
#define IOMUXC_GPR9_OFFSET 0x24 | ||
#define IOMUXC_GPR10_OFFSET 0x28 | ||
|
||
#define IOMUXC_GPR10_OCRAM_TZ_ADDR_OFFSET 5 | ||
#define IOMUXC_GPR10_OCRAM_TZ_ADDR_MASK GENMASK_32(10, 5) | ||
|
||
#define IOMUXC_GPR10_OCRAM_TZ_EN_OFFSET 4 | ||
#define IOMUXC_GPR10_OCRAM_TZ_EN_MASK GENMASK_32(4, 4) | ||
|
||
#define IOMUXC_GPR10_OCRAM_TZ_EN_LOCK_OFFSET 20 | ||
#define IOMUXC_GPR10_OCRAM_TZ_EN_LOCK_MASK GENMASK_32(20, 20) | ||
#define IOMUXC_GPR10_OCRAM_TZ_ADDR_LOCK_OFFSET 21 | ||
#define IOMUXC_GPR10_OCRAM_TZ_ADDR_LOCK_MASK GENMASK_32(26, 21) | ||
|
||
#define IOMUXC_GPR10_OCRAM_TZ_ADDR_OFFSET_6UL 11 | ||
#define IOMUXC_GPR10_OCRAM_TZ_ADDR_MASK_6UL GENMASK_32(15, 11) | ||
#define IOMUXC_GPR10_OCRAM_TZ_EN_OFFSET_6UL 10 | ||
#define IOMUXC_GPR10_OCRAM_TZ_EN_MASK_6UL GENMASK_32(10, 10) | ||
|
||
#define IOMUXC_GPR10_OCRAM_TZ_EN_LOCK_OFFSET_6UL 26 | ||
#define IOMUXC_GPR10_OCRAM_TZ_EN_LOCK_MASK_6UL GENMASK_32(26, 26) | ||
#define IOMUXC_GPR10_OCRAM_TZ_ADDR_LOCK_OFFSET_6UL (27) | ||
#define IOMUXC_GPR10_OCRAM_TZ_ADDR_LOCK_MASK_6UL GENMASK_32(31, 27) | ||
|
||
/* Central Security Unit register values */ | ||
#define CSU_BASE 0x021C0000 | ||
#define CSU_CSL_START 0x0 | ||
#define CSU_CSL_END 0xA0 | ||
#define CSU_CSL5 0x14 | ||
#define CSU_CSL16 0x40 | ||
#define CSU_ACCESS_ALL 0x00FF00FF | ||
#define CSU_SETTING_LOCK 0x01000100 | ||
|
||
#if defined(CFG_MX6UL) || defined(CFG_MX6ULL) | ||
#define DRAM0_BASE 0x80000000 | ||
#else | ||
#define DRAM0_BASE 0x10000000 | ||
#endif | ||
|
||
#define SRC_SCR 0x000 | ||
#define SRC_GPR1 0x020 | ||
#define SRC_SCR_CPU_ENABLE_ALL SHIFT_U32(0x7, 22) | ||
#define SRC_SCR_CORE1_RST_OFFSET 14 | ||
#define SRC_SCR_CORE1_ENABLE_OFFSET 22 | ||
#else | ||
#error "CFG_MX6 not defined" | ||
#endif | ||
|
||
#define IOMUXC_GPR4_OFFSET 0x10 | ||
#define IOMUXC_GPR5_OFFSET 0x14 | ||
#define ARM_WFI_STAT_MASK(n) BIT(n) | ||
|
||
#endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declare also
psci_enable/disable_smp();
as they are defined?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are now only used by psci_armv7_cpu_off. We could export them when we need in future, i think:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok