ARM: da850: new drivers for better LCDC support
Subsystems (2)
cover ARM: da850: new drivers for better LCDC support
This series adds two new drivers in order to better support the LCDC rev1 present on the da850 boards.
The first patch adds a new memory driver which allows to write to the DDR2/mDDR memory controller present on the da8xx SoCs. Since the memory controller region is not mapped by anyone else, I went with platform_get_resource() and ioremap() approach.
The second patch adds a new bus driver which allows to interact with the MSTPRI registers of the SYSCFG0 module. The SYSCFG0 registers are used by many drivers, hence the syscon/regmap approach.
As is mentioned in the comments: we don't want to commit to supporting stable interfaces (DT bindings or sysfs attributes) so we hardcode the settings required by some boards (for now only da850-lcdk) with the hope that linux gets an appropriate framework for performance knobs in the future.
Potential extensions of these drivers should be straightforward in the future.
Tested on a da850-lcdk with a display connected over VGA and some additional work on the tilcdc driver.
NOTE I'm sending this as v1, but it's a follow-up to a series I sent previously and the RFC with the ddrctl driver. I dropped the dt patch for now.
Bartosz Golaszewski (2):
ARM: memory: da8xx-ddrctl: new driver
ARM: bus: da8xx-mstpri: new driver
.../devicetree/bindings/bus/ti,da850-mstpri.txt | 20 ++ .../memory-controllers/ti-da8xx-ddrctl.txt | 20 ++ drivers/bus/Kconfig | 9 + drivers/bus/Makefile | 2 + drivers/bus/da8xx-mstpri.c | 266 +++++++++++++++++++++ drivers/memory/Kconfig | 8 + drivers/memory/Makefile | 1 + drivers/memory/da8xx-ddrctl.c | 175 ++++++++++++++ 8 files changed, 501 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt create mode 100644 Documentation/devicetree/bindings/memory-controllers/ti-da8xx-ddrctl.txt create mode 100644 drivers/bus/da8xx-mstpri.c create mode 100644 drivers/memory/da8xx-ddrctl.c
Signature · 1 line
2.9.3
PATCH 1/2 ARM: memory: da8xx-ddrctl: new driver
Create a new driver for the da8xx DDR2/mDDR controller and implement support for writing to the Peripheral Bus Burst Priority Register.
--- .../memory-controllers/ti-da8xx-ddrctl.txt | 20 +++ drivers/memory/Kconfig | 8 + drivers/memory/Makefile | 1 + drivers/memory/da8xx-ddrctl.c | 175 +++++++++++++++++++++ 4 files changed, 204 insertions(+) create mode 100644 Documentation/devicetree/bindings/memory-controllers/ti-da8xx-ddrctl.txt create mode 100644 drivers/memory/da8xx-ddrctl.c
Documentation/devicetree/bindings/memory-controllers/ti-da8xx-ddrctl.txt new file +20 -0
@@ -0,0 +1,20 @@ +* Device tree bindings for Texas Instruments da8xx DDR2/mDDR memory controller + +The DDR2/mDDR memory controller present on Texas Instruments da8xx SoCs features +a set of registers which allow to tweak the controller's behavior. + +Documentation: +OMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh82c/spruh82c.pdf + +Required properties: + +- compatible: "ti,da850-ddr-controller" - for da850 SoC based boards +- reg: a tuple containing the base address of the memory + controller and the size of the memory area to map + +Example for da850 shown below. + +ddrctl { + compatible = "ti,da850-ddr-controller"; + reg = <0xB0000000 0x100>; +};
drivers/memory/Kconfig +8 -0
@@ -134,6 +134,14 @@ config MTK_SMI mainly help enable/disable iommu and control the power domain and clocks for each local arbiter. +config DA8XX_DDRCTL + bool "Texas Instruments da8xx DDR2/mDDR driver" + depends on ARCH_DAVINCI_DA8XX + help + This driver is for the DDR2/mDDR Memory Controller present on + Texas Instruments da8xx SoCs. It's used to tweak various memory + controller configuration options. + source "drivers/memory/samsung/Kconfig" source "drivers/memory/tegra/Kconfig"
drivers/memory/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_MVEBU_DEVBUS) += mvebu-devbus.o obj-$(CONFIG_TEGRA20_MC) += tegra20-mc.o obj-$(CONFIG_JZ4780_NEMC) += jz4780-nemc.o obj-$(CONFIG_MTK_SMI) += mtk-smi.o +obj-$(CONFIG_DA8XX_DDRCTL) += da8xx-ddrctl.o obj-$(CONFIG_SAMSUNG_MC) += samsung/ obj-$(CONFIG_TEGRA_MC) += tegra/
drivers/memory/da8xx-ddrctl.c new file +175 -0
175 lines not on this page · raw message
Signature · 1 line
2.9.3
PATCH 2/2 ARM: bus: da8xx-mstpri: new driver
In reply to Bartosz GolaszewskiCreate the driver for the da8xx master peripheral priority configuration and implement support for writing to the three Master Priority registers on da850 SoCs.
--- .../devicetree/bindings/bus/ti,da850-mstpri.txt | 20 ++ drivers/bus/Kconfig | 9 + drivers/bus/Makefile | 2 + drivers/bus/da8xx-mstpri.c | 266 +++++++++++++++++++++ 4 files changed, 297 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt create mode 100644 drivers/bus/da8xx-mstpri.c
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +20 -0
@@ -0,0 +1,20 @@ +* Device tree bindings for Texas Instruments da8xx master peripheral + priority driver + +DA8XX SoCs feature a set of registers allowing to change the priority of all +peripherals classified as masters. + +Documentation: +OMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh82c/spruh82c.pdf + +Required properties: + +- compatible: "ti,da850-mstpri", "syscon" - for da850 based boards +- reg: offset and length of the mstpri registers + +Example for da850-lcdk is shown below. + +mstpri { + compatible = "ti,da850-mstpri"; + reg = <0x14110 0x0c>; +};
drivers/bus/Kconfig +9 -0
@@ -166,4 +166,13 @@ config VEXPRESS_CONFIG help Platform configuration infrastructure for the ARM Ltd. Versatile Express. + +config DA8XX_MSTPRI + bool "TI da8xx master peripheral priority driver" + depends on ARCH_DAVINCI_DA8XX + help + Driver for Texas Instruments da8xx master peripheral priority + configuration. Allows to adjust the priorities of all master + peripherals. + endmenu
drivers/bus/Makefile +2 -0
@@ -21,3 +21,5 @@ obj-$(CONFIG_SIMPLE_PM_BUS) += simple-pm-bus.o obj-$(CONFIG_TEGRA_ACONNECT) += tegra-aconnect.o obj-$(CONFIG_UNIPHIER_SYSTEM_BUS) += uniphier-system-bus.o obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress-config.o + +obj-$(CONFIG_DA8XX_MSTPRI) += da8xx-mstpri.o
drivers/bus/da8xx-mstpri.c new file +266 -0
266 lines not on this page · raw message
Signature · 1 line
2.9.3
Re: [PATCH 1/2] ARM: memory: da8xx-ddrctl: new driver
In reply to Bartosz GolaszewskiQuoted 4 lines · Bartosz Golaszewski
Create a new driver for the da8xx DDR2/mDDR controller and implement support for writing to the Peripheral Bus Burst Priority Register.
[...]
drivers/memory/da8xx-ddrctl.c line 140
Quoted 9 lines
drivers/memory/da8xx-ddrctl.c new file +9
-0+for (; setting->name; setting++) { + knob =da8xx_ddrctl_match_knob (setting); +if (!knob) { +dev_warn (dev, +"no such config option: %s\n" , setting->name); +continue ; + } + +if (knob->reg > (res->end - res->start -sizeof (u32))) {
Why the "- sizeof(u32)"? Shouldn't this just be resource_size(res)? (c.f. linux/ioport.h)
drivers/memory/da8xx-ddrctl.c line 153
Quoted 13 lines
drivers/memory/da8xx-ddrctl.c new file +13
-0+dev_warn (dev, +"register offset of '%s' exceeds mapped memory size\n" , + knob->name); +continue ; + } + + reg =__raw_readl (ddrctl + knob->reg); + reg &= knob->mask; + reg |= setting->val << knob->shift; + +dev_dbg (dev,"writing 0x%08x to %s\n" , reg, setting->name); + +__raw_writel (reg, ddrctl + knob->reg);
Can you use the normal readl/writel here? Or explain why the raw ones are needed?
drivers/memory/da8xx-ddrctl.c line 158
Quoted 5 lines
drivers/memory/da8xx-ddrctl.c new file +5
-0+ } + +return 0 ; +} +
Otherwise, looks good to me. With the changes above, feel free to add
Kevin
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] ARM: memory: da8xx-ddrctl: new driver
In reply to Bartosz GolaszewskiQuoted 6 lines · Bartosz Golaszewski
Create a new driver for the da8xx DDR2/mDDR controller and implement support for writing to the Peripheral Bus Burst Priority Register.
Signed-off-by Bartosz Golaszewski <[email protected]>--- .../memory-controllers/ti-da8xx-ddrctl.txt | 20 +++
Quoted 6 lines
drivers/memory/Kconfig | 8 + drivers/memory/Makefile | 1 + drivers/memory/da8xx-ddrctl.c | 175 +++++++++++++++++++++ 4 files changed, 204 insertions(+) create mode 100644 Documentation/devicetree/bindings/memory-controllers/ti-da8xx-ddrctl.txt create mode 100644 drivers/memory/da8xx-ddrctl.c
Rob Herring
maintainerRe: [PATCH 2/2] ARM: bus: da8xx-mstpri: new driver
In reply to Bartosz GolaszewskiQuoted 22 lines · Bartosz Golaszewski
Create the driver for the da8xx master peripheral priority configuration and implement support for writing to the three Master Priority registers on da850 SoCs.
Signed-off-by Bartosz Golaszewski <[email protected]>--- .../devicetree/bindings/bus/ti,da850-mstpri.txt | 20 ++ drivers/bus/Kconfig | 9 + drivers/bus/Makefile | 2 + drivers/bus/da8xx-mstpri.c | 266 +++++++++++++++++++++ 4 files changed, 297 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt create mode 100644 drivers/bus/da8xx-mstpri.cDocumentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +2
-0@@ -0,0 +1,20 @@ +* Device tree bindings for Texas Instruments da8xx master peripheral + priority driver
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt line 12
Quoted 10 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +10
-0+ +DA8XX SoCs feature a set of registers allowing to change the priority of all +peripherals classified as masters. + +Documentation: +OMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh82c/spruh82c.pdf + +Required properties: + +- compatible: "ti,da850-mstpri", "syscon" - for da850 based boards
Drop syscon. Doesn't look like it is needed and the example doesn't match.
Quoted 8 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +8
-0+- reg: offset and length of the mstpri registers + +Example for da850-lcdk is shown below. + +mstpri { + compatible = "ti,da850-mstpri"; + reg = <0x14110 0x0c>; +};
Re: [PATCH 2/2] ARM: bus: da8xx-mstpri: new driver
2016-10-31 5:30 GMT+01:00 Rob Herring <[email protected]>:
Quoted 28 lines · Bartosz Golaszewski
Quoted 27 lines
Create the driver for the da8xx master peripheral priority configuration and implement support for writing to the three Master Priority registers on da850 SoCs.
Signed-off-by Bartosz Golaszewski <[email protected]>--- .../devicetree/bindings/bus/ti,da850-mstpri.txt | 20 ++ drivers/bus/Kconfig | 9 + drivers/bus/Makefile | 2 + drivers/bus/da8xx-mstpri.c | 266 +++++++++++++++++++++ 4 files changed, 297 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt create mode 100644 drivers/bus/da8xx-mstpri.cDocumentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +7
-0@@ -0,0 +1,20 @@ +* Device tree bindings for Texas Instruments da8xx master peripheral + priority driver + +DA8XX SoCs feature a set of registers allowing to change the priority of all +peripherals classified as masters. + +Documentation:
Quoted 8 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt line 12
Quoted 5 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +5
-0+OMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh82c/spruh82c.pdf + +Required properties: + +- compatible: "ti,da850-mstpri", "syscon" - for da850 based boardsDrop syscon. Doesn't look like it is needed and the example doesn't match.
Hi Rob,
it is needed: syscon_regmap_lookup_by_compatible() fails without it. I fixed the example instead.
Thanks,
Bartosz Golaszewski
Re: [PATCH 2/2] ARM: bus: da8xx-mstpri: new driver
Hi Bartosz,
Quoted 38 lines · Bartosz Golaszewski
2016-10-31 5:30 GMT+01:00 Rob Herring <[email protected]>:
Quoted 28 lines · Bartosz Golaszewski
Quoted 27 lines
Create the driver for the da8xx master peripheral priority configuration and implement support for writing to the three Master Priority registers on da850 SoCs.
--- .../devicetree/bindings/bus/ti,da850-mstpri.txt | 20 ++ drivers/bus/Kconfig | 9 + drivers/bus/Makefile | 2 + drivers/bus/da8xx-mstpri.c | 266 +++++++++++++++++++++ 4 files changed, 297 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt create mode 100644 drivers/bus/da8xx-mstpri.cDocumentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +7
-0@@ -0,0 +1,20 @@ +* Device tree bindings for Texas Instruments da8xx master peripheral + priority driver + +DA8XX SoCs feature a set of registers allowing to change the priority of all +peripherals classified as masters. + +Documentation:Quoted 8 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt line 12
Quoted 5 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +5
-0+OMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh82c/spruh82c.pdf + +Required properties: + +- compatible: "ti,da850-mstpri", "syscon" - for da850 based boardsDrop syscon. Doesn't look like it is needed and the example doesn't match.
Quoted 4 lines
Hi Rob,
it is needed:
syscon_regmap_lookup_by_compatible()fails without it. I fixed the example instead.
Why are master priority registers under syscon? This driver should be the only entity touching them. So do we need an MFD driver?
Thanks,
Sekhar
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] ARM: bus: da8xx-mstpri: new driver
2016-10-31 10:52 GMT+01:00 Sekhar Nori <[email protected]>:
Quoted 41 lines
Hi Bartosz,
Quoted 38 lines · Bartosz Golaszewski
2016-10-31 5:30 GMT+01:00 Rob Herring <[email protected]>:
Quoted 36 lines · Bartosz Golaszewski
Quoted 22 lines
Create the driver for the da8xx master peripheral priority configuration and implement support for writing to the three Master Priority registers on da850 SoCs.
Signed-off-by Bartosz Golaszewski <[email protected]>--- .../devicetree/bindings/bus/ti,da850-mstpri.txt | 20 ++ drivers/bus/Kconfig | 9 + drivers/bus/Makefile | 2 + drivers/bus/da8xx-mstpri.c | 266 +++++++++++++++++++++ 4 files changed, 297 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt create mode 100644 drivers/bus/da8xx-mstpri.cDocumentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +2
-0@@ -0,0 +1,20 @@ +* Device tree bindings for Texas Instruments da8xx master peripheral + priority driverDocumentation/devicetree/bindings/bus/ti,da850-mstpri.txt line 12
Quoted 10 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +10
-0+ +DA8XX SoCs feature a set of registers allowing to change the priority of all +peripherals classified as masters. + +Documentation: +OMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh82c/spruh82c.pdf + +Required properties: + +- compatible: "ti,da850-mstpri", "syscon" - for da850 based boardsDrop syscon. Doesn't look like it is needed and the example doesn't match.
Quoted 8 lines
Quoted 4 lines
Hi Rob,
it is needed:
syscon_regmap_lookup_by_compatible()fails without it. I fixed the example instead.Why are master priority registers under syscon? This driver should be the only entity touching them. So do we need an MFD driver?
It should, but syscfg0 registers are mapped all over the place. I thought it would be safer to put them under syscon and Kevin agreed.
Thanks,
Bartosz Golaszewski
Re: [PATCH 2/2] ARM: bus: da8xx-mstpri: new driver
Quoted 44 lines · Bartosz Golaszewski
2016-10-31 10:52 GMT+01:00 Sekhar Nori <[email protected]>:
Quoted 43 lines
Hi Bartosz,
Quoted 40 lines · Bartosz Golaszewski
2016-10-31 5:30 GMT+01:00 Rob Herring <[email protected]>:
Quoted 28 lines · Bartosz Golaszewski
Quoted 27 lines
Create the driver for the da8xx master peripheral priority configuration and implement support for writing to the three Master Priority registers on da850 SoCs.
--- .../devicetree/bindings/bus/ti,da850-mstpri.txt | 20 ++ drivers/bus/Kconfig | 9 + drivers/bus/Makefile | 2 + drivers/bus/da8xx-mstpri.c | 266 +++++++++++++++++++++ 4 files changed, 297 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt create mode 100644 drivers/bus/da8xx-mstpri.cDocumentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +7
-0@@ -0,0 +1,20 @@ +* Device tree bindings for Texas Instruments da8xx master peripheral + priority driver + +DA8XX SoCs feature a set of registers allowing to change the priority of all +peripherals classified as masters. + +Documentation:Quoted 8 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt line 12
Quoted 5 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +5
-0+OMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh82c/spruh82c.pdf + +Required properties: + +- compatible: "ti,da850-mstpri", "syscon" - for da850 based boardsDrop syscon. Doesn't look like it is needed and the example doesn't match.
Hi Rob,
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
it is needed:
syscon_regmap_lookup_by_compatible()fails without it. I fixed the example instead.Why are master priority registers under syscon? This driver should be the only entity touching them. So do we need an MFD driver?
It should, but syscfg0 registers are mapped all over the place. I
Not sure what you mean by this. Yes, the sysconfig module has many functionalities. But the registers for a given functionality are all grouped together AFAICS (except CHIPCFGn, see below).
Pinmux registers are part of syscfg module, but don't use syscon.
In the work going on for OHCI support, chipcfg registers are being put under a syscon node. But that makes sense, I think, because chipcfg registers are catering to really diverse functionality like PLL and EDMA related stuff being placed in the same register - CHIPCFG0.
Quoted 1 line
thought it would be safer to put them under syscon and Kevin agreed.
Before using syscon for the whole syscfg space, I think we need some analysis as to where the likely races are going to be.
Thanks,
Sekhar
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] ARM: bus: da8xx-mstpri: new driver
Quoted 65 lines · Sekhar Nori
Quoted 44 lines · Bartosz Golaszewski
2016-10-31 10:52 GMT+01:00 Sekhar Nori <[email protected]>:
Quoted 43 lines
Hi Bartosz,
Quoted 40 lines · Bartosz Golaszewski
2016-10-31 5:30 GMT+01:00 Rob Herring <[email protected]>:
Quoted 28 lines · Bartosz Golaszewski
Quoted 27 lines
Create the driver for the da8xx master peripheral priority configuration and implement support for writing to the three Master Priority registers on da850 SoCs.
--- .../devicetree/bindings/bus/ti,da850-mstpri.txt | 20 ++ drivers/bus/Kconfig | 9 + drivers/bus/Makefile | 2 + drivers/bus/da8xx-mstpri.c | 266 +++++++++++++++++++++ 4 files changed, 297 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt create mode 100644 drivers/bus/da8xx-mstpri.cDocumentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +7
-0@@ -0,0 +1,20 @@ +* Device tree bindings for Texas Instruments da8xx master peripheral + priority driver + +DA8XX SoCs feature a set of registers allowing to change the priority of all +peripherals classified as masters. + +Documentation:Quoted 8 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt line 12
Quoted 5 lines
Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt new file +5
-0+OMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh82c/spruh82c.pdf + +Required properties: + +- compatible: "ti,da850-mstpri", "syscon" - for da850 based boardsDrop syscon. Doesn't look like it is needed and the example doesn't match.
Hi Rob,
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
it is needed:
syscon_regmap_lookup_by_compatible()fails without it. I fixed the example instead.Why are master priority registers under syscon? This driver should be the only entity touching them. So do we need an MFD driver?
It should, but syscfg0 registers are mapped all over the place. I
Not sure what you mean by this. Yes, the sysconfig module has many functionalities. But the registers for a given functionality are all grouped together AFAICS (except CHIPCFGn, see below).
Pinmux registers are part of syscfg module, but don't use syscon.
In the work going on for OHCI support, chipcfg registers are being put under a syscon node. But that makes sense, I think, because chipcfg registers are catering to really diverse functionality like PLL and EDMA related stuff being placed in the same register - CHIPCFG0.
Quoted 4 lines
Quoted 1 line
thought it would be safer to put them under syscon and Kevin agreed.
Before using syscon for the whole syscfg space, I think we need some analysis as to where the likely races are going to be.
I'm OK with that for now. It makes the most sense to use sycon only for the register (ranges) that will actually be shared.
Kevin
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html