* [PATCH v7 7/9] clocksource: timer-dm: Hook device platform data if not already assigned
From: Keerthy @ 2018-01-09 6:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515478987-5786-1-git-send-email-j-keerthy@ti.com>
From: Ladislav Michl <ladis@linux-mips.org>
In the case of device tree boot the device platform data is usually
NULL so hook the platform data obtained from the match.
As part of un-constify the platform_data pointer.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Keerthy <j-keerthy@ti.com>
---
drivers/clocksource/timer-dm.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/clocksource/timer-dm.c b/drivers/clocksource/timer-dm.c
index 1cbd954..60db173 100644
--- a/drivers/clocksource/timer-dm.c
+++ b/drivers/clocksource/timer-dm.c
@@ -806,14 +806,16 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
struct omap_dm_timer *timer;
struct resource *mem, *irq;
struct device *dev = &pdev->dev;
- const struct of_device_id *match;
const struct dmtimer_platform_data *pdata;
int ret;
- match = of_match_device(of_match_ptr(omap_timer_match), dev);
- pdata = match ? match->data : dev->platform_data;
+ pdata = of_device_get_match_data(dev);
+ if (!pdata)
+ pdata = dev_get_platdata(dev);
+ else
+ dev->platform_data = (void *)pdata;
- if (!pdata && !dev->of_node) {
+ if (!pdata) {
dev_err(dev, "%s: no platform data.\n", __func__);
return -ENODEV;
}
--
1.9.1
^ permalink raw reply related
* [PATCH v7 8/9] pwm: pwm-omap-dmtimer: Adapt driver to utilize dmtimer pdata ops
From: Keerthy @ 2018-01-09 6:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515478987-5786-1-git-send-email-j-keerthy@ti.com>
Adapt driver to utilize dmtimer pdata ops instead of pdata-quirks.
Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
drivers/pwm/pwm-omap-dmtimer.c | 68 ++++++++++++++++++++++++++----------------
1 file changed, 43 insertions(+), 25 deletions(-)
diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
index 5ad42f3..cc485d9 100644
--- a/drivers/pwm/pwm-omap-dmtimer.c
+++ b/drivers/pwm/pwm-omap-dmtimer.c
@@ -23,6 +23,7 @@
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_platform.h>
+#include <linux/platform_data/dmtimer-omap.h>
#include <linux/platform_data/pwm_omap_dmtimer.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
@@ -37,7 +38,7 @@ struct pwm_omap_dmtimer_chip {
struct pwm_chip chip;
struct mutex mutex;
pwm_omap_dmtimer *dm_timer;
- struct pwm_omap_dmtimer_pdata *pdata;
+ struct omap_dm_timer_ops *pdata;
struct platform_device *dm_timer_pdev;
};
@@ -242,19 +243,35 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct device_node *timer;
+ struct platform_device *timer_pdev;
struct pwm_omap_dmtimer_chip *omap;
- struct pwm_omap_dmtimer_pdata *pdata;
+ struct dmtimer_platform_data *timer_pdata;
+ struct omap_dm_timer_ops *pdata;
pwm_omap_dmtimer *dm_timer;
u32 v;
- int status;
+ int status, ret;
- pdata = dev_get_platdata(&pdev->dev);
- if (!pdata) {
- dev_err(&pdev->dev, "Missing dmtimer platform data\n");
- return -EINVAL;
+ timer = of_parse_phandle(np, "ti,timers", 0);
+ if (!timer)
+ return -ENODEV;
+
+ timer_pdev = of_find_device_by_node(timer);
+ if (!timer_pdev) {
+ dev_err(&pdev->dev, "Unable to find Timer pdev\n");
+ ret = -ENODEV;
+ goto put;
}
- if (!pdata->request_by_node ||
+ timer_pdata = dev_get_platdata(&timer_pdev->dev);
+ if (!timer_pdata) {
+ dev_err(&pdev->dev, "dmtimer pdata structure NULL\n");
+ ret = -EINVAL;
+ goto put;
+ }
+
+ pdata = timer_pdata->timer_ops;
+
+ if (!pdata || !pdata->request_by_node ||
!pdata->free ||
!pdata->enable ||
!pdata->disable ||
@@ -267,37 +284,32 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
!pdata->set_prescaler ||
!pdata->write_counter) {
dev_err(&pdev->dev, "Incomplete dmtimer pdata structure\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto put;
}
- timer = of_parse_phandle(np, "ti,timers", 0);
- if (!timer)
- return -ENODEV;
-
if (!of_get_property(timer, "ti,timer-pwm", NULL)) {
dev_err(&pdev->dev, "Missing ti,timer-pwm capability\n");
- return -ENODEV;
+ ret = -ENODEV;
+ goto put;
}
dm_timer = pdata->request_by_node(timer);
- if (!dm_timer)
- return -EPROBE_DEFER;
+ if (!dm_timer) {
+ ret = -EPROBE_DEFER;
+ goto put;
+ }
omap = devm_kzalloc(&pdev->dev, sizeof(*omap), GFP_KERNEL);
if (!omap) {
pdata->free(dm_timer);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto put;
}
omap->pdata = pdata;
omap->dm_timer = dm_timer;
-
- omap->dm_timer_pdev = of_find_device_by_node(timer);
- if (!omap->dm_timer_pdev) {
- dev_err(&pdev->dev, "Unable to find timer pdev\n");
- omap->pdata->free(dm_timer);
- return -EINVAL;
- }
+ omap->dm_timer_pdev = timer_pdev;
/*
* Ensure that the timer is stopped before we allow PWM core to call
@@ -326,12 +338,18 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
if (status < 0) {
dev_err(&pdev->dev, "failed to register PWM\n");
omap->pdata->free(omap->dm_timer);
- return status;
+ ret = status;
+ goto put;
}
platform_set_drvdata(pdev, omap);
return 0;
+
+put:
+ of_node_put(timer);
+
+ return ret;
}
static int pwm_omap_dmtimer_remove(struct platform_device *pdev)
--
1.9.1
^ permalink raw reply related
* [PATCH v7 9/9] arm: omap: pdata-quirks: Remove unused timer pdata
From: Keerthy @ 2018-01-09 6:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515478987-5786-1-git-send-email-j-keerthy@ti.com>
Remove unused timer pdata.
Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Tested-by: Ladislav Michl <ladis@linux-mips.org>
---
arch/arm/mach-omap2/pdata-quirks.c | 32 --------------------------------
1 file changed, 32 deletions(-)
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index ad9df86..e7d7fc7 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -24,10 +24,8 @@
#include <linux/platform_data/hsmmc-omap.h>
#include <linux/platform_data/iommu-omap.h>
#include <linux/platform_data/wkup_m3.h>
-#include <linux/platform_data/pwm_omap_dmtimer.h>
#include <linux/platform_data/media/ir-rx51.h>
#include <linux/platform_data/asoc-ti-mcbsp.h>
-#include <clocksource/dmtimer.h>
#include "common.h"
#include "common-board-devices.h"
@@ -477,33 +475,6 @@ void omap_auxdata_legacy_init(struct device *dev)
dev->platform_data = &twl_gpio_auxdata;
}
-/* Dual mode timer PWM callbacks platdata */
-#if IS_ENABLED(CONFIG_OMAP_DM_TIMER)
-static struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = {
- .request_by_node = omap_dm_timer_request_by_node,
- .request_specific = omap_dm_timer_request_specific,
- .request = omap_dm_timer_request,
- .set_source = omap_dm_timer_set_source,
- .get_irq = omap_dm_timer_get_irq,
- .set_int_enable = omap_dm_timer_set_int_enable,
- .set_int_disable = omap_dm_timer_set_int_disable,
- .free = omap_dm_timer_free,
- .enable = omap_dm_timer_enable,
- .disable = omap_dm_timer_disable,
- .get_fclk = omap_dm_timer_get_fclk,
- .start = omap_dm_timer_start,
- .stop = omap_dm_timer_stop,
- .set_load = omap_dm_timer_set_load,
- .set_match = omap_dm_timer_set_match,
- .set_pwm = omap_dm_timer_set_pwm,
- .set_prescaler = omap_dm_timer_set_prescaler,
- .read_counter = omap_dm_timer_read_counter,
- .write_counter = omap_dm_timer_write_counter,
- .read_status = omap_dm_timer_read_status,
- .write_status = omap_dm_timer_write_status,
-};
-#endif
-
static struct ir_rx51_platform_data __maybe_unused rx51_ir_data = {
.set_max_mpu_wakeup_lat = omap_pm_set_max_mpu_wakeup_lat,
};
@@ -572,9 +543,6 @@ static void __init omap3_mcbsp_init(void) {}
OF_DEV_AUXDATA("ti,am4372-wkup-m3", 0x44d00000, "44d00000.wkup_m3",
&wkup_m3_data),
#endif
-#if IS_ENABLED(CONFIG_OMAP_DM_TIMER)
- OF_DEV_AUXDATA("ti,omap-dmtimer-pwm", 0, NULL, &pwm_dmtimer_pdata),
-#endif
#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
&omap4_iommu_pdata),
--
1.9.1
^ permalink raw reply related
* [PATCH v2 1/4] dmaengine: xilinx_dma: populate dma caps properly
From: Appana Durga Kedareswara Rao @ 2018-01-09 7:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180109050449.GO18649@localhost>
Hi,
Thanks for the review...
>On Tue, Jan 09, 2018 at 04:48:10AM +0000, Appana Durga Kedareswara Rao
>wrote:
>> Hi,
>>
>> >On Mon, Jan 08, 2018 at 05:25:01PM +0000, Appana Durga Kedareswara
>> >Rao
>> >wrote:
>> >> Hi,
>> >>
>> >> <Snip>
>> >> >> >> + xdev->common.dst_addr_widths = BIT(addr_width / 8);
>> >> >> >> + xdev->common.src_addr_widths = BIT(addr_width / 8);
>> >> >> >
>> >> >> >Do you not support trf of 1byte, 2 bytes, or 4 bytes wide transfers?
>> >> >> >What is value of addr_width here typically? Usually controllers
>> >> >> >can support different widths and this is a surprise that you
>> >> >> >support only one value
>> >> >>
>> >> >> Controller supports address width of 32 and 64.
>> >> >
>> >> >Then this should have both 32 and 64 values here
>> >>
>> >> Address width is configurable parameter at the h/w level.
>> >> Since this IP is a soft IP user can create a design with either
>> >> 32-bit or 64-bit address configuration.
>> >
>> >and not both right?
>>
>> Yes not both at the same time...
>> Axi dma controller can be configured for either 32-bit or 64-bit address...
>
>So my suspicion was correct. I would suggest you to read up on the
>documentation again. The src/dst_addr_widths has _nothing_ to do with 32/64
>bit addresses used.
>
>It is the capability of the dma controller to do transfers with data width as 8bits,
>16 bits, so on. iKey is "data width" and not address type.
>This typically translates to DMA FIFO configuration of the controller!
Thanks for the detailed explanation...
I have gone through the spec again controller does supports 1 byte, 2 byte, 4 byte up to 128 byte transfers.
In order to do variable length transfers user needs to drive a valid value to the tkeep strobe signal at the h/w level.
And user needs to configure the below parameters c_m_axis_mm2s_tdata_width or c_m_axis_s2mm_tdata_width
With desired configuration at the h/w level.
Controller supports data width of 8, 16, 32, 64, 128, 256, 512 and 1,024 bits
(i.e. c_m_axis_mm2s_tdata_width/ c_m_axis_s2mm_tdata_width parameters range)
At the s/w level currently we are getting c_m_axis_mm2s_tdata_width/ c_m_axis_s2mm_tdata_width
Configuration as xlnx,datawidth property in the device-tree.
So proper values for the src/dst_addr width fields should be, datawidth property in bytes.
Please correct me if I am wrong...
Changes looks like below...
Here width is in bytes based on the h/w configuration...
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -2411,6 +2411,8 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
chan->direction = DMA_MEM_TO_DEV;
chan->id = chan_id;
chan->tdest = chan_id;
+ xdev->common.directions = BIT(DMA_MEM_TO_DEV);
+ xdev->common.src_addr_widths = BIT(width);
chan->ctrl_offset = XILINX_DMA_MM2S_CTRL_OFFSET;
if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
@@ -2428,6 +2430,8 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
chan->direction = DMA_DEV_TO_MEM;
chan->id = chan_id;
chan->tdest = chan_id - xdev->nr_channels;
+ xdev->common.directions |= BIT(DMA_DEV_TO_MEM);
+ xdev->common.dst_addr_widths = BIT(width);
chan->ctrl_offset = XILINX_DMA_S2MM_CTRL_OFFSET;
if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
Regards,
Kedar.
>
>--
>~Vinod
^ permalink raw reply
* [PATCH 00/12] Marvell NAND controller rework with ->exec_op()
From: Robert Jarzmik @ 2018-01-09 7:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180103215206.5d85b41b@bbrezillon>
Boris Brezillon <boris.brezillon@free-electrons.com> writes:
Ok I recovered my NAND.
For the next try, I'd like you to provide another "temporary patch" to disable
BBT actual writing, just to be sure. Once the driver is working properly, I'll
make another try without the temporary patch.
Tell me when a branch I can pull is ready.
Cheers.
--
Robert
^ permalink raw reply
* [RFC PATCH 0/9] soc: samsung: Add support of suspend-to-RAM on Exynos5433
From: Chanwoo Choi @ 2018-01-09 7:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CGME20180109075904epcas2p302d58aacfbb2195e455a25c90a1c610b@epcas2p3.samsung.com>
In the mainline, there is no case to support the suspend-to-RAM for Samsung
Exynos SoC. This patchset support the suspend-to-RAM for 64bit Exynos SoC.
For 32bit, arch/arm/mach-exynos/* directoy contains the suspend-related
codes such as suspend.c/exynos.c. But, 64bit Exynos should contain
the suspend-related codes in the drivers/soc/samsung/*. So, this patchset
develop the patch4/5 for drivers/soc/samsung/exynos-pm.c. to support suspend
64bit Exynos SoC.
But, I'm not sure what is proper approach for both 32/64bit Exynos.
- Approach1 : Split out the supend-related codes between 32/64bit.
: arch/arm/mach-exynos/* contains the suspend-related codes for 32bit.
: drivers/soc/samsung/* contains the suspend-related codes for 64bit.
- Approach2 : Consolidate the all suspend-related codes to drivers/soc/samsung/.
Please let us know your opinion.
The patch1/2/3 and 6/7/8/9 is just general patch. So, I add 'RFC' prefix to
only cover-letter, patch4/5. If you want to add the 'RFC' prefix to all
patches, I'll add 'RFC' prefix on v2.
Based on:
- git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git (branch: for-next)
Need to discuss patch4/5:
- patch4: soc: samsung: Add generic power-management driver for Exynos
- patch5: soc: samsung: pm: Add support for suspend-to-ram of Exynos5433
[Remaining Issues]
- The hang-out happen when disabling the MMC clocks on dw_mmc.c.
I reported to Jaehoon Chung. He is checking this issue. To test the
suspend-to-ram temporarily, you need to add CLK_IS_CRITICAL flag to
'aclk_mmc2/aclk_mmc0/sclk_mmc2/sclk_mmc0'.
- I enabled the at least kernel configuration in order to test
the suspend-to-RAM. So, I need to test it more time with DRM/Multimedia
and other. But, the suspend-to-RAM of cpu is successful.
- Exynos5433 SoC has two EXYNOS5433_EINT_WAKEUP_MASKx registers. The
pinctr-exynos.c need to handle the extra EINT_WAKEUP_MASKx for Exynos5433.
The suspend-to-ram test is failed on first time and then next tryout is ok.
I'm developing it.
Chanwoo Choi (9):
clk: samsung: exynos5433: Add clock flag to support suspend-to-ram
soc: samsung: pmu: Add powerup_conf callback
soc: samsung: pmu: Add the PMU data of exynos5433 to support low-power state
soc: samsung: Add generic power-management driver for Exynos
soc: samsung: pm: Add support for suspend-to-ram of Exynos5433
arm64: dts: exynos: Add iRAM device-tree node for Exynos5433
arm64: dts: exynos: Use power key as a wakeup source on TM2/TM2E board
arm64: dts: exynos: Add cpu_suspend property of PSCI for exynos5433
arm64: dts: exynos: Add cpu topology information for Exynos5433 SoC
arch/arm/mach-exynos/common.h | 3 -
arch/arm/mach-exynos/exynos.c | 23 +-
.../boot/dts/exynos/exynos5433-tm2-common.dtsi | 1 +
arch/arm64/boot/dts/exynos/exynos5433.dtsi | 47 ++++
drivers/clk/samsung/clk-exynos5433.c | 22 +-
drivers/soc/samsung/Makefile | 5 +-
drivers/soc/samsung/exynos-pm.c | 214 +++++++++++++++
drivers/soc/samsung/exynos-pmu.c | 9 +
drivers/soc/samsung/exynos-pmu.h | 3 +
drivers/soc/samsung/exynos5433-pmu.c | 286 +++++++++++++++++++++
include/linux/soc/samsung/exynos-pm.h | 21 ++
include/linux/soc/samsung/exynos-pmu.h | 1 +
include/linux/soc/samsung/exynos-regs-pmu.h | 148 +++++++++++
13 files changed, 745 insertions(+), 38 deletions(-)
create mode 100644 drivers/soc/samsung/exynos-pm.c
create mode 100644 drivers/soc/samsung/exynos5433-pmu.c
create mode 100644 include/linux/soc/samsung/exynos-pm.h
--
1.9.1
^ permalink raw reply
* [PATCH 1/9] clk: samsung: exynos5433: Add clock flag to support suspend-to-ram
From: Chanwoo Choi @ 2018-01-09 7:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com>
This patch adds the CLK_IS_CRITICAL and CLK_IGNORE_UNUSED flag
to some clocks in order to avoid the hang-out in the suspend mode.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-clk at vger.kernel.org
---
drivers/clk/samsung/clk-exynos5433.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c
index db270908037a..3dc53cd0c730 100644
--- a/drivers/clk/samsung/clk-exynos5433.c
+++ b/drivers/clk/samsung/clk-exynos5433.c
@@ -583,25 +583,25 @@
CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
GATE(CLK_ACLK_CAM1_333, "aclk_cam1_333", "div_aclk_cam1_333",
ENABLE_ACLK_TOP, 13,
- CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
+ CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
GATE(CLK_ACLK_CAM1_400, "aclk_cam1_400", "div_aclk_cam1_400",
ENABLE_ACLK_TOP, 12,
CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
GATE(CLK_ACLK_CAM1_552, "aclk_cam1_552", "div_aclk_cam1_552",
ENABLE_ACLK_TOP, 11,
- CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
+ CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
GATE(CLK_ACLK_CAM0_333, "aclk_cam0_333", "div_aclk_cam0_333",
ENABLE_ACLK_TOP, 10,
- CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
+ CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
GATE(CLK_ACLK_CAM0_400, "aclk_cam0_400", "div_aclk_cam0_400",
ENABLE_ACLK_TOP, 9,
CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
GATE(CLK_ACLK_CAM0_552, "aclk_cam0_552", "div_aclk_cam0_552",
ENABLE_ACLK_TOP, 8,
- CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
+ CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
GATE(CLK_ACLK_ISP_DIS_400, "aclk_isp_dis_400", "div_aclk_isp_dis_400",
ENABLE_ACLK_TOP, 7,
- CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
+ CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
GATE(CLK_ACLK_ISP_400, "aclk_isp_400", "div_aclk_isp_400",
ENABLE_ACLK_TOP, 6,
CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
@@ -624,11 +624,11 @@
/* ENABLE_SCLK_TOP_CAM1 */
GATE(CLK_SCLK_ISP_SENSOR2, "sclk_isp_sensor2", "div_sclk_isp_sensor2_b",
- ENABLE_SCLK_TOP_CAM1, 7, 0, 0),
+ ENABLE_SCLK_TOP_CAM1, 7, CLK_IGNORE_UNUSED, 0),
GATE(CLK_SCLK_ISP_SENSOR1, "sclk_isp_sensor1", "div_sclk_isp_sensor1_b",
ENABLE_SCLK_TOP_CAM1, 6, 0, 0),
GATE(CLK_SCLK_ISP_SENSOR0, "sclk_isp_sensor0", "div_sclk_isp_sensor0_b",
- ENABLE_SCLK_TOP_CAM1, 5, 0, 0),
+ ENABLE_SCLK_TOP_CAM1, 5, CLK_IGNORE_UNUSED, 0),
GATE(CLK_SCLK_ISP_MCTADC_CAM1, "sclk_isp_mctadc_cam1", "oscclk",
ENABLE_SCLK_TOP_CAM1, 4, 0, 0),
GATE(CLK_SCLK_ISP_UART_CAM1, "sclk_isp_uart_cam1", "div_sclk_isp_uart",
@@ -636,7 +636,7 @@
GATE(CLK_SCLK_ISP_SPI1_CAM1, "sclk_isp_spi1_cam1", "div_sclk_isp_spi1_b",
ENABLE_SCLK_TOP_CAM1, 1, 0, 0),
GATE(CLK_SCLK_ISP_SPI0_CAM1, "sclk_isp_spi0_cam1", "div_sclk_isp_spi0_b",
- ENABLE_SCLK_TOP_CAM1, 0, 0, 0),
+ ENABLE_SCLK_TOP_CAM1, 0, CLK_IGNORE_UNUSED, 0),
/* ENABLE_SCLK_TOP_DISP */
GATE(CLK_SCLK_HDMI_SPDIF_DISP, "sclk_hdmi_spdif_disp",
@@ -654,7 +654,7 @@
ENABLE_SCLK_TOP_FSYS, 4, CLK_SET_RATE_PARENT, 0),
GATE(CLK_SCLK_UFSUNIPRO_FSYS, "sclk_ufsunipro_fsys",
"div_sclk_ufsunipro", ENABLE_SCLK_TOP_FSYS,
- 3, CLK_SET_RATE_PARENT, 0),
+ 3, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
GATE(CLK_SCLK_USBHOST30_FSYS, "sclk_usbhost30_fsys",
"div_sclk_usbhost30", ENABLE_SCLK_TOP_FSYS,
1, CLK_SET_RATE_PARENT, 0),
@@ -2982,7 +2982,7 @@ static void __init exynos5433_cmu_peris_init(struct device_node *np)
GATE(CLK_PCLK_AUD_SLIMBUS, "pclk_aud_slimbus", "div_aclk_aud",
ENABLE_PCLK_AUD, 6, 0, 0),
GATE(CLK_PCLK_AUD_UART, "pclk_aud_uart", "div_aclk_aud",
- ENABLE_PCLK_AUD, 5, 0, 0),
+ ENABLE_PCLK_AUD, 5, CLK_IS_CRITICAL, 0),
GATE(CLK_PCLK_AUD_PCM, "pclk_aud_pcm", "div_aclk_aud",
ENABLE_PCLK_AUD, 4, 0, 0),
GATE(CLK_PCLK_AUD_I2S, "pclk_aud_i2s", "div_aclk_aud",
@@ -3008,7 +3008,7 @@ static void __init exynos5433_cmu_peris_init(struct device_node *np)
GATE(CLK_SCLK_AUD_SLIMBUS, "sclk_aud_slimbus", "div_sclk_aud_slimbus",
ENABLE_SCLK_AUD1, 4, 0, 0),
GATE(CLK_SCLK_AUD_UART, "sclk_aud_uart", "div_sclk_aud_uart",
- ENABLE_SCLK_AUD1, 3, CLK_IGNORE_UNUSED, 0),
+ ENABLE_SCLK_AUD1, 3, CLK_IS_CRITICAL, 0),
GATE(CLK_SCLK_AUD_PCM, "sclk_aud_pcm", "div_sclk_aud_pcm",
ENABLE_SCLK_AUD1, 2, 0, 0),
GATE(CLK_SCLK_I2S_BCLK, "sclk_i2s_bclk", "ioclk_i2s_bclk",
--
1.9.1
^ permalink raw reply related
* [PATCH 2/9] soc: samsung: pmu: Add powerup_conf callback
From: Chanwoo Choi @ 2018-01-09 7:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com>
This patch adds the powerup_conf callback which is used to re-initialize
the PMU registers during the resume state.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/soc/samsung/exynos-pmu.c | 8 ++++++++
drivers/soc/samsung/exynos-pmu.h | 1 +
include/linux/soc/samsung/exynos-pmu.h | 1 +
3 files changed, 10 insertions(+)
diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c
index f56adbd9fb8b..cfc9de518344 100644
--- a/drivers/soc/samsung/exynos-pmu.c
+++ b/drivers/soc/samsung/exynos-pmu.c
@@ -58,6 +58,14 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode)
pmu_data->powerdown_conf_extra(mode);
}
+void exynos_sys_powerup_conf(enum sys_powerdown mode)
+{
+ const struct exynos_pmu_data *pmu_data = pmu_context->pmu_data;
+
+ if (pmu_data->powerup_conf)
+ pmu_data->powerup_conf(mode);
+}
+
/*
* Split the data between ARM architectures because it is relatively big
* and useless on other arch.
diff --git a/drivers/soc/samsung/exynos-pmu.h b/drivers/soc/samsung/exynos-pmu.h
index 977e4daf5a0f..efbaf8929252 100644
--- a/drivers/soc/samsung/exynos-pmu.h
+++ b/drivers/soc/samsung/exynos-pmu.h
@@ -24,6 +24,7 @@ struct exynos_pmu_data {
void (*pmu_init)(void);
void (*powerdown_conf)(enum sys_powerdown);
void (*powerdown_conf_extra)(enum sys_powerdown);
+ void (*powerup_conf)(enum sys_powerdown);
};
extern void __iomem *pmu_base_addr;
diff --git a/include/linux/soc/samsung/exynos-pmu.h b/include/linux/soc/samsung/exynos-pmu.h
index e57eb4b6cc5a..3aacf7b18401 100644
--- a/include/linux/soc/samsung/exynos-pmu.h
+++ b/include/linux/soc/samsung/exynos-pmu.h
@@ -22,6 +22,7 @@ enum sys_powerdown {
};
extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
+extern void exynos_sys_powerup_conf(enum sys_powerdown mode);
#ifdef CONFIG_EXYNOS_PMU
extern struct regmap *exynos_get_pmu_regmap(void);
#else
--
1.9.1
^ permalink raw reply related
* [PATCH 3/9] soc: samsung: pmu: Add the PMU data of exynos5433 to support low-power state
From: Chanwoo Choi @ 2018-01-09 7:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com>
This patch adds the PMU (Power Management Unit) data of exynos5433 SoC
in order to support the various power modes. Each power mode has
the different value for reducing the power-consumption.
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
arch/arm/mach-exynos/common.h | 2 -
drivers/soc/samsung/Makefile | 3 +-
drivers/soc/samsung/exynos-pmu.c | 1 +
drivers/soc/samsung/exynos-pmu.h | 2 +
drivers/soc/samsung/exynos5433-pmu.c | 286 ++++++++++++++++++++++++++++
include/linux/soc/samsung/exynos-regs-pmu.h | 148 ++++++++++++++
6 files changed, 439 insertions(+), 3 deletions(-)
create mode 100644 drivers/soc/samsung/exynos5433-pmu.c
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 098f84a149a3..afbc143a3d5d 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -125,8 +125,6 @@ enum {
void exynos_set_boot_flag(unsigned int cpu, unsigned int mode);
void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode);
-extern u32 exynos_get_eint_wake_mask(void);
-
#ifdef CONFIG_PM_SLEEP
extern void __init exynos_pm_init(void);
#else
diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile
index 29f294baac6e..d2e637339a45 100644
--- a/drivers/soc/samsung/Makefile
+++ b/drivers/soc/samsung/Makefile
@@ -2,5 +2,6 @@
obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o
obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \
- exynos5250-pmu.o exynos5420-pmu.o
+ exynos5250-pmu.o exynos5420-pmu.o \
+ exynos5433-pmu.o
obj-$(CONFIG_EXYNOS_PM_DOMAINS) += pm_domains.o
diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c
index cfc9de518344..7112d7b2749b 100644
--- a/drivers/soc/samsung/exynos-pmu.c
+++ b/drivers/soc/samsung/exynos-pmu.c
@@ -97,6 +97,7 @@ void exynos_sys_powerup_conf(enum sys_powerdown mode)
.data = exynos_pmu_data_arm_ptr(exynos5420_pmu_data),
}, {
.compatible = "samsung,exynos5433-pmu",
+ .data = exynos_pmu_data_arm_ptr(exynos5433_pmu_data),
},
{ /*sentinel*/ },
};
diff --git a/drivers/soc/samsung/exynos-pmu.h b/drivers/soc/samsung/exynos-pmu.h
index efbaf8929252..895c786a2f4c 100644
--- a/drivers/soc/samsung/exynos-pmu.h
+++ b/drivers/soc/samsung/exynos-pmu.h
@@ -28,6 +28,7 @@ struct exynos_pmu_data {
};
extern void __iomem *pmu_base_addr;
+extern u32 exynos_get_eint_wake_mask(void);
#ifdef CONFIG_EXYNOS_PMU_ARM_DRIVERS
/* list of all exported SoC specific data */
@@ -36,6 +37,7 @@ struct exynos_pmu_data {
extern const struct exynos_pmu_data exynos4412_pmu_data;
extern const struct exynos_pmu_data exynos5250_pmu_data;
extern const struct exynos_pmu_data exynos5420_pmu_data;
+extern const struct exynos_pmu_data exynos5433_pmu_data;
#endif
extern void pmu_raw_writel(u32 val, u32 offset);
diff --git a/drivers/soc/samsung/exynos5433-pmu.c b/drivers/soc/samsung/exynos5433-pmu.c
new file mode 100644
index 000000000000..2571e61522f0
--- /dev/null
+++ b/drivers/soc/samsung/exynos5433-pmu.c
@@ -0,0 +1,286 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (c) 2018 Samsung Electronics Co., Ltd.
+// Copyright (c) Jonghwa Lee <jonghwa3.lee@samsung.com>
+// Copyright (c) Chanwoo Choi <cw00.choi@samsung.com>
+//
+// EXYNOS5433 - CPU PMU (Power Management Unit) support
+
+#include <linux/soc/samsung/exynos-regs-pmu.h>
+#include <linux/soc/samsung/exynos-pmu.h>
+
+#include "exynos-pmu.h"
+
+static struct exynos_pmu_conf exynos5433_pmu_config[] = {
+ /* { .offset = address, .val = { AFTR, LPA, SLEEP } } */
+ { EXYNOS5433_ATLAS_CPU0_SYS_PWR_REG, { 0x0, 0x0, 0x8 } },
+ { EXYNOS5433_DIS_IRQ_ATLAS_CPU0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_ATLAS_CPU1_SYS_PWR_REG, { 0x0, 0x0, 0x8 } },
+ { EXYNOS5433_DIS_IRQ_ATLAS_CPU1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_ATLAS_CPU2_SYS_PWR_REG, { 0x0, 0x0, 0x8 } },
+ { EXYNOS5433_DIS_IRQ_ATLAS_CPU2_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_ATLAS_CPU3_SYS_PWR_REG, { 0x0, 0x0, 0x8 } },
+ { EXYNOS5433_DIS_IRQ_ATLAS_CPU3_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_APOLLO_CPU0_SYS_PWR_REG, { 0x0, 0x0, 0x8 } },
+ { EXYNOS5433_DIS_IRQ_APOLLO_CPU0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_APOLLO_CPU1_SYS_PWR_REG, { 0x0, 0x0, 0x8 } },
+ { EXYNOS5433_DIS_IRQ_APOLLO_CPU1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_APOLLO_CPU2_SYS_PWR_REG, { 0x0, 0x0, 0x8 } },
+ { EXYNOS5433_DIS_IRQ_APOLLO_CPU2_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_APOLLO_CPU3_SYS_PWR_REG, { 0x0, 0x0, 0x8 } },
+ { EXYNOS5433_DIS_IRQ_APOLLO_CPU3_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_ATLAS_NONCPU_SYS_PWR_REG, { 0x0, 0x0, 0x8 } },
+ { EXYNOS5433_APOLLO_NONCPU_SYS_PWR_REG, { 0x0, 0x0, 0x8 } },
+ { EXYNOS5433_A5IS_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_DIS_IRQ_A5IS_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_DIS_IRQ_A5IS_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } },
+ { EXYNOS5433_ATLAS_L2_SYS_PWR_REG, { 0x0, 0x0, 0x7 } },
+ { EXYNOS5433_APOLLO_L2_SYS_PWR_REG, { 0x0, 0x0, 0x7 } },
+ { EXYNOS5433_CLKSTOP_CMU_TOP_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_CLKRUN_CMU_TOP_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_RESET_CMU_TOP_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_RESET_CPUCLKSTOP_SYS_PWR_REG, { 0x1, 0x1, 0x0 } },
+ { EXYNOS5433_CLKSTOP_CMU_MIF_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_CLKRUN_CMU_MIF_SYS_PWR_REG, { 0x1, 0x1, 0x0 } },
+ { EXYNOS5433_RESET_CMU_MIF_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_DDRPHY_DLLLOCK_SYS_PWR_REG, { 0x1, 0x1, 0x1 } },
+ { EXYNOS5433_DISABLE_PLL_CMU_TOP_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_DISABLE_PLL_AUD_PLL_SYS_PWR_REG, { 0x1, 0x1, 0x0 } },
+ { EXYNOS5433_DISABLE_PLL_CMU_MIF_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_TOP_BUS_SYS_PWR_REG, { 0x7, 0x0, 0x0 } },
+ { EXYNOS5433_TOP_RETENTION_SYS_PWR_REG, { 0x1, 0x0, 0x1 } },
+ { EXYNOS5433_TOP_PWR_SYS_PWR_REG, { 0x3, 0x0, 0x3 } },
+ { EXYNOS5433_TOP_BUS_MIF_SYS_PWR_REG, { 0x7, 0x0, 0x0 } },
+ { EXYNOS5433_TOP_RETENTION_MIF_SYS_PWR_REG, { 0x1, 0x0, 0x1 } },
+ { EXYNOS5433_TOP_PWR_MIF_SYS_PWR_REG, { 0x3, 0x0, 0x3 } },
+ { EXYNOS5433_LOGIC_RESET_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_OSCCLK_GATE_SYS_PWR_REG, { 0x1, 0x0, 0x1 } },
+ { EXYNOS5433_SLEEP_RESET_SYS_PWR_REG, { 0x1, 0x1, 0x0 } },
+ { EXYNOS5433_LOGIC_RESET_MIF_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_OSCCLK_GATE_MIF_SYS_PWR_REG, { 0x1, 0x0, 0x1 } },
+ { EXYNOS5433_SLEEP_RESET_MIF_SYS_PWR_REG, { 0x1, 0x1, 0x0 } },
+ { EXYNOS5433_MEMORY_TOP_SYS_PWR_REG, { 0x3, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_RETENTION_LPDDR3_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_RETENTION_JTAG_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_RETENTION_TOP_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_RETENTION_UART_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_RETENTION_EBIA_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_RETENTION_EBIB_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_RETENTION_SPI_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_RETENTION_MIF_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_ISOLATION_SYS_PWR_REG, { 0x1, 0x0, 0x1 } },
+ { EXYNOS5433_PAD_RETENTION_USBXTI_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_RETENTION_BOOTLDO_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_ISOLATION_MIF_SYS_PWR_REG, { 0x1, 0x0, 0x1 } },
+ { EXYNOS5433_PAD_RETENTION_FSYSGENIO_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_PAD_ALV_SEL_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_XXTI_SYS_PWR_REG, { 0x1, 0x1, 0x0 } },
+ { EXYNOS5433_XXTI26_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_EXT_REGULATOR_SYS_PWR_REG, { 0x1, 0x1, 0x0 } },
+ { EXYNOS5433_GPIO_MODE_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_GPIO_MODE_FSYS0_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_GPIO_MODE_MIF_SYS_PWR_REG, { 0x1, 0x0, 0x0 } },
+ { EXYNOS5433_GPIO_MODE_AUD_SYS_PWR_REG, { 0x1, 0x1, 0x0 } },
+ { EXYNOS5433_GSCL_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_CAM0_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_MSCL_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_G3D_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_DISP_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_CAM1_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_AUD_SYS_PWR_REG, { 0xF, 0xF, 0x0 } },
+ { EXYNOS5433_FSYS_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_BUS2_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_G2D_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_ISP0_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_MFC_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_HEVC_SYS_PWR_REG, { 0xF, 0x0, 0x0 } },
+ { EXYNOS5433_RESET_SLEEP_FSYS_SYS_PWR_REG, { 0x1, 0x1, 0x0 } },
+ { EXYNOS5433_RESET_SLEEP_BUS2_SYS_PWR_REG, { 0x1, 0x1, 0x0 } },
+ { PMU_TABLE_END, },
+};
+
+static unsigned int const exynos5433_list_feed[] = {
+ EXYNOS5433_ATLAS_NONCPU_OPTION,
+ EXYNOS5433_APOLLO_NONCPU_OPTION,
+ EXYNOS5433_TOP_PWR_OPTION,
+ EXYNOS5433_TOP_PWR_MIF_OPTION,
+ EXYNOS5433_AUD_OPTION,
+ EXYNOS5433_CAM0_OPTION,
+ EXYNOS5433_DISP_OPTION,
+ EXYNOS5433_G2D_OPTION,
+ EXYNOS5433_G3D_OPTION,
+ EXYNOS5433_HEVC_OPTION,
+ EXYNOS5433_MSCL_OPTION,
+ EXYNOS5433_MFC_OPTION,
+ EXYNOS5433_GSCL_OPTION,
+ EXYNOS5433_FSYS_OPTION,
+ EXYNOS5433_ISP_OPTION,
+ EXYNOS5433_BUS2_OPTION,
+};
+
+static unsigned int const exynos5433_list_pad_retention[] = {
+ EXYNOS5433_PAD_RETENTION_LPDDR3_OPTION,
+ EXYNOS5433_PAD_RETENTION_AUD_OPTION,
+ EXYNOS5433_PAD_RETENTION_MMC2_OPTION,
+ EXYNOS5433_PAD_RETENTION_TOP_OPTION,
+ EXYNOS5433_PAD_RETENTION_UART_OPTION,
+ EXYNOS5433_PAD_RETENTION_MMC0_OPTION,
+ EXYNOS5433_PAD_RETENTION_MMC1_OPTION,
+ EXYNOS5433_PAD_RETENTION_EBIA_OPTION,
+ EXYNOS5433_PAD_RETENTION_EBIB_OPTION,
+ EXYNOS5433_PAD_RETENTION_SPI_OPTION,
+ EXYNOS5433_PAD_RETENTION_MIF_OPTION,
+ EXYNOS5433_PAD_RETENTION_USBXTI_OPTION,
+ EXYNOS5433_PAD_RETENTION_BOOTLDO_OPTION,
+ EXYNOS5433_PAD_RETENTION_UFS_OPTION,
+ EXYNOS5433_PAD_RETENTION_FSYSGENIO_OPTION,
+};
+
+static void exynos5433_set_wakeupmask(enum sys_powerdown mode)
+{
+ u32 intmask = 0;
+
+ pmu_raw_writel(exynos_get_eint_wake_mask(),
+ EXYNOS5433_EINT_WAKEUP_MASK);
+
+ /* Disable WAKEUP event monitor */
+ intmask = pmu_raw_readl(EXYNOS5433_WAKEUP_MASK);
+ intmask &= ~(1 << 31);
+ pmu_raw_writel(intmask, EXYNOS5433_WAKEUP_MASK);
+
+ pmu_raw_writel(0xFFFF0000, EXYNOS5433_WAKEUP_MASK2);
+ pmu_raw_writel(0xFFFF0000, EXYNOS5433_WAKEUP_MASK3);
+}
+
+static void exynos5433_pmu_central_seq(bool enable)
+{
+ unsigned int tmp;
+
+ tmp = pmu_raw_readl(EXYNOS5433_CENTRAL_SEQ_CONFIGURATION);
+ if (enable)
+ tmp &= ~EXYNOS5433_CENTRALSEQ_PWR_CFG;
+ else
+ tmp |= EXYNOS5433_CENTRALSEQ_PWR_CFG;
+ pmu_raw_writel(tmp, EXYNOS5433_CENTRAL_SEQ_CONFIGURATION);
+
+ tmp = pmu_raw_readl(EXYNOS5433_CENTRAL_SEQ_MIF_CONFIGURATION);
+ if (enable)
+ tmp &= ~EXYNOS5433_CENTRALSEQ_PWR_CFG;
+ else
+ tmp |= EXYNOS5433_CENTRALSEQ_PWR_CFG;
+ pmu_raw_writel(tmp, EXYNOS5433_CENTRAL_SEQ_MIF_CONFIGURATION);
+}
+
+static void exynos5433_pmu_pad_retention_release(void)
+{
+ unsigned int tmp;
+ int i;
+
+ for (i = 0 ; i < ARRAY_SIZE(exynos5433_list_pad_retention) ; i++) {
+ tmp = pmu_raw_readl(exynos5433_list_pad_retention[i]);
+ tmp |= EXYNOS5433_INITIATE_WAKEUP_FROM_LOWPOWER;
+ pmu_raw_writel(tmp, exynos5433_list_pad_retention[i]);
+ }
+}
+
+static void exynos5433_pmu_init(void)
+{
+ unsigned int tmp;
+ int i, cluster, cpu;
+
+ /* Enable non retention flip-flop reset for wakeup */
+ tmp = pmu_raw_readl(EXYNOS5433_PMU_SPARE0);
+ tmp |= EXYNOS5433_EN_NONRET_RESET;
+ pmu_raw_writel(tmp, EXYNOS5433_PMU_SPARE0);
+
+ /* Enable only SC_FEEDBACK for the register list */
+ for (i = 0 ; i < ARRAY_SIZE(exynos5433_list_feed) ; i++) {
+ tmp = pmu_raw_readl(exynos5433_list_feed[i]);
+ tmp &= ~EXYNOS5_USE_SC_COUNTER;
+ tmp |= EXYNOS5_USE_SC_FEEDBACK;
+ pmu_raw_writel(tmp, exynos5433_list_feed[i]);
+ }
+
+ /*
+ * Disable automatic L2 flush, Disable L2 retention and
+ * Enable STANDBYWFIL2, ACE/ACP
+ */
+ for (cluster = 0; cluster < 2; cluster++) {
+ tmp = pmu_raw_readl(EXYNOS5433_ATLAS_L2_OPTION + (cluster * 0x20));
+ tmp &= ~(EXYNOS5433_USE_AUTO_L2FLUSHREQ | EXYNOS5433_USE_RETENTION);
+
+ if (cluster == 0) {
+ tmp |= (EXYNOS5433_USE_STANDBYWFIL2 |
+ EXYNOS5433_USE_DEACTIVATE_ACE |
+ EXYNOS5433_USE_DEACTIVATE_ACP);
+ }
+ pmu_raw_writel(tmp, EXYNOS5433_ATLAS_L2_OPTION + (cluster * 0x20));
+ }
+
+ /*
+ * Enable both SC_COUNTER and SC_FEEDBACK for the CPUs
+ * Use STANDBYWFI and SMPEN to indicate that core is ready to enter
+ * low power mode
+ */
+ for (cpu = 0; cpu < 8; cpu++) {
+ tmp = pmu_raw_readl(EXYNOS5433_CPU_OPTION(cpu));
+ tmp |= (EXYNOS5_USE_SC_FEEDBACK | EXYNOS5_USE_SC_COUNTER);
+ tmp |= EXYNOS5433_USE_SMPEN;
+ tmp |= EXYNOS5433_USE_STANDBYWFI;
+ tmp &= ~EXYNOS5433_USE_STANDBYWFE;
+ pmu_raw_writel(tmp, EXYNOS5433_CPU_OPTION(cpu));
+
+ tmp = pmu_raw_readl(EXYNOS5433_CPU_DURATION(cpu));
+ tmp |= EXYNOS5433_DUR_WAIT_RESET;
+ tmp &= ~EXYNOS5433_DUR_SCALL;
+ tmp |= EXYNOS5433_DUR_SCALL_VALUE;
+ pmu_raw_writel(tmp, EXYNOS5433_CPU_DURATION(cpu));
+ }
+
+ /* Skip atlas block power-off during automatic power down sequence */
+ tmp = pmu_raw_readl(EXYNOS5433_ATLAS_CPUSEQUENCER_OPTION);
+ tmp |= EXYNOS5433_SKIP_BLK_PWR_DOWN;
+ pmu_raw_writel(tmp, EXYNOS5433_ATLAS_CPUSEQUENCER_OPTION);
+
+ /* Limit in-rush current during local power up of cores */
+ tmp = pmu_raw_readl(EXYNOS5433_UP_SCHEDULER);
+ tmp |= EXYNOS5433_ENABLE_ATLAS_CPU;
+ pmu_raw_writel(tmp, EXYNOS5433_UP_SCHEDULER);
+}
+
+static void exynos5433_powerdown_conf(enum sys_powerdown mode)
+{
+ switch (mode) {
+ case SYS_SLEEP:
+ exynos5433_set_wakeupmask(mode);
+ exynos5433_pmu_central_seq(true);
+ break;
+ default:
+ break;
+ };
+}
+
+static void exynos5433_powerup_conf(enum sys_powerdown mode)
+{
+ unsigned int wakeup;
+
+ switch (mode) {
+ case SYS_SLEEP:
+ wakeup = pmu_raw_readl(EXYNOS5433_CENTRAL_SEQ_CONFIGURATION);
+ wakeup &= EXYNOS5433_CENTRALSEQ_PWR_CFG;
+ if (wakeup)
+ exynos5433_pmu_pad_retention_release();
+ else
+ exynos5433_pmu_central_seq(false);
+ break;
+ default:
+ break;
+ };
+}
+
+const struct exynos_pmu_data exynos5433_pmu_data = {
+ .pmu_config = exynos5433_pmu_config,
+ .pmu_init = exynos5433_pmu_init,
+ .powerdown_conf = exynos5433_powerdown_conf,
+ .powerup_conf = exynos5433_powerup_conf,
+};
diff --git a/include/linux/soc/samsung/exynos-regs-pmu.h b/include/linux/soc/samsung/exynos-regs-pmu.h
index bebdde5dccd6..93a52d133ba1 100644
--- a/include/linux/soc/samsung/exynos-regs-pmu.h
+++ b/include/linux/soc/samsung/exynos-regs-pmu.h
@@ -645,7 +645,110 @@
| EXYNOS5420_KFC_USE_STANDBY_WFI3)
/* For EXYNOS5433 */
+#define EXYNOS5433_UP_SCHEDULER (0x0120)
+#define EXYNOS5433_CENTRAL_SEQ_CONFIGURATION (0x0200)
+#define EXYNOS5433_CENTRAL_SEQ_MIF_CONFIGURATION (0x0240)
+#define EXYNOS5433_EINT_WAKEUP_MASK (0x060C)
+#define EXYNOS5433_WAKEUP_MASK (0x0610)
+#define EXYNOS5433_WAKEUP_MASK2 (0x0614)
+#define EXYNOS5433_WAKEUP_MASK3 (0x0618)
+#define EXYNOS5433_EINT_WAKEUP_MASK1 (0x062C)
#define EXYNOS5433_USBHOST30_PHY_CONTROL (0x0728)
+#define EXYNOS5433_PMU_SPARE0 (0x0900)
+#define EXYNOS5433_ATLAS_CPU0_SYS_PWR_REG (0x1000)
+#define EXYNOS5433_DIS_IRQ_ATLAS_CPU0_CENTRAL_SYS_PWR_REG (0x1008)
+#define EXYNOS5433_ATLAS_CPU1_SYS_PWR_REG (0x1010)
+#define EXYNOS5433_DIS_IRQ_ATLAS_CPU1_CENTRAL_SYS_PWR_REG (0x1018)
+#define EXYNOS5433_ATLAS_CPU2_SYS_PWR_REG (0x1020)
+#define EXYNOS5433_DIS_IRQ_ATLAS_CPU2_CENTRAL_SYS_PWR_REG (0x1028)
+#define EXYNOS5433_ATLAS_CPU3_SYS_PWR_REG (0x1030)
+#define EXYNOS5433_DIS_IRQ_ATLAS_CPU3_CENTRAL_SYS_PWR_REG (0x1038)
+#define EXYNOS5433_APOLLO_CPU0_SYS_PWR_REG (0x1040)
+#define EXYNOS5433_DIS_IRQ_APOLLO_CPU0_CENTRAL_SYS_PWR_REG (0x1048)
+#define EXYNOS5433_APOLLO_CPU1_SYS_PWR_REG (0x1050)
+#define EXYNOS5433_DIS_IRQ_APOLLO_CPU1_CENTRAL_SYS_PWR_REG (0x1058)
+#define EXYNOS5433_APOLLO_CPU2_SYS_PWR_REG (0x1060)
+#define EXYNOS5433_DIS_IRQ_APOLLO_CPU2_CENTRAL_SYS_PWR_REG (0x1068)
+#define EXYNOS5433_APOLLO_CPU3_SYS_PWR_REG (0x1070)
+#define EXYNOS5433_DIS_IRQ_APOLLO_CPU3_CENTRAL_SYS_PWR_REG (0x1078)
+#define EXYNOS5433_ATLAS_NONCPU_SYS_PWR_REG (0x1080)
+#define EXYNOS5433_ATLAS_L2_SYS_PWR_REG (0x10C0)
+#define EXYNOS5433_APOLLO_L2_SYS_PWR_REG (0x10C4)
+#define EXYNOS5433_APOLLO_NONCPU_SYS_PWR_REG (0x1084)
+#define EXYNOS5433_A5IS_SYS_PWR_REG (0x10B0)
+#define EXYNOS5433_DIS_IRQ_A5IS_LOCAL_SYS_PWR_REG (0x10B4)
+#define EXYNOS5433_DIS_IRQ_A5IS_CENTRAL_SYS_PWR_REG (0x10B8)
+#define EXYNOS5433_CLKSTOP_CMU_TOP_SYS_PWR_REG (0x1100)
+#define EXYNOS5433_CLKRUN_CMU_TOP_SYS_PWR_REG (0x1104)
+#define EXYNOS5433_RESET_CMU_TOP_SYS_PWR_REG (0x110C)
+#define EXYNOS5433_RESET_CPUCLKSTOP_SYS_PWR_REG (0x111C)
+#define EXYNOS5433_CLKSTOP_CMU_MIF_SYS_PWR_REG (0x1120)
+#define EXYNOS5433_CLKRUN_CMU_MIF_SYS_PWR_REG (0x1124)
+#define EXYNOS5433_RESET_CMU_MIF_SYS_PWR_REG (0x112C)
+#define EXYNOS5433_DDRPHY_DLLLOCK_SYS_PWR_REG (0x1138)
+#define EXYNOS5433_DISABLE_PLL_CMU_TOP_SYS_PWR_REG (0x1140)
+#define EXYNOS5433_DISABLE_PLL_AUD_PLL_SYS_PWR_REG (0x1144)
+#define EXYNOS5433_DISABLE_PLL_CMU_MIF_SYS_PWR_REG (0x1160)
+#define EXYNOS5433_TOP_BUS_SYS_PWR_REG (0x1180)
+#define EXYNOS5433_TOP_RETENTION_SYS_PWR_REG (0x1184)
+#define EXYNOS5433_TOP_PWR_SYS_PWR_REG (0x1188)
+#define EXYNOS5433_TOP_BUS_MIF_SYS_PWR_REG (0x1190)
+#define EXYNOS5433_TOP_RETENTION_MIF_SYS_PWR_REG (0x1194)
+#define EXYNOS5433_TOP_PWR_MIF_SYS_PWR_REG (0x1198)
+#define EXYNOS5433_LOGIC_RESET_SYS_PWR_REG (0x11A0)
+#define EXYNOS5433_OSCCLK_GATE_SYS_PWR_REG (0x11A4)
+#define EXYNOS5433_SLEEP_RESET_SYS_PWR_REG (0x11A8)
+#define EXYNOS5433_LOGIC_RESET_MIF_SYS_PWR_REG (0x11B0)
+#define EXYNOS5433_OSCCLK_GATE_MIF_SYS_PWR_REG (0x11B4)
+#define EXYNOS5433_SLEEP_RESET_MIF_SYS_PWR_REG (0x11B8)
+#define EXYNOS5433_MEMORY_TOP_SYS_PWR_REG (0x11C0)
+#define EXYNOS5433_PAD_RETENTION_LPDDR3_SYS_PWR_REG (0x1200)
+#define EXYNOS5433_PAD_RETENTION_JTAG_SYS_PWR_REG (0x1208)
+#define EXYNOS5433_PAD_RETENTION_TOP_SYS_PWR_REG (0x1220)
+#define EXYNOS5433_PAD_RETENTION_UART_SYS_PWR_REG (0x1224)
+#define EXYNOS5433_PAD_RETENTION_EBIA_SYS_PWR_REG (0x1230)
+#define EXYNOS5433_PAD_RETENTION_EBIB_SYS_PWR_REG (0x1234)
+#define EXYNOS5433_PAD_RETENTION_SPI_SYS_PWR_REG (0x1238)
+#define EXYNOS5433_PAD_RETENTION_MIF_SYS_PWR_REG (0x123C)
+#define EXYNOS5433_PAD_ISOLATION_SYS_PWR_REG (0x1240)
+#define EXYNOS5433_PAD_RETENTION_USBXTI_SYS_PWR_REG (0x1244)
+#define EXYNOS5433_PAD_RETENTION_BOOTLDO_SYS_PWR_REG (0x1248)
+#define EXYNOS5433_PAD_ISOLATION_MIF_SYS_PWR_REG (0x1250)
+#define EXYNOS5433_PAD_RETENTION_FSYSGENIO_SYS_PWR_REG (0x1254)
+#define EXYNOS5433_PAD_ALV_SEL_SYS_PWR_REG (0x1260)
+#define EXYNOS5433_XXTI_SYS_PWR_REG (0x1284)
+#define EXYNOS5433_XXTI26_SYS_PWR_REG (0x1288)
+#define EXYNOS5433_EXT_REGULATOR_SYS_PWR_REG (0x12C0)
+#define EXYNOS5433_GPIO_MODE_SYS_PWR_REG (0x1300)
+#define EXYNOS5433_GPIO_MODE_FSYS0_SYS_PWR_REG (0x1304)
+#define EXYNOS5433_GPIO_MODE_MIF_SYS_PWR_REG (0x1320)
+#define EXYNOS5433_GPIO_MODE_AUD_SYS_PWR_REG (0x1340)
+#define EXYNOS5433_GSCL_SYS_PWR_REG (0x1400)
+#define EXYNOS5433_CAM0_SYS_PWR_REG (0x1404)
+#define EXYNOS5433_MSCL_SYS_PWR_REG (0x1408)
+#define EXYNOS5433_G3D_SYS_PWR_REG (0x140C)
+#define EXYNOS5433_DISP_SYS_PWR_REG (0x1410)
+#define EXYNOS5433_CAM1_SYS_PWR_REG (0x1414)
+#define EXYNOS5433_AUD_SYS_PWR_REG (0x1418)
+#define EXYNOS5433_FSYS_SYS_PWR_REG (0x141C)
+#define EXYNOS5433_BUS2_SYS_PWR_REG (0x1420)
+#define EXYNOS5433_G2D_SYS_PWR_REG (0x1424)
+#define EXYNOS5433_ISP0_SYS_PWR_REG (0x1428)
+#define EXYNOS5433_MFC_SYS_PWR_REG (0x1430)
+#define EXYNOS5433_HEVC_SYS_PWR_REG (0x1438)
+#define EXYNOS5433_RESET_SLEEP_FSYS_SYS_PWR_REG (0x15DC)
+#define EXYNOS5433_RESET_SLEEP_BUS2_SYS_PWR_REG (0x15E0)
+#define EXYNOS5433_ATLAS_CPU0_OPTION (0x2008)
+#define EXYNOS5433_CPU_OPTION(_nr) (EXYNOS5433_ATLAS_CPU0_OPTION + (_nr) * 0x80)
+#define EXYNOS5433_ATLAS_CPU0_DURATION0 (0x2010)
+#define EXYNOS5433_CPU_DURATION(_nr) (EXYNOS5433_ATLAS_CPU0_DURATION0 + (_nr) * 0x80)
+#define EXYNOS5433_ATLAS_NONCPU_OPTION (0x2408)
+#define EXYNOS5433_APOLLO_NONCPU_OPTION (0x2428)
+#define EXYNOS5433_ATLAS_CPUSEQUENCER_OPTION (0x2488)
+#define EXYNOS5433_ATLAS_L2_OPTION (0x2608)
+#define EXYNOS5433_TOP_PWR_MIF_OPTION (0x2CC8)
+#define EXYNOS5433_TOP_PWR_OPTION (0x2C48)
+#define EXYNOS5433_PAD_RETENTION_LPDDR3_OPTION (0x3008)
#define EXYNOS5433_PAD_RETENTION_AUD_OPTION (0x3028)
#define EXYNOS5433_PAD_RETENTION_MMC2_OPTION (0x30C8)
#define EXYNOS5433_PAD_RETENTION_TOP_OPTION (0x3108)
@@ -660,5 +763,50 @@
#define EXYNOS5433_PAD_RETENTION_BOOTLDO_OPTION (0x3248)
#define EXYNOS5433_PAD_RETENTION_UFS_OPTION (0x3268)
#define EXYNOS5433_PAD_RETENTION_FSYSGENIO_OPTION (0x32A8)
+#define EXYNOS5433_PS_HOLD_CONTROL (0x330C)
+#define EXYNOS5433_GSCL_OPTION (0x4008)
+#define EXYNOS5433_CAM0_OPTION (0x4028)
+#define EXYNOS5433_MSCL_OPTION (0x4048)
+#define EXYNOS5433_G3D_OPTION (0x4068)
+#define EXYNOS5433_DISP_OPTION (0x4088)
+#define EXYNOS5433_AUD_OPTION (0x40C8)
+#define EXYNOS5433_FSYS_OPTION (0x40E8)
+#define EXYNOS5433_BUS2_OPTION (0x4108)
+#define EXYNOS5433_G2D_OPTION (0x4128)
+#define EXYNOS5433_ISP_OPTION (0x4148)
+#define EXYNOS5433_MFC_OPTION (0x4188)
+#define EXYNOS5433_HEVC_OPTION (0x41C8)
+
+/* EXYNOS5433_PMU_SPARE0 */
+#define EXYNOS5433_EN_NONRET_RESET (1 << 0)
+
+/* EXYNOS5433_CENTRAL_SEQ_CONFIGURATION */
+#define EXYNOS5433_CENTRALSEQ_PWR_CFG (0x1 << 16)
+
+/* EXYNOS5433_ATLAS_L2_OPTION */
+#define EXYNOS5433_USE_DEACTIVATE_ACE (0x1 << 19)
+#define EXYNOS5433_USE_DEACTIVATE_ACP (0x1 << 18)
+#define EXYNOS5433_USE_AUTO_L2FLUSHREQ (0x1 << 17)
+#define EXYNOS5433_USE_STANDBYWFIL2 (0x1 << 16)
+#define EXYNOS5433_USE_RETENTION (0x1 << 4)
+
+/* EXYNOS5433_CPU_OPTION */
+#define EXYNOS5433_USE_SMPEN (0x1 << 28)
+#define EXYNOS5433_USE_STANDBYWFE (0x1 << 24)
+#define EXYNOS5433_USE_STANDBYWFI (0x1 << 16)
+
+/* EXYNOS5433_PAD_RETENTION_*_OPTION */
+#define EXYNOS5433_INITIATE_WAKEUP_FROM_LOWPOWER (0x1 << 28)
+
+/* EXYNOS5433_CPU_DURATION */
+#define EXYNOS5433_DUR_WAIT_RESET (0xF << 20)
+#define EXYNOS5433_DUR_SCALL (0xF << 4)
+#define EXYNOS5433_DUR_SCALL_VALUE (0x1 << 4)
+
+/* EXYNOS5433_ATLAS_CPUSEQUENCER_OPTION */
+#define EXYNOS5433_SKIP_BLK_PWR_DOWN (0x1 << 8)
+
+/* EXYNOS5433_UP_SCHEDULER */
+#define EXYNOS5433_ENABLE_ATLAS_CPU (0x1 << 0)
#endif /* __LINUX_SOC_EXYNOS_REGS_PMU_H */
--
1.9.1
^ permalink raw reply related
* [RFC PATCH 4/9] soc: samsung: Add generic power-management driver for Exynos
From: Chanwoo Choi @ 2018-01-09 7:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com>
To enter suspend, Exynos SoC requires the some machine dependent procedures.
This patch introduces the generic power-management driver to support
those requirements and generic interface for power state management.
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
arch/arm/mach-exynos/common.h | 1 -
arch/arm/mach-exynos/exynos.c | 23 +----
drivers/soc/samsung/Makefile | 2 +-
drivers/soc/samsung/exynos-pm.c | 176 ++++++++++++++++++++++++++++++++++
include/linux/soc/samsung/exynos-pm.h | 21 ++++
5 files changed, 199 insertions(+), 24 deletions(-)
create mode 100644 drivers/soc/samsung/exynos-pm.c
create mode 100644 include/linux/soc/samsung/exynos-pm.h
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index afbc143a3d5d..ad482c0fc131 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -119,7 +119,6 @@ enum {
* Magic values for bootloader indicating chosen low power mode.
* See also Documentation/arm/Samsung/Bootloader-interface.txt
*/
-#define EXYNOS_SLEEP_MAGIC 0x00000bad
#define EXYNOS_AFTR_MAGIC 0xfcba0d10
void exynos_set_boot_flag(unsigned int cpu, unsigned int mode);
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index fbd108ce8745..0d5265d175c4 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -12,6 +12,7 @@
#include <linux/of_fdt.h>
#include <linux/platform_device.h>
#include <linux/irqchip.h>
+#include <linux/soc/samsung/exynos-pm.h>
#include <linux/soc/samsung/exynos-regs-pmu.h>
#include <asm/cacheflush.h>
@@ -41,28 +42,6 @@
.id = -1,
};
-void __iomem *sysram_base_addr __ro_after_init;
-void __iomem *sysram_ns_base_addr __ro_after_init;
-
-void __init exynos_sysram_init(void)
-{
- struct device_node *node;
-
- for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") {
- if (!of_device_is_available(node))
- continue;
- sysram_base_addr = of_iomap(node, 0);
- break;
- }
-
- for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") {
- if (!of_device_is_available(node))
- continue;
- sysram_ns_base_addr = of_iomap(node, 0);
- break;
- }
-}
-
static void __init exynos_init_late(void)
{
if (of_machine_is_compatible("samsung,exynos5440"))
diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile
index d2e637339a45..58ca5bdabf1f 100644
--- a/drivers/soc/samsung/Makefile
+++ b/drivers/soc/samsung/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o
+obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o exynos-pm.o
obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \
exynos5250-pmu.o exynos5420-pmu.o \
diff --git a/drivers/soc/samsung/exynos-pm.c b/drivers/soc/samsung/exynos-pm.c
new file mode 100644
index 000000000000..45d84bbe5e61
--- /dev/null
+++ b/drivers/soc/samsung/exynos-pm.c
@@ -0,0 +1,176 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// based on arch/arm/mach-exynos/suspend.c
+// Copyright (c) 2018 Samsung Electronics Co., Ltd.
+//
+// Exynos Power Management support driver
+
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/kernel.h>
+#include <linux/regulator/machine.h>
+#include <linux/syscore_ops.h>
+#include <linux/suspend.h>
+
+#include <asm/cpuidle.h>
+#include <asm/io.h>
+#include <asm/suspend.h>
+
+#include <linux/soc/samsung/exynos-pm.h>
+#include <linux/soc/samsung/exynos-pmu.h>
+
+/*
+ * The struct exynos_pm_data contains the callbacks of
+ * both struct platform_suspend_ops and syscore_ops.
+ * This structure is listed according to the call order,
+ * because the callback call order for the two structures is mixed.
+ */
+struct exynos_pm_data {
+ int (*prepare)(void); /* for platform_suspend_ops */
+ int (*suspend)(void); /* for syscore_ops */
+ int (*enter)(suspend_state_t state); /* for platform_suspend_ops */
+ void (*resume)(void); /* for syscore_ops */
+ void (*finish)(void); /* for platform_suspend_ops */
+};
+
+static struct platform_suspend_ops exynos_pm_suspend_ops;
+static struct syscore_ops exynos_pm_syscore_ops;
+static const struct exynos_pm_data *pm_data __ro_after_init;
+
+void __iomem *sysram_base_addr __ro_after_init;
+void __iomem *sysram_ns_base_addr __ro_after_init;
+
+static int exynos_pm_prepare(void)
+{
+ int ret;
+
+ /*
+ * REVISIT: It would be better if struct platform_suspend_ops
+ * .prepare handler get the suspend_state_t as a parameter to
+ * avoid hard-coding the suspend to mem state. It's safe to do
+ * it now only because the suspend_valid_only_mem function is
+ * used as the .valid callback used to check if a given state
+ * is supported by the platform anyways.
+ */
+ ret = regulator_suspend_prepare(PM_SUSPEND_MEM);
+ if (ret) {
+ pr_err("Failed to prepare regulators for suspend (%d)\n", ret);
+ return ret;
+ }
+
+ if (pm_data->prepare) {
+ ret = pm_data->prepare();
+ if (ret) {
+ pr_err("Failed to prepare for suspend (%d)\n", ret);
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
+static int exynos_pm_suspend(void)
+{
+ if (pm_data->suspend)
+ return pm_data->suspend();
+
+ return 0;
+}
+
+static int exynos_pm_enter(suspend_state_t state)
+{
+ int ret;
+
+ exynos_sys_powerdown_conf(SYS_SLEEP);
+
+ ret = pm_data->enter(state);
+ if (ret) {
+ pr_err("Failed to enter sleep\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static void exynos_pm_resume(void)
+{
+ exynos_sys_powerup_conf(SYS_SLEEP);
+
+ if (pm_data->resume)
+ pm_data->resume();
+}
+
+static void exynos_pm_finish(void)
+{
+ int ret;
+
+ ret = regulator_suspend_finish();
+ if (ret)
+ pr_warn("Failed to resume regulators from suspend (%d)\n", ret);
+
+ if (pm_data->finish)
+ pm_data->finish();
+}
+
+/*
+ * Split the data between ARM architectures because it is relatively big
+ * and useless on other arch.
+ */
+#ifdef CONFIG_EXYNOS_PMU_ARM_DRIVERS
+#define exynos_pm_data_arm_ptr(data) (&data)
+#else
+#define exynos_pm_data_arm_ptr(data) NULL
+#endif
+
+static const struct of_device_id exynos_pm_of_device_ids[] = {
+ { /*sentinel*/ },
+};
+
+void __init exynos_sysram_init(void)
+{
+ struct device_node *np;
+
+ for_each_compatible_node(np, NULL, "samsung,exynos4210-sysram") {
+ if (!of_device_is_available(np))
+ continue;
+ sysram_base_addr = of_iomap(np, 0);
+ break;
+ }
+
+ for_each_compatible_node(np, NULL, "samsung,exynos4210-sysram-ns") {
+ if (!of_device_is_available(np))
+ continue;
+ sysram_ns_base_addr = of_iomap(np, 0);
+ break;
+ }
+}
+
+static int __init exynos_pm_init(void)
+{
+ const struct of_device_id *match;
+ struct device_node *np;
+
+ np = of_find_matching_node_and_match(NULL,
+ exynos_pm_of_device_ids, &match);
+ if (!np) {
+ pr_err("Failed to find PMU node for Exynos Power-Management\n");
+ return -ENODEV;
+ }
+ pm_data = (const struct exynos_pm_data *) match->data;
+
+ exynos_sysram_init();
+
+ exynos_pm_suspend_ops.valid = suspend_valid_only_mem;
+ exynos_pm_suspend_ops.prepare = exynos_pm_prepare;
+ exynos_pm_syscore_ops.suspend = exynos_pm_suspend;
+ exynos_pm_suspend_ops.enter = exynos_pm_enter;
+ exynos_pm_syscore_ops.resume = exynos_pm_resume;
+ exynos_pm_suspend_ops.finish = exynos_pm_finish;
+
+ register_syscore_ops(&exynos_pm_syscore_ops);
+ suspend_set_ops(&exynos_pm_suspend_ops);
+
+ return 0;
+}
+postcore_initcall(exynos_pm_init);
diff --git a/include/linux/soc/samsung/exynos-pm.h b/include/linux/soc/samsung/exynos-pm.h
new file mode 100644
index 000000000000..b1afe95ed10c
--- /dev/null
+++ b/include/linux/soc/samsung/exynos-pm.h
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (c) 2018 Samsung Electronics Co., Ltd.
+//
+// Header for Exynos Power-Management support driver
+
+#ifndef __LINUX_SOC_EXYNOS_PM_H
+#define __LINUX_SOC_EXYNOS_PM_H
+
+/*
+ * Magic values for bootloader indicating chosen low power mode.
+ * See also Documentation/arm/Samsung/Bootloader-interface.txt
+ */
+#define EXYNOS_SLEEP_MAGIC 0x00000bad
+
+extern void __iomem *sysram_base_addr;
+extern void __iomem *sysram_ns_base_addr;
+
+extern void exynos_sysram_init(void);
+
+#endif /* __LINUX_SOC_EXYNOS_PMU_H */
--
1.9.1
^ permalink raw reply related
* [RFC PATCH 5/9] soc: samsung: pm: Add support for suspend-to-ram of Exynos5433
From: Chanwoo Choi @ 2018-01-09 7:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com>
This patch adds the specific exynos_pm_data instance for Exynos5433
in order to support the suspend-to-ram. Exynos5433 SoC need to write
the 'cpu_resume' poiter address and the specific magic number
for suspend mode.
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/soc/samsung/exynos-pm.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/drivers/soc/samsung/exynos-pm.c b/drivers/soc/samsung/exynos-pm.c
index 45d84bbe5e61..70d949ba5cab 100644
--- a/drivers/soc/samsung/exynos-pm.c
+++ b/drivers/soc/samsung/exynos-pm.c
@@ -12,6 +12,7 @@
#include <linux/regulator/machine.h>
#include <linux/syscore_ops.h>
#include <linux/suspend.h>
+#include <linux/psci.h>
#include <asm/cpuidle.h>
#include <asm/io.h>
@@ -123,7 +124,44 @@ static void exynos_pm_finish(void)
#define exynos_pm_data_arm_ptr(data) NULL
#endif
+static int exynos5433_pm_suspend(unsigned long unused)
+{
+ /*
+ * Exynos5433 uses PSCI v0.1 which provides the only one
+ * entry point (psci_ops.cpu_suspend) for both cpuidle and
+ * suspend-to-RAM. Also, PSCI v0.1 needs the specific 'power_state'
+ * parameter for the suspend mode. In order to enter suspend mode,
+ * Exynos5433 calls the 'psci_ops.cpu_suspend' with '0x3010000'
+ * power_state parameter.
+ *
+ * '0x3010000' means that both cluster and system are going to enter
+ * the power-down state as following:
+ * - [25:24] 0x3 : Indicate the cluster and system.
+ * - [16] 0x1 : Indicate power-down state.
+ */
+ return psci_ops.cpu_suspend(0x3010000, __pa_symbol(cpu_resume));
+}
+
+static int exynos5433_pm_suspend_enter(suspend_state_t state)
+{
+ if (!sysram_ns_base_addr)
+ return -EINVAL;
+
+ __raw_writel(virt_to_phys(cpu_resume), sysram_ns_base_addr + 0x8);
+ __raw_writel(EXYNOS_SLEEP_MAGIC, sysram_ns_base_addr + 0xc);
+
+ return cpu_suspend(0, exynos5433_pm_suspend);
+}
+
+const struct exynos_pm_data exynos5433_pm_data = {
+ .enter = exynos5433_pm_suspend_enter,
+};
+
static const struct of_device_id exynos_pm_of_device_ids[] = {
+ {
+ .compatible = "samsung,exynos5433-pmu",
+ .data = exynos_pm_data_arm_ptr(exynos5433_pm_data),
+ },
{ /*sentinel*/ },
};
--
1.9.1
^ permalink raw reply related
* [PATCH 6/9] arm64: dts: exynos: Add iRAM device-tree node for Exynos5433
From: Chanwoo Choi @ 2018-01-09 7:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com>
This patch adds the iRAM device-tree node of Exynos5433 which
defines the memory map of iRAM as following and it is used for suspend.
- address: 0x0202_0000 ~ 0x3000_0000
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
arch/arm64/boot/dts/exynos/exynos5433.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
index 62f276970174..77f4321b247c 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
@@ -262,6 +262,20 @@
interrupt-affinity = <&cpu4>, <&cpu5>, <&cpu6>, <&cpu7>;
};
+ sysram at 02020000 {
+ compatible = "mmio-sram";
+ reg = <0x02020000 0x5c000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0 0x02020000 0x5c000>;
+ status = "okay";
+
+ smp-sysram at 5b000 {
+ compatible = "samsung,exynos4210-sysram-ns";
+ reg = <0x5b000 0x1000>;
+ };
+ };
+
chipid at 10000000 {
compatible = "samsung,exynos4210-chipid";
reg = <0x10000000 0x100>;
--
1.9.1
^ permalink raw reply related
* [PATCH 7/9] arm64: dts: exynos: Use power key as a wakeup source on TM2/TM2E board
From: Chanwoo Choi @ 2018-01-09 7:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com>
This patch uses the power-key as a wakeup source from suspend/freeze state.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi b/arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi
index a77462da4a36..26de0add1254 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi
@@ -60,6 +60,7 @@
linux,code = <KEY_POWER>;
label = "power key";
debounce-interval = <10>;
+ wakeup-source;
};
volume-up-key {
--
1.9.1
^ permalink raw reply related
* [PATCH 8/9] arm64: dts: exynos: Add cpu_suspend property of PSCI for exynos5433
From: Chanwoo Choi @ 2018-01-09 7:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com>
The ARM64 Exynos5433 supports PSCI(Power State Coordinate Interface)[1] v0.1.
When PSCI v0.1 is used, the device-tree should contain the specific entry
point such as cpu_suspend. This patch adds the 'cpu_suspend' property
in order to support the cpuidle and suspend execution on Exynos5433 SoC.
The 'cpu_suspend' of psci is originally intended for use in idle subsystems.
Although the cpuidle and suspend-to-RAM framework have separate routine
in order to enter the low-power state, PSCI v0.1 doesn't support
the separate the entry point such as 'system_suspend' on PSCI v1.0.
So, the 'cpu_suspend' of PSCI v0.1 on Exynos5433 is used for both
cpuidle and suspend-to-RAM.
[1] http://infocenter.arm.com/help/topic/com.arm.doc.den0022d/Power_State_Coordination_Interface_PDD_v1_1_DEN0022D.pdf
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
arch/arm64/boot/dts/exynos/exynos5433.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
index 77f4321b247c..0d99ded21202 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
@@ -227,6 +227,7 @@
psci {
compatible = "arm,psci";
method = "smc";
+ cpu_suspend = <0xc4000001>;
cpu_off = <0x84000002>;
cpu_on = <0xC4000003>;
};
--
1.9.1
^ permalink raw reply related
* [PATCH 9/9] arm64: dts: exynos: Add cpu topology information for Exynos5433 SoC
From: Chanwoo Choi @ 2018-01-09 7:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com>
This patch adds the 'cpu-map' for the cpu topology information
of Exynos5433 which has the following two clusters.
- cluster0 contains the four LITTLE cores (cpu0-3).
- cluster1 contains the four big cores (cpu4-7).
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
arch/arm64/boot/dts/exynos/exynos5433.dtsi | 32 ++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
index 0d99ded21202..ea54022f4f44 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
@@ -27,6 +27,38 @@
#address-cells = <1>;
#size-cells = <0>;
+ cpu-map {
+ cluster0 {
+ core0 {
+ cpu = <&cpu0>;
+ };
+ core1 {
+ cpu = <&cpu1>;
+ };
+ core2 {
+ cpu = <&cpu2>;
+ };
+ core3 {
+ cpu = <&cpu3>;
+ };
+ };
+
+ cluster1 {
+ core0 {
+ cpu = <&cpu4>;
+ };
+ core1 {
+ cpu = <&cpu5>;
+ };
+ core2 {
+ cpu = <&cpu6>;
+ };
+ core3 {
+ cpu = <&cpu7>;
+ };
+ };
+ };
+
cpu0: cpu at 100 {
device_type = "cpu";
compatible = "arm,cortex-a53", "arm,armv8";
--
1.9.1
^ permalink raw reply related
* [PATCH v3 2/2] dt-bindings: mailbox: Add Xilinx IPI Mailbox
From: Jassi Brar @ 2018-01-09 8:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515109891-17133-3-git-send-email-jliang@xilinx.com>
On Fri, Jan 5, 2018 at 5:21 AM, Wendy Liang <wendy.liang@xilinx.com> wrote:
> Xilinx ZynqMP IPI(Inter Processor Interrupt) is a hardware block
> in ZynqMP SoC used for the communication between various processor
> systems.
>
> Signed-off-by: Wendy Liang <jliang@xilinx.com>
> ---
> .../bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt | 104 +++++++++++++++++++++
> 1 file changed, 104 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
>
> diff --git a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
> new file mode 100644
> index 0000000..5e270a3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
> @@ -0,0 +1,104 @@
> +Xilinx IPI Mailbox Controller
> +========================================
> +
> +The Xilinx IPI(Inter Processor Interrupt) mailbox controller is to manage
> +messaging between two Xilinx Zynq UltraScale+ MPSoC IPI agents. Each IPI
> +agent owns registers used for notification and buffers for message.
> +
> + +-------------------------------------+
> + | Xilinx ZynqMP IPI Controller |
> + +-------------------------------------+
> + +--------------------------------------------------+
> +ATF | |
> + | |
> + | |
> + +--------------------------+ |
> + | |
> + | |
> + +--------------------------------------------------+
> + +------------------------------------------+
> + | +----------------+ +----------------+ |
> +Hardware | | IPI Agent | | IPI Buffers | |
> + | | Registers | | | |
> + | | | | | |
> + | +----------------+ +----------------+ |
> + | |
> + | Xilinx IPI Agent Block |
> + +------------------------------------------+
> +
> +
> +Controller Device Node:
> +===========================
> +Required properties:
> +--------------------
> +- compatible: Shall be: "xlnx,zynqmp-ipi-mailbox"
> +- reg: IPI buffers address ranges
> +- reg-names: Names of the reg resources. It should have:
> + * local_request_region
> + - IPI request msg buffer written by local and read
> + by remote
> + * local_response_region
> + - IPI response msg buffer written by local and read
> + by remote
> + * remote_request_region
> + - IPI request msg buffer written by remote and read
> + by local
> + * remote_response_region
> + - IPI response msg buffer written by remote and read
> + by local
>
shmem is option and external to the controller. It should be passed
via client's binding.
Please have a look at Sudeep's proposed patch
https://www.spinics.net/lists/arm-kernel/msg626120.html
> +- #mbox-cells: Shall be 1. It contains:
> + * tx(0) or rx(1) channel
> +- xlnx,ipi-ids: Xilinx IPI agent IDs of the two peers of the
> + Xilinx IPI communication channel.
> +- interrupt-parent: Phandle for the interrupt controller
> +- interrupts: Interrupt information corresponding to the
> + interrupt-names property.
> +
> +Optional properties:
> +--------------------
> +- method: The method of accessing the IPI agent registers.
> + Permitted values are: "smc" and "hvc". Default is
> + "smc".
> +
Andre almost implemented the generic driver. Can you please have a
look at https://www.spinics.net/lists/arm-kernel/msg595416.html
and see if you can just finish it off?
Thanks
^ permalink raw reply
* [PATCH v3 0/6] arm: sunxi: IR support for A83T
From: Philipp Rossak @ 2018-01-09 8:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180105145913.ddb5l5dyt7yn3kwc@flea.lan>
On 05.01.2018 15:59, Maxime Ripard wrote:
> Hi,
>
> On Fri, Jan 05, 2018 at 12:02:53PM +0000, Sean Young wrote:
>> On Tue, Dec 19, 2017 at 09:07:41AM +0100, Philipp Rossak wrote:
>>> This patch series adds support for the sunxi A83T ir module and enhances
>>> the sunxi-ir driver. Right now the base clock frequency for the ir driver
>>> is a hard coded define and is set to 8 MHz.
>>> This works for the most common ir receivers. On the Sinovoip Bananapi M3
>>> the ir receiver needs, a 3 MHz base clock frequency to work without
>>> problems with this driver.
>>>
>>> This patch series adds support for an optinal property that makes it able
>>> to override the default base clock frequency and enables the ir interface
>>> on the a83t and the Bananapi M3.
>>>
>>> changes since v2:
>>> * reorder cir pin (alphabetical)
>>> * fix typo in documentation
>>>
>>> changes since v1:
>>> * fix typos, reword Documentation
>>> * initialize 'b_clk_freq' to 'SUNXI_IR_BASE_CLK' & remove if statement
>>> * change dev_info() to dev_dbg()
>>> * change naming to cir* in dts/dtsi
>>> * Added acked Ackedi-by to related patch
>>> * use whole memory block instead of registers needed + fix for h3/h5
>>>
>>> changes since rfc:
>>> * The property is now optinal. If the property is not available in
>>> the dtb the driver uses the default base clock frequency.
>>> * the driver prints out the the selected base clock frequency.
>>> * changed devicetree property from base-clk-frequency to clock-frequency
>>>
>>> Regards,
>>> Philipp
>>>
>>>
>>> Philipp Rossak (6):
>>> media: rc: update sunxi-ir driver to get base clock frequency from
>>> devicetree
>>> media: dt: bindings: Update binding documentation for sunxi IR
>>> controller
>>> arm: dts: sun8i: a83t: Add the cir pin for the A83T
>>> arm: dts: sun8i: a83t: Add support for the cir interface
>>> arm: dts: sun8i: a83t: bananapi-m3: Enable IR controller
>>> arm: dts: sun8i: h3-h8: ir register size should be the whole memory
>>> block
>>
>> I can take this series (through rc-core, i.e. linux-media), but I need an
>> maintainer Acked-by: for the sun[x8]i dts changes (all four patches).
>
> We'll merge them through our tree. We usually have a rather big number
> of patches around, so we'd be better off avoiding conflicts :)
>
> Philipp, can you resubmit the DTs as soon as -rc1 is out?
>
> Thanks!
> Maxime
>
Yes, I can do this!
Regards,
Philipp
^ permalink raw reply
* [PATCH v2 2/2] arm64: Implement branch predictor hardening for Falkor
From: Ard Biesheuvel @ 2018-01-09 8:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1515447068-20977-2-git-send-email-shankerd@codeaurora.org>
On 8 January 2018 at 21:31, Shanker Donthineni <shankerd@codeaurora.org> wrote:
> Falkor is susceptible to branch predictor aliasing and can
> theoretically be attacked by malicious code. This patch
> implements a mitigation for these attacks, preventing any
> malicious entries from affecting other victim contexts.
>
> Signed-off-by: Shanker Donthineni <shankerd@codeaurora.org>
> ---
> Changes since v1:
> Corrected typo to fix the compilation errors if HARDEN_BRANCH_PREDICTOR=n
>
> This patch requires FALKOR MIDR which is available in upstream v4.15-rc7
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm64?h=v4.15-rc7&id=c622cc013cece073722592cff1ac6643a33b1622 ans also
> attached this v2 patch series.
>
> arch/arm64/include/asm/cpucaps.h | 3 ++-
> arch/arm64/include/asm/kvm_asm.h | 2 ++
> arch/arm64/kernel/bpi.S | 8 +++++++
> arch/arm64/kernel/cpu_errata.c | 49 ++++++++++++++++++++++++++++++++++++++--
> arch/arm64/kvm/hyp/entry.S | 12 ++++++++++
> arch/arm64/kvm/hyp/switch.c | 10 ++++++++
> 6 files changed, 81 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
> index 51616e7..7049b48 100644
> --- a/arch/arm64/include/asm/cpucaps.h
> +++ b/arch/arm64/include/asm/cpucaps.h
> @@ -43,7 +43,8 @@
> #define ARM64_SVE 22
> #define ARM64_UNMAP_KERNEL_AT_EL0 23
> #define ARM64_HARDEN_BRANCH_PREDICTOR 24
> +#define ARM64_HARDEN_BP_POST_GUEST_EXIT 25
>
> -#define ARM64_NCAPS 25
> +#define ARM64_NCAPS 26
>
> #endif /* __ASM_CPUCAPS_H */
> diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h
> index ab4d0a9..24961b7 100644
> --- a/arch/arm64/include/asm/kvm_asm.h
> +++ b/arch/arm64/include/asm/kvm_asm.h
> @@ -68,6 +68,8 @@
>
> extern u32 __init_stage2_translation(void);
>
> +extern void __qcom_hyp_sanitize_btac_predictors(void);
> +
> #endif
>
> #endif /* __ARM_KVM_ASM_H__ */
> diff --git a/arch/arm64/kernel/bpi.S b/arch/arm64/kernel/bpi.S
> index 2b10d52..44ffcda 100644
> --- a/arch/arm64/kernel/bpi.S
> +++ b/arch/arm64/kernel/bpi.S
> @@ -77,3 +77,11 @@ ENTRY(__psci_hyp_bp_inval_start)
> ldp x2, x3, [sp], #16
> ldp x0, x1, [sp], #16
> ENTRY(__psci_hyp_bp_inval_end)
> +
> +ENTRY(__qcom_hyp_sanitize_link_stack_start)
> + stp x29, x30, [sp, #-16]!
> + .rept 16
> + bl . + 4
> + .endr
> + ldp x29, x30, [sp], #16
> +ENTRY(__qcom_hyp_sanitize_link_stack_end)
> diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
> index cb0fb37..9ee9d2e 100644
> --- a/arch/arm64/kernel/cpu_errata.c
> +++ b/arch/arm64/kernel/cpu_errata.c
> @@ -54,6 +54,8 @@ static int cpu_enable_trap_ctr_access(void *__unused)
>
> #ifdef CONFIG_KVM
> extern char __psci_hyp_bp_inval_start[], __psci_hyp_bp_inval_end[];
> +extern char __qcom_hyp_sanitize_link_stack_start[];
> +extern char __qcom_hyp_sanitize_link_stack_end[];
>
> static void __copy_hyp_vect_bpi(int slot, const char *hyp_vecs_start,
> const char *hyp_vecs_end)
> @@ -96,8 +98,10 @@ static void __install_bp_hardening_cb(bp_hardening_cb_t fn,
> spin_unlock(&bp_lock);
> }
> #else
> -#define __psci_hyp_bp_inval_start NULL
> -#define __psci_hyp_bp_inval_end NULL
> +#define __psci_hyp_bp_inval_start NULL
> +#define __psci_hyp_bp_inval_end NULL
> +#define __qcom_hyp_sanitize_link_stack_start NULL
> +#define __qcom_hyp_sanitize_link_stack_end NULL
>
> static void __install_bp_hardening_cb(bp_hardening_cb_t fn,
> const char *hyp_vecs_start,
> @@ -138,6 +142,29 @@ static int enable_psci_bp_hardening(void *data)
>
> return 0;
> }
> +
> +static void qcom_link_stack_sanitization(void)
> +{
> + u64 tmp;
> +
> + asm volatile("mov %0, x30 \n"
> + ".rept 16 \n"
> + "bl . + 4 \n"
> + ".endr \n"
> + "mov x30, %0 \n"
> + : "=&r" (tmp));
> +}
> +
Couldn't you just add x30 to the clobber list here?
> +static int qcom_enable_link_stack_sanitization(void *data)
> +{
> + const struct arm64_cpu_capabilities *entry = data;
> +
> + install_bp_hardening_cb(entry, qcom_link_stack_sanitization,
> + __qcom_hyp_sanitize_link_stack_start,
> + __qcom_hyp_sanitize_link_stack_end);
> +
> + return 0;
> +}
> #endif /* CONFIG_HARDEN_BRANCH_PREDICTOR */
>
> #define MIDR_RANGE(model, min, max) \
> @@ -302,6 +329,24 @@ static int enable_psci_bp_hardening(void *data)
> MIDR_ALL_VERSIONS(MIDR_CORTEX_A75),
> .enable = enable_psci_bp_hardening,
> },
> + {
> + .capability = ARM64_HARDEN_BRANCH_PREDICTOR,
> + MIDR_ALL_VERSIONS(MIDR_QCOM_FALKOR_V1),
> + .enable = qcom_enable_link_stack_sanitization,
> + },
> + {
> + .capability = ARM64_HARDEN_BRANCH_PREDICTOR,
> + MIDR_ALL_VERSIONS(MIDR_QCOM_FALKOR),
> + .enable = qcom_enable_link_stack_sanitization,
> + },
> + {
> + .capability = ARM64_HARDEN_BP_POST_GUEST_EXIT,
> + MIDR_ALL_VERSIONS(MIDR_QCOM_FALKOR_V1),
> + },
> + {
> + .capability = ARM64_HARDEN_BP_POST_GUEST_EXIT,
> + MIDR_ALL_VERSIONS(MIDR_QCOM_FALKOR),
> + },
> #endif
> {
> }
> diff --git a/arch/arm64/kvm/hyp/entry.S b/arch/arm64/kvm/hyp/entry.S
> index 12ee62d..9c45c6a 100644
> --- a/arch/arm64/kvm/hyp/entry.S
> +++ b/arch/arm64/kvm/hyp/entry.S
> @@ -196,3 +196,15 @@ alternative_endif
>
> eret
> ENDPROC(__fpsimd_guest_restore)
> +
> +ENTRY(__qcom_hyp_sanitize_btac_predictors)
> + /**
> + * Call SMC64 with Silicon provider serviceID 23<<8 (0xc2001700)
> + * 0xC2000000-0xC200FFFF: assigned to SiP Service Calls
> + * b15-b0: contains SiP functionID
> + */
> + movz x0, #0x1700
> + movk x0, #0xc200, lsl #16
> + smc #0
> + ret
> +ENDPROC(__qcom_hyp_sanitize_btac_predictors)
> diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c
> index 4d273f6..7e37379 100644
> --- a/arch/arm64/kvm/hyp/switch.c
> +++ b/arch/arm64/kvm/hyp/switch.c
> @@ -406,6 +406,16 @@ int __hyp_text __kvm_vcpu_run(struct kvm_vcpu *vcpu)
> /* 0 falls through to be handled out of EL2 */
> }
>
> + if (cpus_have_const_cap(ARM64_HARDEN_BP_POST_GUEST_EXIT)) {
> + u32 midr = read_cpuid_id();
> +
> + /* Apply BTAC predictors mitigation to all Falkor chips */
> + if (((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR) ||
> + ((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR_V1)) {
> + __qcom_hyp_sanitize_btac_predictors();
> + }
> + }
> +
> fp_enabled = __fpsimd_enabled();
>
> __sysreg_save_guest_state(guest_ctxt);
> --
> Qualcomm Datacenter Technologies, Inc. on behalf of the Qualcomm Technologies, Inc.
> Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [PATCH] ARM: imx: Improve the soc revision calculation flow
From: Bai Ping @ 2018-01-09 8:30 UTC (permalink / raw)
To: linux-arm-kernel
On our i.MX6 SOC, the DIGPROG register is used for representing the
SOC ID and silicon revision. The revision has two part: MAJOR and
MINOR. each is represented in 8 bits in the register.
bits [15:8]: reflect the MAJOR part of the revision;
bits [7:0]: reflect the MINOR part of the revision;
In our linux kernel, the soc revision is represented in 8 bits.
MAJOR part and MINOR each occupy 4 bits.
previous method does NOT take care about the MAJOR part in DIGPROG
register. So reformat the revision read from the HW to be compatible
with the revision format used in kernel.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
---
arch/arm/mach-imx/anatop.c | 58 +++++++++++++++++-----------------------------
1 file changed, 21 insertions(+), 37 deletions(-)
diff --git a/arch/arm/mach-imx/anatop.c b/arch/arm/mach-imx/anatop.c
index 649a84c..170cb30 100644
--- a/arch/arm/mach-imx/anatop.c
+++ b/arch/arm/mach-imx/anatop.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013-2015 Freescale Semiconductor, Inc.
+ * Copyright NXP 2017.
*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
@@ -116,6 +117,8 @@ void __init imx_init_revision_from_anatop(void)
unsigned int revision;
u32 digprog;
u16 offset = ANADIG_DIGPROG;
+ u16 major_part, minor_part;
+
np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
anatop_base = of_iomap(np, 0);
@@ -127,45 +130,26 @@ void __init imx_init_revision_from_anatop(void)
digprog = readl_relaxed(anatop_base + offset);
iounmap(anatop_base);
- switch (digprog & 0xff) {
- case 0:
- /*
- * For i.MX6QP, most of the code for i.MX6Q can be resued,
- * so internally, we identify it as i.MX6Q Rev 2.0
- */
- if (digprog >> 8 & 0x01)
- revision = IMX_CHIP_REVISION_2_0;
- else
- revision = IMX_CHIP_REVISION_1_0;
- break;
- case 1:
- revision = IMX_CHIP_REVISION_1_1;
- break;
- case 2:
- revision = IMX_CHIP_REVISION_1_2;
- break;
- case 3:
- revision = IMX_CHIP_REVISION_1_3;
- break;
- case 4:
- revision = IMX_CHIP_REVISION_1_4;
- break;
- case 5:
- /*
- * i.MX6DQ TO1.5 is defined as Rev 1.3 in Data Sheet, marked
- * as 'D' in Part Number last character.
- */
- revision = IMX_CHIP_REVISION_1_5;
- break;
- default:
- /*
- * Fail back to return raw register value instead of 0xff.
- * It will be easy to know version information in SOC if it
- * can't be recognized by known version. And some chip's (i.MX7D)
- * digprog value match linux version format, so it needn't map
- * again and we can use register value directly.
+ /*
+ * On i.MX7D digprog value match linux version format, so
+ * it needn't map again and we can use register value directly.
+ */
+ if (of_device_is_compatible(np, "fsl,imx7d-anatop")) {
+ revision = digprog & 0xff;
+ } else {
+
+ /* MAJOR: [15:8], the major silicon revison;
+ * MINOR: [7: 0], the minor silicon revison;
+ *
+ * please refer to the i.MX RM for the detailed
+ * silicon revison bit define.
+ * format the major part and minor part to match the
+ * linux kernel soc version format.
*/
revision = digprog & 0xff;
+ major_part = (digprog >> 8) & 0xf;
+ minor_part = digprog & 0xf;
+ revision = ((major_part + 1) << 4) | minor_part;
}
mxc_set_cpu_type(digprog >> 16 & 0xff);
--
1.9.1
^ permalink raw reply related
* Hang loading omap_rng on MacchiatoBin with 4.15-rc7
From: Riku Voipio @ 2018-01-09 8:31 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Loading omap_rng module on McBin causes hangup (in about 9/10 times).
Looking at /proc/interrupts it seems the interrupt starts running like
crazy, and after a while the whole system is unresponsive. This with
Debian kernel (everything possible as modules) and EFI as bootloader.
The EFI firmware appears[1] to use the rng unit to provide a seed for
KASRL, I wonder if the driver needs to depend less on the state left
by firmware, or the firmware needs to de-initialize the RNG before
booting.
root at debian:~# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
1: 0 0 0 0 GICv2 25 Level vgic
3: 1268 1983 1175 1139 GICv2 30 Level
arch_timer
4: 0 0 0 0 GICv2 27 Level
kvm guest timer
7: 1956 0 0 0 GICv2 51 Level ttyS0
9: 4472 0 307 0 GICv2 48 Level mmc0
18: 0 0 0 0 pMSI 4096 Edge
f0400000.xor
19: 0 0 0 0 pMSI 6144 Edge
f0420000.xor
20: 0 0 0 0 pMSI 8192 Edge
f0440000.xor
21: 0 0 0 0 pMSI 10240 Edge
f0460000.xor
22: 0 0 0 0 pMSI 12288 Edge
f26a0000.xor
23: 0 0 0 0 pMSI 14336 Edge
f26c0000.xor
24: 0 0 0 0 pMSI 16384 Edge
f46a0000.xor
25: 0 0 0 0 pMSI 18432 Edge
f46c0000.xor
26: 0 0 0 0
f03f0100.interrupt-controller 17 Level arm-pmu
27: 0 0 0 0 ICU.f21e0000 22
Level armada8k-pcie, PCIe PME, aerdrv
72: 13 0 0 0 ICU.f41e0000 40
Level eth2
73: 0 10 0 0 ICU.f41e0000 44
Level eth2
74: 0 0 29 0 ICU.f41e0000 48
Level eth2
75: 0 0 0 45 ICU.f41e0000 52
Level eth2
76: 36 0 0 55 ICU.f41e0000 56
Level eth2
78: 440 0 42 0 ICU.f21e0000 27
Level mmc1
79: 0 0 0 0 ICU.f41e0000 77
Level f4284000.rtc
80: 0 0 0 0 ICU.f21e0000 120
Level mv64xxx_i2c
81: 0 0 0 0 ICU.f21e0000 121
Level mv64xxx_i2c
82: 0 0 0 0 ICU.f21e0000 106
Level xhci-hcd:usb1
83: 0 0 0 0 ICU.f21e0000 105
Level xhci-hcd:usb3
84: 0 0 0 0 ICU.f41e0000 106
Level xhci-hcd:usb5
85: 0 0 0 0 ICU.f21e0000 107
Level ahci[f2540000.sata]
86: 268 0 0 0 ICU.f41e0000 107
Level ahci[f4540000.sata]
IPI0: 2254 2458 1876 1844 Rescheduling interrupts
IPI1: 110 107 299 165 Function call interrupts
IPI2: 0 0 0 0 CPU stop interrupts
IPI3: 0 0 0 0 CPU stop (for
crash dump) interrupts
IPI4: 0 0 0 0 Timer broadcast
interrupts
IPI5: 1 0 0 0 IRQ work interrupts
IPI6: 0 0 0 0 CPU wake-up interrupts
Err: 0
root at debian:~# modprobe omap_rng
root at debian:~# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
1: 0 0 0 0 GICv2 25 Level vgic
3: 1795 2736 1663 1620 GICv2 30 Level
arch_timer
4: 0 0 0 0 GICv2 27 Level
kvm guest timer
7: 2183 0 0 0 GICv2 51 Level ttyS0
9: 4472 0 1759 0 GICv2 48 Level mmc0
18: 0 0 0 0 pMSI 4096 Edge
f0400000.xor
19: 0 0 0 0 pMSI 6144 Edge
f0420000.xor
20: 0 0 0 0 pMSI 8192 Edge
f0440000.xor
21: 0 0 0 0 pMSI 10240 Edge
f0460000.xor
22: 0 0 0 0 pMSI 12288 Edge
f26a0000.xor
23: 0 0 0 0 pMSI 14336 Edge
f26c0000.xor
24: 0 0 0 0 pMSI 16384 Edge
f46a0000.xor
25: 0 0 0 0 pMSI 18432 Edge
f46c0000.xor
26: 0 0 0 0
f03f0100.interrupt-controller 17 Level arm-pmu
27: 0 0 0 0 ICU.f21e0000 22
Level armada8k-pcie, PCIe PME, aerdrv
72: 15 0 0 0 ICU.f41e0000 40
Level eth2
73: 0 11 0 0 ICU.f41e0000 44
Level eth2
74: 0 0 37 0 ICU.f41e0000 48
Level eth2
75: 0 0 0 68 ICU.f41e0000 52
Level eth2
76: 36 0 0 118 ICU.f41e0000 56
Level eth2
78: 440 0 68 0 ICU.f21e0000 27
Level mmc1
79: 0 0 0 0 ICU.f41e0000 77
Level f4284000.rtc
80: 0 0 0 0 ICU.f21e0000 120
Level mv64xxx_i2c
81: 0 0 0 0 ICU.f21e0000 121
Level mv64xxx_i2c
82: 0 0 0 0 ICU.f21e0000 106
Level xhci-hcd:usb1
83: 0 0 0 0 ICU.f21e0000 105
Level xhci-hcd:usb3
84: 0 0 0 0 ICU.f41e0000 106
Level xhci-hcd:usb5
85: 0 0 0 0 ICU.f21e0000 107
Level ahci[f2540000.sata]
86: 268 0 0 0 ICU.f41e0000 107
Level ahci[f4540000.sata]
87: 0 0 0 0 ICU.f21e0000 95
Level f2760000.trng
88: 889660 0 0 0 ICU.f41e0000 95
Level f4760000.trng
IPI0: 2964 2559 2607 1957 Rescheduling interrupts
IPI1: 110 107 299 165 Function call interrupts
IPI2: 0 0 0 0 CPU stop interrupts
IPI3: 0 0 0 0 CPU stop (for
crash dump) interrupts
IPI4: 0 0 0 0 Timer broadcast
interrupts
IPI5: 1 0 0 0 IRQ work interrupts
IPI6: 0 0 0 0 CPU wake-up interrupts
Err: 0
root at debian:~# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
1: 0 0 0 0 GICv2 25 Level vgic
3: 2538 3498 2407 2364 GICv2 30 Level
arch_timer
4: 0 0 0 0 GICv2 27 Level
kvm guest timer
7: 2625 0 0 0 GICv2 51 Level ttyS0
9: 4472 0 1768 0 GICv2 48 Level mmc0
18: 0 0 0 0 pMSI 4096 Edge
f0400000.xor
19: 0 0 0 0 pMSI 6144 Edge
f0420000.xor
20: 0 0 0 0 pMSI 8192 Edge
f0440000.xor
21: 0 0 0 0 pMSI 10240 Edge
f0460000.xor
22: 0 0 0 0 pMSI 12288 Edge
f26a0000.xor
23: 0 0 0 0 pMSI 14336 Edge
f26c0000.xor
24: 0 0 0 0 pMSI 16384 Edge
f46a0000.xor
25: 0 0 0 0 pMSI 18432 Edge
f46c0000.xor
26: 0 0 0 0
f03f0100.interrupt-controller 17 Level arm-pmu
27: 0 0 0 0 ICU.f21e0000 22
Level armada8k-pcie, PCIe PME, aerdrv
72: 15 0 0 0 ICU.f41e0000 40
Level eth2
73: 0 11 0 0 ICU.f41e0000 44
Level eth2
74: 0 0 37 0 ICU.f41e0000 48
Level eth2
75: 0 0 0 68 ICU.f41e0000 52
Level eth2
76: 36 0 0 118 ICU.f41e0000 56
Level eth2
78: 440 0 71 0 ICU.f21e0000 27
Level mmc1
79: 0 0 0 0 ICU.f41e0000 77
Level f4284000.rtc
80: 0 0 0 0 ICU.f21e0000 120
Level mv64xxx_i2c
81: 0 0 0 0 ICU.f21e0000 121
Level mv64xxx_i2c
82: 0 0 0 0 ICU.f21e0000 106
Level xhci-hcd:usb1
83: 0 0 0 0 ICU.f21e0000 105
Level xhci-hcd:usb3
84: 0 0 0 0 ICU.f41e0000 106
Level xhci-hcd:usb5
85: 0 0 0 0 ICU.f21e0000 107
Level ahci[f2540000.sata]
86: 268 0 0 0 ICU.f41e0000 107
Level ahci[f4540000.sata]
87: 0 0 0 0 ICU.f21e0000 95
Level f2760000.trng
88: 2532580 0 0 0 ICU.f41e0000 95
Level f4760000.trng
IPI0: 2964 2562 2640 2001 Rescheduling interrupts
IPI1: 110 107 299 165 Function call interrupts
IPI2: 0 0 0 0 CPU stop interrupts
IPI3: 0 0 0 0 CPU stop (for
crash dump) interrupts
IPI4: 0 0 0 0 Timer broadcast
interrupts
IPI5: 1 0 0 0 IRQ work interrupts
IPI6: 0 0 0 0 CPU wake-up interrupts
[1] https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commit/4a0d8a37247b0da45baf37e1f207ae8737c7254b
Full kernel log:
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd081]
[ 0.000000] Linux version 4.15.0-rc7-arm64
(debian-kernel at lists.debian.org) (gcc version 7.2.0 (Debian 7.2.0-11))
#1 SMP Debian 4.15~rc7-1~exp1 (2018-01-08)
[ 0.000000] Machine model: Marvell 8040 MACHIATOBin
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: EFI v2.60 by EDK II
[ 0.000000] efi: SMBIOS 3.0=0xbfd00000 ACPI 2.0=0xb6760000
MEMATTR=0xb8862018 RNG=0xbffdbf98
[ 0.000000] random: fast init done
[ 0.000000] efi: seeding entropy pool
[ 0.000000] cma: Reserved 64 MiB at 0x00000000bb800000
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem
0x0000000000000000-0x000000013fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x13ffd3980-0x13ffd547f]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000000000-0x00000000ffffffff]
[ 0.000000] Normal [mem 0x0000000100000000-0x000000013fffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000003ffffff]
[ 0.000000] node 0: [mem 0x0000000004200000-0x00000000bf80ffff]
[ 0.000000] node 0: [mem 0x00000000bf810000-0x00000000bfbeffff]
[ 0.000000] node 0: [mem 0x00000000bfbf0000-0x00000000bfc8ffff]
[ 0.000000] node 0: [mem 0x00000000bfc90000-0x00000000bffdffff]
[ 0.000000] node 0: [mem 0x00000000bffe0000-0x00000000bfffffff]
[ 0.000000] node 0: [mem 0x0000000100000000-0x000000013fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000013fffffff]
[ 0.000000] On node 0 totalpages: 1048064
[ 0.000000] DMA zone: 12280 pages used for memmap
[ 0.000000] DMA zone: 0 pages reserved
[ 0.000000] DMA zone: 785920 pages, LIFO batch:31
[ 0.000000] Normal zone: 4096 pages used for memmap
[ 0.000000] Normal zone: 262144 pages, LIFO batch:31
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] percpu: Embedded 24 pages/cpu @ (ptrval) s58904
r8192 d31208 u98304
[ 0.000000] pcpu-alloc: s58904 r8192 d31208 u98304 alloc=24*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Detected PIPT I-cache on CPU0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 1031688
[ 0.000000] Policy zone: Normal
[ 0.000000] Kernel command line:
BOOT_IMAGE=/boot/vmlinuz-4.15.0-rc7-arm64
root=UUID=eac7cb10-f190-4ade-bf79-d1a979e18e8b ro quiet
[ 0.000000] software IO TLB [mem 0xb2700000-0xb6700000] (64MB)
mapped at [ (ptrval)- (ptrval)]
[ 0.000000] Memory: 3948596K/4192256K available (8316K kernel code,
1436K rwdata, 2748K rodata, 4480K init, 600K bss, 178124K reserved,
6553
6K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] modules : 0xffff000000000000 - 0xffff000008000000
( 128 MB)
[ 0.000000] vmalloc : 0xffff000008000000 - 0xffff7dffbfff0000
(129022 GB)
[ 0.000000] .text : 0x (ptrval) - 0x (ptrval)
( 8320 KB)
[ 0.000000] .rodata : 0x (ptrval) - 0x (ptrval)
( 2816 KB)
[ 0.000000] .init : 0x (ptrval) - 0x (ptrval)
( 4480 KB)
[ 0.000000] .data : 0x (ptrval) - 0x (ptrval)
( 1437 KB)
[ 0.000000] .bss : 0x (ptrval) - 0x (ptrval)
( 601 KB)
[ 0.000000] fixed : 0xffff7dfffe7fd000 - 0xffff7dfffec00000
( 4108 KB)
[ 0.000000] PCI I/O : 0xffff7dfffee00000 - 0xffff7dffffe00000
( 16 MB)
[ 0.000000] vmemmap : 0xffff7e0000000000 - 0xffff800000000000
( 2048 GB maximum)
[ 0.000000] 0xffff7f7ac9000000 - 0xffff7f7ace000000
( 80 MB actual)
[ 0.000000] memory : 0xffffdeb240000000 - 0xffffdeb380000000
( 5120 MB)
[ 0.000000] ftrace: allocating 31174 entries in 122 pages
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GIC: Adjusting CPU interface base to 0x00000000f022f000
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] GICv2m: DT overriding V2M MSI_TYPER (base:160, num:32)
[ 0.000000] GICv2m: range[mem 0xf0280000-0xf0280fff], SPI[160:191]
[ 0.000000] GICv2m: DT overriding V2M MSI_TYPER (base:192, num:32)
[ 0.000000] GICv2m: range[mem 0xf0290000-0xf0290fff], SPI[192:223]
[ 0.000000] GICv2m: DT overriding V2M MSI_TYPER (base:224, num:32)
[ 0.000000] GICv2m: range[mem 0xf02a0000-0xf02a0fff], SPI[224:255]
[ 0.000000] GICv2m: DT overriding V2M MSI_TYPER (base:256, num:32)
[ 0.000000] GICv2m: range[mem 0xf02b0000-0xf02b0fff], SPI[256:287]
[ 0.000000] arch_timer: cp15 timer(s) running at 25.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff
max_cycles: 0x5c40939b5, max_idle_ns: 440795202646 ns
[ 0.000002] sched_clock: 56 bits at 25MHz, resolution 40ns, wraps
every 4398046511100ns
[ 0.000320] Console: colour dummy device 80x25
[ 0.000329] console [tty0] enabled
[ 0.000367] Calibrating delay loop (skipped), value calculated
using timer frequency.. 50.00 BogoMIPS (lpj=100000)
[ 0.000373] pid_max: default: 32768 minimum: 301
[ 0.000455] Security Framework initialized
[ 0.000460] Yama: disabled by default; enable with sysctl kernel.yama.*
[ 0.000502] AppArmor: AppArmor initialized
[ 0.001673] Dentry cache hash table entries: 524288 (order: 10,
4194304 bytes)
[ 0.002270] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
[ 0.002318] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.002341] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.003051] ASID allocator initialised with 65536 entries
[ 0.003095] Hierarchical SRCU implementation.
[ 0.004111] Remapping and enabling EFI services.
[ 0.004215] EFI remap 0x00000000bf810000 => (ptrval)
[ 0.004292] EFI remap 0x00000000bfc90000 => (ptrval)
[ 0.004296] EFI remap 0x00000000f4284000 => (ptrval)
[ 0.004299] EFI remap 0x00000000f4700000 => (ptrval)
[ 0.004306] EFI remap 0x00000000f93c0000 => (ptrval)
[ 0.004610] smp: Bringing up secondary CPUs ...
[ 0.005038] Detected PIPT I-cache on CPU1
[ 0.005078] CPU1: Booted secondary processor 0x0000000001 [0x410fd081]
[ 0.005532] Detected PIPT I-cache on CPU2
[ 0.005562] CPU2: Booted secondary processor 0x0000000100 [0x410fd081]
[ 0.006013] Detected PIPT I-cache on CPU3
[ 0.006033] CPU3: Booted secondary processor 0x0000000101 [0x410fd081]
[ 0.006084] smp: Brought up 1 node, 4 CPUs
[ 0.006088] SMP: Total of 4 processors activated.
[ 0.006092] CPU features: detected feature: 32-bit EL0 Support
[ 0.006378] CPU: All CPU(s) started at EL2
[ 0.007024] devtmpfs: initialized
[ 0.009286] Registered cp15_barrier emulation handler
[ 0.009294] Registered setend emulation handler
[ 0.009408] clocksource: jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.009435] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.010231] pinctrl core: initialized pinctrl subsystem
[ 0.010660] SMBIOS 3.0.0 present.
[ 0.010671] DMI: Marvell Armada 8040 MacchiatoBin/Armada 8040
MacchiatoBin, BIOS EDK II Dec 12 2017
[ 0.010837] NET: Registered protocol family 16
[ 0.010997] audit: initializing netlink subsys (disabled)
[ 0.011098] audit: type=2000 audit(0.008:1): state=initialized
audit_enabled=0 res=1
[ 0.011559] cpuidle: using governor ladder
[ 0.011633] cpuidle: using governor menu
[ 0.011803] vdso: 2 pages (1 code @ 0000000000e7c779, 1 data @
000000009a994fe8)
[ 0.011812] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.012428] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.012528] Serial: AMBA PL011 UART driver
[ 0.019355] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.019916] ACPI: Interpreter disabled.
[ 0.020101] vgaarb: loaded
[ 0.020268] EDAC MC: Ver: 3.0.0
[ 0.020437] Registered efivars operations
[ 0.023923] clocksource: Switched to clocksource arch_sys_counter
[ 0.048986] VFS: Disk quotas dquot_6.6.0
[ 0.049027] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.049295] AppArmor: AppArmor Filesystem Enabled
[ 0.049454] pnp: PnP ACPI: disabled
[ 0.053211] NET: Registered protocol family 2
[ 0.053536] TCP established hash table entries: 32768 (order: 6,
262144 bytes)
[ 0.053685] TCP bind hash table entries: 32768 (order: 7, 524288 bytes)
[ 0.053910] TCP: Hash tables configured (established 32768 bind 32768)
[ 0.053982] UDP hash table entries: 2048 (order: 4, 65536 bytes)
[ 0.054008] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes)
[ 0.054127] NET: Registered protocol family 1
[ 0.054142] PCI: CLS 0 bytes, default 128
[ 0.054241] Unpacking initramfs...
[ 0.677482] Freeing initrd memory: 18500K
[ 0.677789] hw perfevents: unable to count PMU IRQs
[ 0.677803] hw perfevents: /ap806/config-space at f0000000/pmu: failed
to register PMU devices!
[ 0.677970] kvm [1]: 8-bit VMID
[ 0.677973] kvm [1]: IDMAP page: 51c54000
[ 0.677975] kvm [1]: HYP VA range: 800000000000:ffffffffffff
[ 0.678466] kvm [1]: vgic-v2 at f0240000
[ 0.678537] kvm [1]: vgic interrupt IRQ1
[ 0.678546] kvm [1]: virtual timer IRQ4
[ 0.678607] kvm [1]: Hyp mode initialized successfully
[ 0.679727] Initialise system trusted keyrings
[ 0.679801] workingset: timestamp_bits=44 max_order=20 bucket_order=0
[ 0.679880] zbud: loaded
[ 1.334003] Key type asymmetric registered
[ 1.334007] Asymmetric key parser 'x509' registered
[ 1.334050] Block layer SCSI generic (bsg) driver version 0.4
loaded (major 246)
[ 1.334123] io scheduler noop registered
[ 1.334125] io scheduler deadline registered
[ 1.334154] io scheduler cfq registered (default)
[ 1.334156] io scheduler mq-deadline registered
[ 1.335649] armada-ap806-pinctrl
f06f4000.system-controller:pinctrl: registered pinctrl driver
[ 1.336054] armada-cp110-pinctrl
f2440000.system-controller:pinctrl: registered pinctrl driver
[ 1.336335] armada-cp110-pinctrl
f4440000.system-controller:pinctrl: registered pinctrl driver
[ 1.340941] mv_xor_v2 f0400000.xor: Marvell Version 2 XOR driver
[ 1.341186] mv_xor_v2 f0420000.xor: Marvell Version 2 XOR driver
[ 1.341461] mv_xor_v2 f0440000.xor: Marvell Version 2 XOR driver
[ 1.341702] mv_xor_v2 f0460000.xor: Marvell Version 2 XOR driver
[ 1.342010] mv_xor_v2 f26a0000.xor: Marvell Version 2 XOR driver
[ 1.342263] mv_xor_v2 f26c0000.xor: Marvell Version 2 XOR driver
[ 1.342652] mv_xor_v2 f46a0000.xor: Marvell Version 2 XOR driver
[ 1.342914] mv_xor_v2 f46c0000.xor: Marvell Version 2 XOR driver
[ 1.343757] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 1.364902] f0512000.serial: ttyS0 at MMIO 0xf0512000 (irq = 7,
base_baud = 12500000) is a 16550A
[ 1.369854] console [ttyS0] enabled
[ 1.370155] Serial: AMBA driver
[ 1.370306] msm_serial: driver initialized
[ 1.370630] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 1.370882] mousedev: PS/2 mouse device common for all mice
[ 1.371155] rtc-efi rtc-efi: rtc core: registered rtc-efi as rtc0
[ 1.371854] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.372409] NET: Registered protocol family 10
[ 1.372782] Segment Routing with IPv6
[ 1.372812] mip6: Mobile IPv6
[ 1.372817] NET: Registered protocol family 17
[ 1.372822] mpls_gso: MPLS GSO support
[ 1.373117] registered taskstats version 1
[ 1.373120] Loading compiled-in X.509 certificates
[ 1.456522] Loaded X.509 cert 'Debian Project: Ben Hutchings:
008a018dca80932630'
[ 1.456573] zswap: loaded using pool lzo/zbud
[ 1.456649] AppArmor: AppArmor sha1 policy hashing enabled
[ 1.456655] ima: No TPM chip found, activating TPM-bypass! (rc=-19)
[ 1.458339] hw perfevents: enabled with armv8_cortex_a72 PMU
driver, 7 counters available
[ 1.458570] OF: PCI: host bridge /cp110-master/pcie at f2600000 ranges:
[ 1.458584] OF: PCI: IO 0xf9000000..0xf900ffff -> 0xf9000000
[ 1.458592] OF: PCI: MEM 0xf6000000..0xf6efffff -> 0xf6000000
[ 2.459125] armada8k-pcie f2600000.pcie: phy link never came up
[ 2.465091] armada8k-pcie f2600000.pcie: Link not up after reconfiguration
[ 2.472079] armada8k-pcie f2600000.pcie: PCI host bridge to bus 0000:00
[ 2.472085] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 2.472090] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
(bus address [0xf9000000-0xf900ffff])
[ 2.472094] pci_bus 0000:00: root bus resource [mem 0xf6000000-0xf6efffff]
[ 2.472113] pci 0000:00:00.0: [11ab:0110] type 01 class 0x060400
[ 2.472138] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
[ 2.472192] pci 0000:00:00.0: supports D1 D2
[ 2.472195] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[ 2.472307] pci 0000:00:00.0: bridge configuration invalid ([bus
00-00]), reconfiguring
[ 2.472365] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[ 2.472383] pci 0000:00:00.0: BAR 0: assigned [mem
0xf6000000-0xf60fffff 64bit]
[ 2.472393] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 2.779832] pcieport 0000:00:00.0: Signaling PME with IRQ 27
[ 2.779895] pcieport 0000:00:00.0: AER enabled with IRQ 27
[ 2.780028] rtc-efi rtc-efi: setting system clock to 2018-05-19
00:53:40 UTC (1526691220)
[ 2.787233] Freeing unused kernel memory: 4480K
[ 2.910988] libphy: Fixed MDIO Bus: probed
[ 2.915788] sdhci: Secure Digital Host Controller Interface driver
[ 2.915792] sdhci: Copyright(c) Pierre Ossman
[ 2.916452] sdhci-pltfm: SDHCI platform and OF driver helper
[ 2.927389] usbcore: registered new interface driver usbfs
[ 2.927421] usbcore: registered new interface driver hub
[ 2.929827] usbcore: registered new device driver usb
[ 2.930648] mvpp2 f2000000.ethernet eth0: Using random mac address
ce:c0:57:1c:27:7c
[ 2.935964] SCSI subsystem initialized
[ 2.936159] libphy: orion_mdio_bus: probed
[ 2.940813] libphy: orion_mdio_bus: probed
[ 2.948693] libata version 3.00 loaded.
[ 2.949269] mmc0: Switching to 3.3V signalling voltage failed
[ 2.951977] mvpp2 f4000000.ethernet eth1: Using random mac address
aa:6b:ec:75:56:b1
[ 2.963178] mvpp2 f4000000.ethernet eth2: Using random mac address
16:4c:90:91:ba:0a
[ 2.964356] armada38x-rtc f4284000.rtc: rtc core: registered
f4284000.rtc as rtc1
[ 2.988065] mmc0: SDHCI controller on f06e0000.sdhci
[f06e0000.sdhci] using ADMA 64-bit
[ 3.011934] mmc1: SDHCI controller on f2780000.sdhci
[f2780000.sdhci] using ADMA 64-bit
[ 3.012770] xhci-hcd f2500000.usb3: xHCI Host Controller
[ 3.012786] xhci-hcd f2500000.usb3: new USB bus registered,
assigned bus number 1
[ 3.013294] xhci-hcd f2500000.usb3: hcc params 0x0a000990 hci
version 0x100 quirks 0x00010010
[ 3.013326] xhci-hcd f2500000.usb3: irq 82, io mem 0xf2500000
[ 3.013525] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 3.013529] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 3.013533] usb usb1: Product: xHCI Host Controller
[ 3.013536] usb usb1: Manufacturer: Linux 4.15.0-rc7-arm64 xhci-hcd
[ 3.013539] usb usb1: SerialNumber: f2500000.usb3
[ 3.013879] hub 1-0:1.0: USB hub found
[ 3.014944] hub 1-0:1.0: 1 port detected
[ 3.015169] xhci-hcd f2500000.usb3: xHCI Host Controller
[ 3.015177] xhci-hcd f2500000.usb3: new USB bus registered,
assigned bus number 2
[ 3.015238] usb usb2: We don't know the algorithms for LPM for this
host, disabling LPM.
[ 3.015309] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[ 3.015314] usb usb2: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 3.015317] usb usb2: Product: xHCI Host Controller
[ 3.015321] usb usb2: Manufacturer: Linux 4.15.0-rc7-arm64 xhci-hcd
[ 3.015324] usb usb2: SerialNumber: f2500000.usb3
[ 3.016118] hub 2-0:1.0: USB hub found
[ 3.016136] hub 2-0:1.0: 1 port detected
[ 3.016465] xhci-hcd f2510000.usb3: xHCI Host Controller
[ 3.016475] xhci-hcd f2510000.usb3: new USB bus registered,
assigned bus number 3
[ 3.016965] xhci-hcd f2510000.usb3: hcc params 0x0a000990 hci
version 0x100 quirks 0x00010010
[ 3.016991] xhci-hcd f2510000.usb3: irq 83, io mem 0xf2510000
[ 3.017155] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002
[ 3.017159] usb usb3: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 3.017162] usb usb3: Product: xHCI Host Controller
[ 3.017165] usb usb3: Manufacturer: Linux 4.15.0-rc7-arm64 xhci-hcd
[ 3.017168] usb usb3: SerialNumber: f2510000.usb3
[ 3.017420] hub 3-0:1.0: USB hub found
[ 3.017443] hub 3-0:1.0: 1 port detected
[ 3.017622] xhci-hcd f2510000.usb3: xHCI Host Controller
[ 3.017629] xhci-hcd f2510000.usb3: new USB bus registered,
assigned bus number 4
[ 3.017675] usb usb4: We don't know the algorithms for LPM for this
host, disabling LPM.
[ 3.017733] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003
[ 3.017737] usb usb4: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 3.017740] usb usb4: Product: xHCI Host Controller
[ 3.017743] usb usb4: Manufacturer: Linux 4.15.0-rc7-arm64 xhci-hcd
[ 3.017746] usb usb4: SerialNumber: f2510000.usb3
[ 3.017970] hub 4-0:1.0: USB hub found
[ 3.017986] hub 4-0:1.0: 1 port detected
[ 3.018421] ahci f2540000.sata: AHCI 0001.0000 32 slots 2 ports 6
Gbps 0x3 impl platform mode
[ 3.018426] ahci f2540000.sata: flags: 64bit ncq sntf led only pmp
fbs pio slum part sxs
[ 3.018492] xhci-hcd f4500000.usb3: xHCI Host Controller
[ 3.018503] xhci-hcd f4500000.usb3: new USB bus registered,
assigned bus number 5
[ 3.019059] xhci-hcd f4500000.usb3: hcc params 0x0a000990 hci
version 0x100 quirks 0x00010010
[ 3.019080] xhci-hcd f4500000.usb3: irq 84, io mem 0xf4500000
[ 3.019263] scsi host0: ahci
[ 3.019312] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002
[ 3.019316] usb usb5: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 3.019319] usb usb5: Product: xHCI Host Controller
[ 3.019323] usb usb5: Manufacturer: Linux 4.15.0-rc7-arm64 xhci-hcd
[ 3.019326] usb usb5: SerialNumber: f4500000.usb3
[ 3.019491] scsi host1: ahci
[ 3.019629] ata1: SATA max UDMA/133 mmio [mem
0xf2540000-0xf256ffff] port 0x100 irq 85
[ 3.019633] ata2: SATA max UDMA/133 mmio [mem
0xf2540000-0xf256ffff] port 0x180 irq 85
[ 3.019642] hub 5-0:1.0: USB hub found
[ 3.019673] hub 5-0:1.0: 1 port detected
[ 3.019858] xhci-hcd f4500000.usb3: xHCI Host Controller
[ 3.019865] xhci-hcd f4500000.usb3: new USB bus registered,
assigned bus number 6
[ 3.019947] usb usb6: We don't know the algorithms for LPM for this
host, disabling LPM.
[ 3.020035] usb usb6: New USB device found, idVendor=1d6b, idProduct=0003
[ 3.020039] usb usb6: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 3.020042] usb usb6: Product: xHCI Host Controller
[ 3.020045] usb usb6: Manufacturer: Linux 4.15.0-rc7-arm64 xhci-hcd
[ 3.020048] usb usb6: SerialNumber: f4500000.usb3
[ 3.020332] hub 6-0:1.0: USB hub found
[ 3.020353] hub 6-0:1.0: 1 port detected
[ 3.020752] ahci f4540000.sata: AHCI 0001.0000 32 slots 2 ports 6
Gbps 0x3 impl platform mode
[ 3.020758] ahci f4540000.sata: flags: 64bit ncq sntf led only pmp
fbs pio slum part sxs
[ 3.026127] scsi host2: ahci
[ 3.026428] scsi host3: ahci
[ 3.026547] ata3: SATA max UDMA/133 mmio [mem
0xf4540000-0xf456ffff] port 0x100 irq 86
[ 3.026551] ata4: SATA max UDMA/133 mmio [mem
0xf4540000-0xf456ffff] port 0x180 irq 86
[ 3.030874] mmc0: new high speed MMC card at address 0001
[ 3.031191] mmcblk0: mmc0:0001 8GME4R 7.28 GiB
[ 3.031331] mmcblk0boot0: mmc0:0001 8GME4R partition 1 4.00 MiB
[ 3.031470] mmcblk0boot1: mmc0:0001 8GME4R partition 2 4.00 MiB
[ 3.031557] mmcblk0rpmb: mmc0:0001 8GME4R partition 3 512 KiB,
chardev (242:0)
[ 3.034350] mmcblk0: p1 p2 p3
[ 3.053903] mmc1: new high speed SDHC card at address 1234
[ 3.054238] mmcblk1: mmc1:1234 SA08G 7.41 GiB
[ 3.055423] mmcblk1: p1 p2
[ 3.334142] ata2: SATA link down (SStatus 0 SControl 300)
[ 3.334175] ata1: SATA link down (SStatus 0 SControl 300)
[ 3.503937] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[ 3.503958] ata4: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 3.504175] ata4.00: supports DRM functions and may not be fully accessible
[ 3.504181] ata4.00: ATA-9: Samsung SSD 850 EVO 500GB, EMT02B6Q, max UDMA/133
[ 3.504185] ata4.00: 976773168 sectors, multi 1: LBA48 NCQ (depth 31/32)
[ 3.505757] ata4.00: supports DRM functions and may not be fully accessible
[ 3.507050] ata4.00: configured for UDMA/133
[ 3.511148] ata3.00: ATA-8: WDC WD20EARS-00J99B0, 80.00A80, max UDMA/133
[ 3.511151] ata3.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[ 3.518179] ata3.00: configured for UDMA/133
[ 3.518433] scsi 2:0:0:0: Direct-Access ATA WDC
WD20EARS-00J 0A80 PQ: 0 ANSI: 5
[ 3.518999] scsi 3:0:0:0: Direct-Access ATA Samsung SSD
850 2B6Q PQ: 0 ANSI: 5
[ 3.524036] sd 2:0:0:0: [sda] 3907029168 512-byte logical blocks:
(2.00 TB/1.82 TiB)
[ 3.524042] sd 2:0:0:0: [sda] 4096-byte physical blocks
[ 3.524084] sd 2:0:0:0: [sda] Write Protect is off
[ 3.524088] sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 3.524133] sd 2:0:0:0: [sda] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[ 3.524326] sd 3:0:0:0: [sdb] 976773168 512-byte logical blocks:
(500 GB/466 GiB)
[ 3.524355] sd 3:0:0:0: [sdb] Write Protect is off
[ 3.524360] sd 3:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[ 3.524410] sd 3:0:0:0: [sdb] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[ 3.525680] sd 3:0:0:0: [sdb] Attached SCSI removable disk
[ 3.540619] sda: sda1 sda2
[ 3.541248] sd 2:0:0:0: [sda] Attached SCSI removable disk
[ 3.815843] mmc0: Switching to 3.3V signalling voltage failed
[ 3.822247] PM: Starting manual resume from disk
[ 3.822515] PM: Image not found (code -22)
[ 3.937618] EXT4-fs (mmcblk0p2): mounted filesystem with ordered
data mode. Opts: (null)
[ 4.308264] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 4.335334] systemd[1]: systemd 236 running in system mode. (+PAM
+AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP
+GCRY
PT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN
default-hierarchy=hybrid)
[ 4.335635] systemd[1]: Detected architecture arm64.
[ 4.339813] systemd[1]: Set hostname to <debian>.
[ 4.475258] systemd-gpt-auto-generator[205]: Failed to dissect:
Input/output error
[ 4.483749] systemd[200]:
/lib/systemd/system-generators/systemd-gpt-auto-generator failed with
error code 1.
[ 4.494976] systemd[1]: File
/lib/systemd/system/systemd-journald.service:35 configures an IP
firewall (IPAddressDeny=any), but the local sy
stem does not support BPF/cgroup based firewalling.
[ 4.494983] systemd[1]: Proceeding WITHOUT firewalling in effect!
(This warning is only shown for the first loaded unit using IP
firewalling
.)
[ 4.561763] systemd[1]: Reached target Remote File Systems.
[ 4.561976] systemd[1]: Started Forward Password Requests to Wall
Directory Watch.
[ 4.562075] systemd[1]: Started Dispatch Password Requests to
Console Directory Watch.
[ 4.562094] systemd[1]: Reached target Paths.
[ 4.624825] EXT4-fs (mmcblk0p2): re-mounted. Opts: errors=remount-ro
[ 4.693929] systemd-journald[217]: Received request to flush
runtime journal from PID 1
[ 4.796241] sbsa-gwdt f0610000.watchdog: Initialized with 10s
timeout @ 25000000 Hz, action=0.
[ 4.811412] EFI Variables Facility v0.08 2004-May-17
[ 4.834118] pstore: using zlib compression
[ 4.837066] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[ 4.844672] pstore: Registered efi as persistent store backend
[ 4.896049] sd 2:0:0:0: Attached scsi generic sg0 type 0
[ 4.896176] sd 3:0:0:0: Attached scsi generic sg1 type 0
[ 4.990475] Adding 3942396k swap on /dev/mmcblk0p3. Priority:-2
extents:1 across:3942396k SSFS
[ 5.284816] audit: type=1400 audit(1526691223.000:2):
apparmor="STATUS" operation="profile_load" profile="unconfined"
name="/usr/bin/man" pi
d=370 comm="apparmor_parser"
[ 5.284825] audit: type=1400 audit(1526691223.000:3):
apparmor="STATUS" operation="profile_load" profile="unconfined"
name="/usr/bin/man//fi
lter" pid=370 comm="apparmor_parser"
[ 5.284831] audit: type=1400 audit(1526691223.000:4):
apparmor="STATUS" operation="profile_load" profile="unconfined"
name="/usr/bin/man//gr
off" pid=370 comm="apparmor_parser"
[ 5.618325] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
[ 5.710874] mmc0: Switching to 3.3V signalling voltage failed
[ 9.796332] mvpp2 f4000000.ethernet eth2: Link is Up - 1Gbps/Full -
flow control off
[ 9.796350] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
[ 9.800076] mmc0: Switching to 3.3V signalling voltage failed
[ 14.052137] mmc0: Switching to 3.3V signalling voltage failed
[ 15.844178] mmc0: Switching to 3.3V signalling voltage failed
[ 21.988130] mmc0: Switching to 3.3V signalling voltage failed
[ 22.050680] mmc0: Switching to 3.3V signalling voltage failed
[ 22.155246] mmc0: Switching to 3.3V signalling voltage failed
[ 22.845074] mmc0: Switching to 3.3V signalling voltage failed
[ 22.917350] mmc0: Switching to 3.3V signalling voltage failed
[ 24.834819] mmc0: Switching to 3.3V signalling voltage failed
[ 26.195699] mmc0: Switching to 3.3V signalling voltage failed
[ 27.876102] mmc0: Switching to 3.3V signalling voltage failed
[ 29.170275] mmc0: Switching to 3.3V signalling voltage failed
[ 34.020058] mmc0: Switching to 3.3V signalling voltage failed
[ 36.570406] mmc0: Switching to 3.3V signalling voltage failed
[ 39.139512] mmc0: Switching to 3.3V signalling voltage failed
[ 40.652720] mmc0: Switching to 3.3V signalling voltage failed
[ 44.772152] mmc0: Switching to 3.3V signalling voltage failed
[ 49.892041] mmc0: Switching to 3.3V signalling voltage failed
[ 50.420898] mmc0: Switching to 3.3V signalling voltage failed
[ 51.938299] random: crng init done
[ 55.012204] mmc0: Switching to 3.3V signalling voltage failed
[ 60.900100] mmc0: Switching to 3.3V signalling voltage failed
[ 67.044040] mmc0: Switching to 3.3V signalling voltage failed
[ 67.231406] mmc0: Switching to 3.3V signalling voltage failed
[ 72.931749] mmc0: Switching to 3.3V signalling voltage failed
[ 75.491437] mmc0: Switching to 3.3V signalling voltage failed
[ 78.819241] mmc0: Switching to 3.3V signalling voltage failed
[ 80.611246] mmc0: Switching to 3.3V signalling voltage failed
[ 84.962989] mmc0: Switching to 3.3V signalling voltage failed
[ 90.330158] mmc0: Switching to 3.3V signalling voltage failed
[ 93.332842] mmc0: Switching to 3.3V signalling voltage failed
[ 93.336740] omap_rng f2760000.trng: Random Number Generator ver. 203b34c
[ 95.970664] mmc0: Switching to 3.3V signalling voltage failed
[ 101.862573] mmc0: Switching to 3.3V signalling voltage failed
[ 106.210610] mmc0: Switching to 3.3V signalling voltage failed
[ 108.002491] mmc0: Switching to 3.3V signalling voltage failed
[ 111.334419] mmc0: Switching to 3.3V signalling voltage failed
[ 113.894416] mmc0: Switching to 3.3V signalling voltage failed
[ 114.330328] INFO: rcu_sched self-detected stall on CPU
[ 114.335500] 0-....: (5249 ticks this GP)
idle=3b6/140000000000002/0 softirq=2065/2065 fqs=1944
[ 114.344325]
[ 114.344327] INFO: rcu_sched detected stalls on CPUs/tasks:
[ 114.344336] 0-....: (5249 ticks this GP)
idle=3b6/140000000000002/0 softirq=2065/2065 fqs=1945
[ 114.344337] (detected by 3, t=5252 jiffies, g=375, c=374, q=836)
[ 114.330328] INFO: rcu_sched self-detected stall on CPU
[ 114.335500] 0-....: (5249 ticks this GP)
idle=3b6/140000000000002/0 softirq=2065/2065 fqs=1944
[ 114.344325]
[ 114.344327] INFO: rcu_sched detected stalls on CPUs/tasks:
[ 114.344336] 0-....: (5249 ticks this GP)
idle=3b6/140000000000002/0 softirq=2065/2065 fqs=1945
[ 114.344337] (detected by 3, t=5252 jiffies, g=375, c=374, q=836)
[ 114.344342] Task dump for CPU 0:
[ 114.344344] modprobe R running task 0 543 486 0x00000022
[ 114.344350] Call trace:
[ 114.344361] __switch_to+0x98/0xb0
[ 114.344367] __setup_irq+0x798/0x7f8
[ 114.366360] (t=5259 jiffies g=375 c=374 q=836)
[ 114.366362] Task dump for CPU 0:
[ 114.366365] modprobe R running task 0 543 486 0x00000022
[ 114.366372] Call trace:
[ 114.366381] dump_backtrace+0x0/0x200
[ 114.366386] show_stack+0x24/0x30
[ 114.366391] sched_show_task+0x174/0x198
[ 114.366394] dump_cpu_task+0x48/0x58
[ 114.366399] rcu_dump_cpu_stacks+0x9c/0xe0
[ 114.366403] rcu_check_callbacks+0x6cc/0x908
[ 114.366406] update_process_times+0x34/0x60
[ 114.366412] tick_sched_handle.isra.5+0x34/0x70
[ 114.366415] tick_sched_timer+0x48/0x98
[ 114.366419] __hrtimer_run_queues+0xdc/0x2b8
[ 114.366422] hrtimer_interrupt+0xa8/0x228
[ 114.366427] arch_timer_handler_phys+0x38/0x58
[ 114.366431] handle_percpu_devid_irq+0x90/0x268
[ 114.366436] generic_handle_irq+0x34/0x50
[ 114.366439] __handle_domain_irq+0x68/0xc0
[ 114.366442] gic_handle_irq+0x60/0xb0
[ 114.366444] el1_irq+0xb0/0x140
[ 114.366447] __do_softirq+0xb0/0x334
[ 114.366451] irq_exit+0xc0/0xf0
[ 114.366454] __handle_domain_irq+0x6c/0xc0
[ 114.366456] gic_handle_irq+0x60/0xb0
[ 114.366459] el1_irq+0xb0/0x140
[ 114.366464] _raw_spin_unlock_irqrestore+0x2c/0x38
[ 114.366467] __setup_irq+0x548/0x7f8
[ 114.366470] request_threaded_irq+0xf0/0x1b0
[ 114.366474] devm_request_threaded_irq+0x80/0xf8
[ 114.366486] omap_rng_probe+0x1f4/0x418 [omap_rng]
[ 114.366491] platform_drv_probe+0x60/0xc0
[ 114.366496] driver_probe_device+0x33c/0x4a0
[ 114.366499] __driver_attach+0xdc/0x128
[ 114.366503] bus_for_each_dev+0x78/0xd8
[ 114.366506] driver_attach+0x30/0x40
[ 114.366510] bus_add_driver+0x218/0x2b8
[ 114.366513] driver_register+0x6c/0x118
[ 114.366516] __platform_driver_register+0x54/0x60
[ 114.366522] omap_rng_driver_init+0x20/0x1000 [omap_rng]
[ 114.366525] do_one_initcall+0x58/0x168
[ 114.366529] do_init_module+0x64/0x1d8
[ 114.366533] load_module.isra.36+0x20e0/0x26a8
[ 114.366537] SyS_finit_module+0x100/0x120
[ 114.366540] el0_svc_naked+0x20/0x24
[ 116.454456] mmc0: Switching to 3.3V signalling voltage failed
[ 120.038421] mmc0: Switching to 3.3V signalling voltage failed
[ 125.922372] mmc0: Switching to 3.3V signalling voltage failed
[ 126.690483] mmc0: Switching to 3.3V signalling voltage failed
[ 131.810396] mmc0: Switching to 3.3V signalling voltage failed
[ 136.934029] mmc0: Switching to 3.3V signalling voltage failed
[ 140.005535] watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [modprobe:543]
[ 140.005535] watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [modprobe:543]
[ 140.012617] Modules linked in: omap_rng(+) rng_core nls_ascii
nls_cp437 vfat fat aes_ce_blk crypto_simd cryptd sg aes_ce_cipher
ghash_ce gf1
28mul sha2_ce shpchp efi_pstore efivars sha256_arm64 sbsa_gwdt sha1_ce
efivarfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2
crc32c_gener
ic fscrypto ecb aes_arm64 sd_mod phy_generic ahci_platform
libahci_platform libahci libata marvell rtc_armada38x xhci_plat_hcd
xhci_hcd scsi_mo
d fixed usbcore i2c_mv64xxx sdhci_xenon_driver sdhci_pltfm sdhci
mvmdio mvpp2 of_mdio fixed_phy phy_mvebu_cp110_comphy libphy
[ 140.012715] CPU: 0 PID: 543 Comm: modprobe Not tainted
4.15.0-rc7-arm64 #1 Debian 4.15~rc7-1~exp1
[ 140.012717] Hardware name: Marvell Armada 8040 MacchiatoBin/Armada
8040 MacchiatoBin, BIOS EDK II Dec 12 2017
[ 140.012721] pstate: 40000005 (nZcv daif -PAN -UAO)
[ 140.012725] pc : __do_softirq+0xb0/0x334
[ 140.012729] lr : irq_exit+0xc0/0xf0
[ 140.012731] sp : ffff000008003ed0
[ 140.012733] x29: ffff000008003ed0 x28: 0000000000000282
[ 140.012739] x27: 0000000000000000 x26: ffff000008004000
[ 140.012744] x25: ffff000008000000 x24: ffff3d049fa31000
[ 140.012749] x23: ffff000009e93770 x22: 0000000000000000
[ 140.012754] x21: 0000000000000000 x20: 0000000000000003
Message from syslogd at debian at Jan 9 09:58:21 ...
kernel:[ 140.005535] watchdog: BUG: soft lockup - CPU#0 stuck for
22s! [modprobe:543]
[ 140.012759] x19: ffff3d049fa31000 x18: 0000000000000014
[ 140.012764] x17: 000000000000000e x16: 0000000000000007
[ 140.012769] x15: 0000000000000001 x14: 0000000000000000
[ 140.012774] x13: 0000000000000033 x12: 0000000000000000
[ 140.012779] x11: ffff3d049f672150 x10: 0000000000000177
[ 140.012784] x9 : ffff3d049f672158 x8 : 0000000000000000
[ 140.012789] x7 : 0000000000000004 x6 : 00000000a6e967d8
[ 140.012794] x5 : 00ffffffffffffff x4 : 00000000ffff362f
[ 140.012799] x3 : ffff3d049fef9980 x2 : 0000a1aee0539000
[ 140.012804] x1 : ffff3d049fef9980 x0 : 0000000000000000
[ 140.012809] Call trace:
[ 140.012813] __do_softirq+0xb0/0x334
[ 140.012816] irq_exit+0xc0/0xf0
[ 140.012819] __handle_domain_irq+0x6c/0xc0
[ 140.012822] gic_handle_irq+0x60/0xb0
[ 140.012824] el1_irq+0xb0/0x140
[ 140.012828] _raw_spin_unlock_irqrestore+0x2c/0x38
[ 140.012831] __setup_irq+0x548/0x7f8
[ 140.012834] request_threaded_irq+0xf0/0x1b0
[ 140.012838] devm_request_threaded_irq+0x80/0xf8
[ 140.012846] omap_rng_probe+0x1f4/0x418 [omap_rng]
[ 140.012849] platform_drv_probe+0x60/0xc0
[ 140.012853] driver_probe_device+0x33c/0x4a0
[ 140.012857] __driver_attach+0xdc/0x128
[ 140.012860] bus_for_each_dev+0x78/0xd8
[ 140.012864] driver_attach+0x30/0x40
[ 140.012867] bus_add_driver+0x218/0x2b8
[ 140.012871] driver_register+0x6c/0x118
[ 140.012874] __platform_driver_register+0x54/0x60
[ 140.012879] omap_rng_driver_init+0x20/0x1000 [omap_rng]
[ 140.012882] do_one_initcall+0x58/0x168
[ 140.012886] do_init_module+0x64/0x1d8
[ 140.012890] load_module.isra.36+0x20e0/0x26a8
[ 140.012894] SyS_finit_module+0x100/0x120
[ 140.012896] el0_svc_naked+0x20/0x24
[ 142.049544] mmc0: Switching to 3.3V signalling voltage failed
^ permalink raw reply
* [PATCH] media: mtk-vcodec: Always signal source change event on format change
From: Tomasz Figa @ 2018-01-09 8:42 UTC (permalink / raw)
To: linux-arm-kernel
Currently the driver signals the source change event only in case of
a midstream resolution change, however the initial format detection
is also defined as a source change by the V4L2 codec API specification.
Fix this by signaling the event after the initial header is parsed as
well.
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
---
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
index 843510979ad8..86f0a7134365 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
@@ -1224,6 +1224,8 @@ static void vb2ops_vdec_buf_queue(struct vb2_buffer *vb)
ctx->dpb_size = dpbsize;
ctx->state = MTK_STATE_HEADER;
mtk_v4l2_debug(1, "[%d] dpbsize=%d", ctx->id, ctx->dpb_size);
+
+ mtk_vdec_queue_res_chg_event(ctx);
}
static void vb2ops_vdec_buf_finish(struct vb2_buffer *vb)
--
2.16.0.rc0.223.g4a4ac83678-goog
^ permalink raw reply related
* [PATCH] media: mtk-vcodec: Always signal source change event on format change
From: Wu-Cheng Li (李務誠) @ 2018-01-09 8:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180109084247.104601-1-tfiga@chromium.org>
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>
On Tue, Jan 9, 2018 at 4:42 PM, Tomasz Figa <tfiga@chromium.org> wrote:
> Currently the driver signals the source change event only in case of
> a midstream resolution change, however the initial format detection
> is also defined as a source change by the V4L2 codec API specification.
> Fix this by signaling the event after the initial header is parsed as
> well.
>
> Signed-off-by: Tomasz Figa <tfiga@chromium.org>
> ---
> drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
> index 843510979ad8..86f0a7134365 100644
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
> @@ -1224,6 +1224,8 @@ static void vb2ops_vdec_buf_queue(struct vb2_buffer *vb)
> ctx->dpb_size = dpbsize;
> ctx->state = MTK_STATE_HEADER;
> mtk_v4l2_debug(1, "[%d] dpbsize=%d", ctx->id, ctx->dpb_size);
> +
> + mtk_vdec_queue_res_chg_event(ctx);
> }
>
> static void vb2ops_vdec_buf_finish(struct vb2_buffer *vb)
> --
> 2.16.0.rc0.223.g4a4ac83678-goog
>
^ permalink raw reply
* [PATCH net-next v3 0/4] net: mvpp2: 1000BaseX and 2500BaseX support
From: Antoine Tenart @ 2018-01-09 8:59 UTC (permalink / raw)
To: linux-arm-kernel
Hi all,
This series adds 1000BaseX and 2500BaseX support to the Marvell PPv2
driver. In order to use it, the 2.5 SGMII mode is added in the Marvell
common PHY driver (cp110-comphy).
This was tested on a mcbin.
All patches should probably go through net-next as patch 4/4 depends on
patch 1/4 to build and work.
Please note the two mvpp2 patches do not conflict with the ACPI series
v2 Marcin sent a few days ago, and the two series can be processed in
parallel. (Marcin is aware of me sending this series).
Thanks!
Antoine
Since v2:
- Added a comment before mvpp22_comphy_init() about the different PHY modes
used and why they differ between the PPv2 driver and the COMPHY one.
Since v1:
- s/PHY_MODE_SGMII_2_5G/PHY_MODE_2500SGMII/
- Fixed a build error in 'net: mvpp2: 1000baseX support' (which was solved in
the 2500baseX support one, but the bisection was broken).
- Removed the dt patches, as the fourth network interface on the mcbin also
needs PHYLINK support in the PPv2 driver to be correctly supported.
Antoine Tenart (4):
phy: add 2.5G SGMII mode to the phy_mode enum
phy: cp110-comphy: 2.5G SGMII mode
net: mvpp2: 1000baseX support
net: mvpp2: 2500baseX support
drivers/net/ethernet/marvell/mvpp2.c | 77 ++++++++++++++++++++++++----
drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 17 ++++--
include/linux/phy/phy.h | 1 +
3 files changed, 82 insertions(+), 13 deletions(-)
--
2.14.3
^ permalink raw reply
* [PATCH net-next v3 1/4] phy: add 2.5G SGMII mode to the phy_mode enum
From: Antoine Tenart @ 2018-01-09 8:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180109085945.11916-1-antoine.tenart@free-electrons.com>
This patch adds one more generic PHY mode to the phy_mode enum, to allow
configuring generic PHYs to the 2.5G SGMII mode by using the set_mode
callback.
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
include/linux/phy/phy.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 4f8423a948d5..5a80e9de3686 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -28,6 +28,7 @@ enum phy_mode {
PHY_MODE_USB_DEVICE,
PHY_MODE_USB_OTG,
PHY_MODE_SGMII,
+ PHY_MODE_2500SGMII,
PHY_MODE_10GKR,
PHY_MODE_UFS_HS_A,
PHY_MODE_UFS_HS_B,
--
2.14.3
^ permalink raw reply related
* [PATCH net-next v3 2/4] phy: cp110-comphy: 2.5G SGMII mode
From: Antoine Tenart @ 2018-01-09 8:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180109085945.11916-1-antoine.tenart@free-electrons.com>
This patch allow the CP100 comphy to configure some lanes in the
2.5G SGMII mode. This mode is quite close to SGMII and uses nearly the
same code path.
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
index a0d522154cdf..4ef429250d7b 100644
--- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
+++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
@@ -135,19 +135,25 @@ struct mvebu_comhy_conf {
static const struct mvebu_comhy_conf mvebu_comphy_cp110_modes[] = {
/* lane 0 */
MVEBU_COMPHY_CONF(0, 1, PHY_MODE_SGMII, 0x1),
+ MVEBU_COMPHY_CONF(0, 1, PHY_MODE_2500SGMII, 0x1),
/* lane 1 */
MVEBU_COMPHY_CONF(1, 2, PHY_MODE_SGMII, 0x1),
+ MVEBU_COMPHY_CONF(1, 2, PHY_MODE_2500SGMII, 0x1),
/* lane 2 */
MVEBU_COMPHY_CONF(2, 0, PHY_MODE_SGMII, 0x1),
+ MVEBU_COMPHY_CONF(2, 0, PHY_MODE_2500SGMII, 0x1),
MVEBU_COMPHY_CONF(2, 0, PHY_MODE_10GKR, 0x1),
/* lane 3 */
MVEBU_COMPHY_CONF(3, 1, PHY_MODE_SGMII, 0x2),
+ MVEBU_COMPHY_CONF(3, 1, PHY_MODE_2500SGMII, 0x2),
/* lane 4 */
MVEBU_COMPHY_CONF(4, 0, PHY_MODE_SGMII, 0x2),
+ MVEBU_COMPHY_CONF(4, 0, PHY_MODE_2500SGMII, 0x2),
MVEBU_COMPHY_CONF(4, 0, PHY_MODE_10GKR, 0x2),
MVEBU_COMPHY_CONF(4, 1, PHY_MODE_SGMII, 0x1),
/* lane 5 */
MVEBU_COMPHY_CONF(5, 2, PHY_MODE_SGMII, 0x1),
+ MVEBU_COMPHY_CONF(5, 2, PHY_MODE_2500SGMII, 0x1),
};
struct mvebu_comphy_priv {
@@ -206,6 +212,10 @@ static void mvebu_comphy_ethernet_init_reset(struct mvebu_comphy_lane *lane,
if (mode == PHY_MODE_10GKR)
val |= MVEBU_COMPHY_SERDES_CFG0_GEN_RX(0xe) |
MVEBU_COMPHY_SERDES_CFG0_GEN_TX(0xe);
+ else if (mode == PHY_MODE_2500SGMII)
+ val |= MVEBU_COMPHY_SERDES_CFG0_GEN_RX(0x8) |
+ MVEBU_COMPHY_SERDES_CFG0_GEN_TX(0x8) |
+ MVEBU_COMPHY_SERDES_CFG0_HALF_BUS;
else if (mode == PHY_MODE_SGMII)
val |= MVEBU_COMPHY_SERDES_CFG0_GEN_RX(0x6) |
MVEBU_COMPHY_SERDES_CFG0_GEN_TX(0x6) |
@@ -296,13 +306,13 @@ static int mvebu_comphy_init_plls(struct mvebu_comphy_lane *lane,
return 0;
}
-static int mvebu_comphy_set_mode_sgmii(struct phy *phy)
+static int mvebu_comphy_set_mode_sgmii(struct phy *phy, enum phy_mode mode)
{
struct mvebu_comphy_lane *lane = phy_get_drvdata(phy);
struct mvebu_comphy_priv *priv = lane->priv;
u32 val;
- mvebu_comphy_ethernet_init_reset(lane, PHY_MODE_SGMII);
+ mvebu_comphy_ethernet_init_reset(lane, mode);
val = readl(priv->base + MVEBU_COMPHY_RX_CTRL1(lane->id));
val &= ~MVEBU_COMPHY_RX_CTRL1_CLK8T_EN;
@@ -487,7 +497,8 @@ static int mvebu_comphy_power_on(struct phy *phy)
switch (lane->mode) {
case PHY_MODE_SGMII:
- ret = mvebu_comphy_set_mode_sgmii(phy);
+ case PHY_MODE_2500SGMII:
+ ret = mvebu_comphy_set_mode_sgmii(phy, lane->mode);
break;
case PHY_MODE_10GKR:
ret = mvebu_comphy_set_mode_10gkr(phy);
--
2.14.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox