Remove legacy sdma code for dt booting omaps
Subsystems (8)
Tony Lindgren
maintainercover Remove legacy sdma code for dt booting omaps
Hi all,
This series finally removes the legacy sdma code for omaps booting with devicetree. The legacy sdma code is still left for omap1, but makes further work a bit easier.
We do the removal of legacy sdma code with the following steps:
- Prepare for platform data removal by probing sdma with device tree data for the interconnect target module
- Drop unused code and legacy interrupt code for omap2 and later
- Update dmaengine driver to use device tree match data and add missing features
- Allocate logical channels directly in the dmaengine driver
- Drop legacy platform init and data
The patches are against v5.5-rc1, and need the following fixes:
2c81f0f6d3f5 ("bus: ti-sysc: Fix iterating over clocks")e709ed70d122 ("bus: ti-sysc: Fix missing reset delay handling") 93c60483b5fe ("bus: ti-sysc: Fix missing force mstandby quirk handling") 90bdfa0b05e3 ("ARM: OMAP2+: Fix ti_sysc_find_one_clockdomain to check for to_clk_hw_omap")
To make testing easier, I've also pushed out a testing branch at [0][1].
Regards,
Tony
[0] git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git omap-for-v5.6/sdma-testing
[1] https://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git/log/?h=omap-for-v5.6/sdma-testing
Tony Lindgren (14):
ARM: dts: Add generic compatible for omap sdma instances
ARM: dts: Configure interconnect target module for omap2 sdma
ARM: dts: Configure interconnect target module for omap3 sdma
ARM: OMAP2+: Drop unused sdma functions
ARM: OMAP2+: Drop sdma interrupt handling for mach-omap2
ARM: OMAP2+: Configure sdma capabilities directly
ARM: OMAP2+: Configure dma_plat_info directly and drop dma_dev_attr
dmaengine: ti: omap-dma: Add device tree match data and use it for
cpu_pm
dmaengine: ti: omap-dma: Configure global priority register directly
dmaengine: ti: omap-dma: Pass sdma auxdata to driver and use it
dmaengine: ti: omap-dma: Allocate channels directly
dmaengine: ti: omap-dma: Use cpu notifier to block idle for omap2
ARM: OMAP2+: Drop legacy init for sdma
ARM: OMAP2+: Drop legacy platform data for sdma
arch/arm/boot/dts/dra7-l4.dtsi | 3 +- arch/arm/boot/dts/omap2.dtsi | 43 +- arch/arm/boot/dts/omap2430.dtsi | 4 + arch/arm/boot/dts/omap3-n900.dts | 5 + arch/arm/boot/dts/omap3.dtsi | 46 +- arch/arm/boot/dts/omap36xx.dtsi | 4 + arch/arm/boot/dts/omap4-l4.dtsi | 3 +- arch/arm/boot/dts/omap5-l4.dtsi | 3 +- arch/arm/mach-omap2/common.h | 3 + arch/arm/mach-omap2/dma.c | 119 +---- arch/arm/mach-omap2/omap_device.c | 170 ------- arch/arm/mach-omap2/omap_device.h | 4 - arch/arm/mach-omap2/omap_hwmod_2420_data.c | 34 -- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 34 -- .../mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 18 - arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 61 --- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 69 --- arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 61 --- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 61 --- arch/arm/mach-omap2/omap_hwmod_common_data.h | 1 - arch/arm/mach-omap2/pdata-quirks.c | 1 + arch/arm/mach-omap2/pm24xx.c | 22 +- arch/arm/mach-omap2/pm34xx.c | 5 - arch/arm/plat-omap/dma.c | 471 +----------------- drivers/dma/ti/omap-dma.c | 288 ++++++++++- include/linux/omap-dma.h | 18 - 26 files changed, 391 insertions(+), 1160 deletions(-)
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 1/14 ARM: dts: Add generic compatible for omap sdma instances
We need this to pass auxdata to all the sdma instances.
--- arch/arm/boot/dts/dra7-l4.dtsi | 2 +- arch/arm/boot/dts/omap4-l4.dtsi | 2 +- arch/arm/boot/dts/omap5-l4.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/dra7-l4.dtsi +1 -1
@@ -212,7 +212,7 @@ SYSC_OMAP2_SOFTRESET | ranges = <0x0 0x56000 0x1000>; sdma: dma-controller@0 { - compatible = "ti,omap4430-sdma"; + compatible = "ti,omap4430-sdma", "ti,omap-sdma"; reg = <0x0 0x1000>; interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
arch/arm/boot/dts/omap4-l4.dtsi +1 -1
@@ -160,7 +160,7 @@ SYSC_OMAP2_SOFTRESET | ranges = <0x0 0x56000 0x1000>; sdma: dma-controller@0 { - compatible = "ti,omap4430-sdma"; + compatible = "ti,omap4430-sdma", "ti,omap-sdma"; reg = <0x0 0x1000>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
arch/arm/boot/dts/omap5-l4.dtsi +1 -1
@@ -237,7 +237,7 @@ SYSC_OMAP2_SOFTRESET | ranges = <0x0 0x56000 0x1000>; sdma: dma-controller@0 { - compatible = "ti,omap4430-sdma"; + compatible = "ti,omap4430-sdma", "ti,omap-sdma"; reg = <0x0 0x1000>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 2/14 ARM: dts: Configure interconnect target module for omap2 sdma
In reply to Tony LindgrenWe can now probe devices with device tree only configuration using ti-sysc interconnect target module driver. Let's configure the module, but keep the legacy "ti,hwmods" peroperty to avoid new boot time warnings. The legacy property will be removed in later patches together with the legacy platform data.
Note that we want to use separate compatible for omap2420 and omap2430 so let's do that here too while at it.
--- arch/arm/boot/dts/omap2.dtsi | 42 +++++++++++++++++++++++++-------- arch/arm/boot/dts/omap2430.dtsi | 4 ++++ 2 files changed, 36 insertions(+), 10 deletions(-)
arch/arm/boot/dts/omap2.dtsi +32 -10
@@ -8,6 +8,7 @@ * kind, whether express or implied. */ +#include <dt-bindings/bus/ti-sysc.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/pinctrl/omap.h>
@@ -79,17 +80,38 @@ intc: interrupt-controller@1 { reg = <0x480FE000 0x1000>; }; - sdma: dma-controller@48056000 { - compatible = "ti,omap2430-sdma", "ti,omap2420-sdma"; + target-module@48056000 { + compatible = "ti,sysc-omap2", "ti,sysc"; ti,hwmods = "dma"; - reg = <0x48056000 0x1000>; - interrupts = <12>, - <13>, - <14>, - <15>; - #dma-cells = <1>; - dma-channels = <32>; - dma-requests = <64>; + reg = <0x48056000 0x4>, + <0x4805602c 0x4>, + <0x48056028 0x4>; + reg-names = "rev", "sysc", "syss"; + ti,sysc-mask = <(SYSC_OMAP2_CLOCKACTIVITY | + SYSC_OMAP2_EMUFREE | + SYSC_OMAP2_SOFTRESET | + SYSC_OMAP2_AUTOIDLE)>; + ti,sysc-midle = <SYSC_IDLE_FORCE>, + <SYSC_IDLE_NO>, + <SYSC_IDLE_SMART>; + ti,syss-mask = <1>; + clocks = <&core_l3_ck>; + clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x48056000 0x1000>; + + sdma: dma-controller@0 { + compatible = "ti,omap2420-sdma", "ti,omap-sdma"; + reg = <0 0x1000>; + interrupts = <12>, + <13>, + <14>, + <15>; + #dma-cells = <1>; + dma-channels = <32>; + dma-requests = <64>; + }; }; i2c1: i2c@48070000 {
arch/arm/boot/dts/omap2430.dtsi +4 -0
@@ -309,6 +309,10 @@ wd_timer2: wdt@49016000 { }; }; +&sdma { + compatible = "ti,omap2430-sdma", "ti,omap-sdma"; +}; + &i2c1 { compatible = "ti,omap2430-i2c"; };
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 3/14 ARM: dts: Configure interconnect target module for omap3 sdma
In reply to Tony LindgrenWe can now probe devices with device tree only configuration using ti-sysc interconnect target module driver. Let's configure the module, but keep the legacy "ti,hwmods" peroperty to avoid new boot time warnings. The legacy property will be removed in later patches together with the legacy platform data.
Note that we want to use separate compatible for omap34xx and omap36xx so let's do that here too while at it.
--- arch/arm/boot/dts/omap3-n900.dts | 5 ++++ arch/arm/boot/dts/omap3.dtsi | 45 +++++++++++++++++++++++++------- arch/arm/boot/dts/omap36xx.dtsi | 4 +++ 3 files changed, 44 insertions(+), 10 deletions(-)
arch/arm/boot/dts/omap3-n900.dts +5 -0
@@ -482,6 +482,11 @@ &vintdig { regulator-always-on; }; +/* First two dma channels are reserved on secure omap3 */ +&sdma { + dma-channel-mask = <0xfffffffc>; +}; + &twl { twl_audio: audio { compatible = "ti,twl4030-audio";
arch/arm/boot/dts/omap3.dtsi +35 -10
52 lines not on this page · raw message
arch/arm/boot/dts/omap36xx.dtsi +4 -0
@@ -223,6 +223,10 @@ thermal_zones: thermal-zones { }; }; +&sdma { + compatible = "ti,omap3630-sdma", "ti,omap-sdma"; +}; + /* OMAP3630 needs dss_96m_fck for VENC */ &venc { clocks = <&dss_tv_fck>, <&dss_96m_fck>;
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 4/14 ARM: OMAP2+: Drop unused sdma functions
In reply to Tony LindgrenWe still have lots of legacy code for sdma, but some of it is now unused. To simplify phasing out the old legacy sdma code, let's first remove all currently unused functions:
omap_enable_dma_irqomap_set_dma_write_modeomap_set_dma_paramsomap_dma_link_lchomap_set_dma_callbackomap_dma_set_global_params
And with this, omap_dma_set_global_params now becomes static.
--- arch/arm/plat-omap/dma.c | 149 +-------------------------------------- include/linux/omap-dma.h | 12 ---- 2 files changed, 1 insertion(+), 160 deletions(-)
arch/arm/plat-omap/dma.c +1 -148
@@ -65,8 +65,6 @@ enum { DMA_CHAIN_STARTED, DMA_CHAIN_NOTSTARTED };static struct omap_system_dma_plat_info *p;static struct omap_dma_dev_attr *d;static void omap_clear_dma (int lch); -static int omap_dma_set_prio_lch (int lch,unsigned char read_prio, -unsigned char write_prio);static int enable_1510_mode;static u32 errata;
@@ -95,20 +93,6 @@ static struct dma_link_info *dma_linked_lch;#ifndef CONFIG_ARCH_OMAP1 /* Chain handling macros */ -#define OMAP_DMA_CHAIN_QINIT (chain_id) \ - do { \ - dma_linked_lch[chain_id].q_head = \ - dma_linked_lch[chain_id].q_tail = \ - dma_linked_lch[chain_id].q_count = 0; \ - } while (0) -#define OMAP_DMA_CHAIN_QFULL (chain_id) \ - (dma_linked_lch[chain_id].no_of_lchs_linked == \ - dma_linked_lch[chain_id].q_count) -#define OMAP_DMA_CHAIN_QLAST (chain_id) \ - do { \ - ((dma_linked_lch[chain_id].no_of_lchs_linked-1) == \ - dma_linked_lch[chain_id].q_count) \ - } while (0)#define OMAP_DMA_CHAIN_QEMPTY (chain_id) \ (0 == dma_linked_lch[chain_id].q_count)#define __OMAP_DMA_CHAIN_INCQ (end) \
@@ -118,12 +102,6 @@ static struct dma_link_info *dma_linked_lch;__OMAP_DMA_CHAIN_INCQ (dma_linked_lch[chain_id].q_head); \ dma_linked_lch[chain_id].q_count--; \ } while (0) - -#define OMAP_DMA_CHAIN_INCQTAIL (chain_id) \ - do { \ - __OMAP_DMA_CHAIN_INCQ(dma_linked_lch[chain_id].q_tail); \ - dma_linked_lch[chain_id].q_count++; \ - } while (0) #endifstatic int dma_lch_count;
@@ -137,9 +115,6 @@ static inline void disable_lnk(int lch);static void omap_disable_channel_irq (int lch);static inline void omap_enable_channel_irq (int lch); -#define REVISIT_24XX () printk(KERN_ERR "FIXME: no %s on 24xx\n", \ - __func__); -#ifdef CONFIG_ARCH_OMAP15XX /* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ static int omap_dma_in_1510_mode (void )
@@ -278,19 +253,6 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, }EXPORT_SYMBOL (omap_set_dma_transfer_params); -void omap_set_dma_write_mode (int lch,enum omap_dma_write_mode mode) -{ -if (dma_omap2plus ()) { -u32 csdp; - - csdp = p->dma_read (CSDP , lch); - csdp &= ~(0x3 <<16 ); - csdp |= (mode <<16 ); - p->dma_write (csdp,CSDP , lch); - } -} -EXPORT_SYMBOL (omap_set_dma_write_mode); -void omap_set_dma_channel_mode (int lch,enum omap_dma_channel_mode mode) {if (dma_omap1 () && !dma_omap15xx ()) {
@@ -332,25 +294,6 @@ void omap_set_dma_src_params(int lch, int src_port, int src_amode, }EXPORT_SYMBOL (omap_set_dma_src_params); -void omap_set_dma_params (int lch,struct omap_dma_channel_params *params) -{ -omap_set_dma_transfer_params (lch, params->data_type, - params->elem_count, params->frame_count, - params->sync_mode, params->trigger, - params->src_or_dst_synch); -omap_set_dma_src_params (lch, params->src_port, - params->src_amode, params->src_start, - params->src_ei, params->src_fi); - -omap_set_dma_dest_params (lch, params->dst_port, - params->dst_amode, params->dst_start, - params->dst_ei, params->dst_fi); -if (params->read_prio || params->write_prio) -omap_dma_set_prio_lch (lch, params->read_prio, - params->write_prio); -} -EXPORT_SYMBOL (omap_set_dma_params); -void omap_set_dma_src_data_pack (int lch,int enable) {u32 l;
@@ -507,12 +450,6 @@ static inline void omap_disable_channel_irq(int lch) p->dma_write (OMAP2_DMA_CSR_CLEAR_MASK ,CSR , lch); } -void omap_enable_dma_irq (int lch,u16 bits) -{ - dma_chan[lch].enabled_irqs |= bits; -} -EXPORT_SYMBOL (omap_enable_dma_irq); -void omap_disable_dma_irq (int lch,u16 bits) { dma_chan[lch].enabled_irqs &= ~bits;
@@ -721,7 +658,7 @@ EXPORT_SYMBOL(omap_free_dma);* DMA_THREAD_RESERVE_TWOT * DMA_THREAD_RESERVE_THREET */ -void +static void omap_dma_set_global_params (int arb_rate,int max_fifo_depth,int tparams) {u32 reg;
@@ -742,39 +679,6 @@ omap_dma_set_global_params(int arb_rate, int max_fifo_depth, int tparams) p->dma_write (reg,GCR ,0 ); } -EXPORT_SYMBOL (omap_dma_set_global_params); - -/** -* @brief omap_dma_set_prio_lch : Set channel wise priority settings -* -* @param lch -* @param read_prio - Read priority -* @param write_prio - Write priority -* Both of the above can be set with one of the following values : -* DMA_CH_PRIO_HIGH/DMA_CH_PRIO_LOW -*/ -static int -omap_dma_set_prio_lch (int lch,unsigned char read_prio, -unsigned char write_prio) -{ -u32 l; - -if (unlikely ((lch <0 || lch >= dma_lch_count))) { -printk (KERN_ERR "Invalid channel id\n" ); -return -EINVAL ; - } - l = p->dma_read (CCR , lch); - l &= ~((1 <<6 ) | (1 <<26 )); -if (d->dev_caps &IS_RW_PRIORITY ) - l |= ((read_prio &0x1 ) <<6 ) | ((write_prio &0x1 ) <<26 ); -else - l |= ((read_prio &0x1 ) <<6 ); - - p->dma_write (l,CCR , lch); - -return 0 ; -} -/* * Clears any DMA state so the DMA engine is ready to restart with new buffers
@@ -926,29 +830,6 @@ EXPORT_SYMBOL(omap_stop_dma);* Allows changing the DMA callback function or data. This may be needed if * the driver shares a single DMA channel for multiple dma triggers. */ -int omap_set_dma_callback (int lch, -void (*callback)(int lch,u16 ch_status,void *data), -void *data) -{ -unsigned long flags; - -if (lch <0 ) -return -ENODEV ; - -spin_lock_irqsave (&dma_chan_lock, flags); -if (dma_chan[lch].dev_id ==-1 ) { -printk (KERN_ERR "DMA callback for not set for free channel\n" ); -spin_unlock_irqrestore (&dma_chan_lock, flags); -return -EINVAL ; - } - dma_chan[lch].callback = callback; - dma_chan[lch].data = data; -spin_unlock_irqrestore (&dma_chan_lock, flags); - -return 0 ; -} -EXPORT_SYMBOL (omap_set_dma_callback); -/* * Returns current physical source address for the given DMA channel. * If the channel is running the caller must disable interrupts prior calling
@@ -1048,34 +929,6 @@ int omap_dma_running(void)return 0 ; } -/* -* lch_queue DMA will start right after lch_head one is finished. -* For this DMA link to start, you still need to start (see omap_start_dma) -* the first one. That will fire up the entire queue. -*/ -void omap_dma_link_lch (int lch_head,int lch_queue) -{ -if (omap_dma_in_1510_mode ()) { -if (lch_head == lch_queue) { - p->dma_write (p->dma_read (CCR , lch_head) | (3 <<8 ), -CCR , lch_head); -return ; - } -printk (KERN_ERR "DMA linking is not supported in 1510 mode\n" ); -BUG (); -return ; - } - -if ((dma_chan[lch_head].dev_id ==-1 ) || - (dma_chan[lch_queue].dev_id ==-1 )) { -pr_err ("omap_dma: trying to link non requested channels\n" ); -dump_stack (); - } - - dma_chan[lch_head].next_lch = lch_queue; -} -EXPORT_SYMBOL (omap_dma_link_lch); -/*----------------------------------------------------------------------------*/ #ifdef CONFIG_ARCH_OMAP1
include/linux/omap-dma.h +0 -12
@@ -303,7 +303,6 @@ extern void omap_set_dma_priority(int lch, int dst_port, int priority);extern int omap_request_dma (int dev_id,const char *dev_name,void (*callback)(int lch,u16 ch_status,void *data),void *data,int *dma_ch); -extern void omap_enable_dma_irq (int ch,u16 irq_bits);extern void omap_disable_dma_irq (int ch,u16 irq_bits);extern void omap_free_dma (int ch);extern void omap_start_dma (int lch);
@@ -312,7 +311,6 @@ extern void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, int frame_count, int sync_mode, int dma_trigger, int src_or_dst_synch); -extern void omap_set_dma_write_mode (int lch,enum omap_dma_write_mode mode);extern void omap_set_dma_channel_mode (int lch,enum omap_dma_channel_mode mode); extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
@@ -329,20 +327,10 @@ extern void omap_set_dma_dest_data_pack(int lch, int enable);extern void omap_set_dma_dest_burst_mode (int lch,enum omap_dma_burst_mode burst_mode); -extern void omap_set_dma_params (int lch, -struct omap_dma_channel_params *params); - -extern void omap_dma_link_lch (int lch_head,int lch_queue); - -extern int omap_set_dma_callback (int lch, -void (*callback)(int lch,u16 ch_status,void *data), -void *data);extern dma_addr_t omap_get_dma_src_pos (int lch);extern dma_addr_t omap_get_dma_dst_pos (int lch);extern int omap_get_dma_active_status (int lch);extern int omap_dma_running (void ); -extern void omap_dma_set_global_params (int arb_rate,int max_fifo_depth, -int tparams);void omap_dma_global_context_save (void );void omap_dma_global_context_restore (void );
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 5/14 ARM: OMAP2+: Drop sdma interrupt handling for mach-omap2
In reply to Tony LindgrenAll device tree probing omap SoCs only have device drivers that are using Linux dmaengine API with the IRQENABLE_L1 interrupts. Only omap1 is still using old legacy dma.
This means we can remove the legacy sdma interrupt handling for IRQENABLE_L0, and only rely on the dmaengine driver using IRQENABLE_L1.
The legacy code still allocates the channels, but that will be deal with in the following patches.
--- arch/arm/mach-omap2/dma.c | 3 - arch/arm/plat-omap/dma.c | 245 ++------------------------------------ include/linux/omap-dma.h | 4 - 3 files changed, 8 insertions(+), 244 deletions(-)
arch/arm/mach-omap2/dma.c +0 -3
@@ -272,9 +272,6 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)if (cpu_is_omap34xx () && (omap_type () !=OMAP2_DEVICE_TYPE_GP )) d->dev_caps |=HS_CHANNELS_RESERVED ; -if (platform_get_irq_byname (pdev,"0" ) <0 ) - d->dev_caps |=DMA_ENGINE_HANDLE_IRQ ; -/* Check the capabilities register for descriptor loading feature */ if (dma_read (CAPS_0 ,0 ) &DMA_HAS_DESCRIPTOR_CAPS ) dma_common_ch_end =CCDN ;
arch/arm/plat-omap/dma.c +8 -237
337 lines not on this page · raw message
include/linux/omap-dma.h +0 -4
@@ -129,7 +129,6 @@#define IS_WORD_16 BIT(0xd)#define ENABLE_16XX_MODE BIT(0xe)#define HS_CHANNELS_RESERVED BIT(0xf) -#define DMA_ENGINE_HANDLE_IRQ BIT(0x10)/* Defines for DMA Capabilities */ #define DMA_HAS_TRANSPARENT_CAPS (0x1 << 18)
@@ -239,9 +238,6 @@ struct omap_dma_lch {void (*callback)(int lch,u16 ch_status,void *data);void *data;long flags; -/* required for Dynamic chaining */ -int prev_linked_ch; -int next_linked_ch;int state;int chain_id;int status;
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 6/14 ARM: OMAP2+: Configure sdma capabilities directly
In reply to Tony LindgrenOnly earlier SoCs need to be checked for this, all SoCs starting with omap3630 have CCDN register. This way we get closer to removing the need to ioremap sdma registers in the platform code.
--- arch/arm/mach-omap2/dma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/dma.c +3 -3
@@ -273,10 +273,10 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused) d->dev_caps |=HS_CHANNELS_RESERVED ;/* Check the capabilities register for descriptor loading feature */ -if (dma_read (CAPS_0 ,0 ) &DMA_HAS_DESCRIPTOR_CAPS ) - dma_common_ch_end =CCDN ; -else +if (soc_is_omap24xx () ||soc_is_omap34xx () ||soc_is_am35xx ()) dma_common_ch_end =CCFN ; +else + dma_common_ch_end =CCDN ;return 0 ; }
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 7/14 ARM: OMAP2+: Configure dma_plat_info directly and drop dma_dev_attr
In reply to Tony LindgrenLet's prepare things for passing dma_plat_info to the dmaengine driver in device tree auxdata. To do that, we want to configure dma_plat_info directly. And we can also drop the related dma_dev_attr data.
--- arch/arm/mach-omap2/dma.c | 31 +++++++++++++--------- arch/arm/mach-omap2/omap_hwmod_2420_data.c | 8 ------ arch/arm/mach-omap2/omap_hwmod_2430_data.c | 8 ------ arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 8 ------ arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 8 ------ arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 8 ------ arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 8 ------ 7 files changed, 18 insertions(+), 61 deletions(-)
arch/arm/mach-omap2/dma.c +18 -13
@@ -211,9 +211,16 @@ static const struct dma_slave_map omap24xx_sdma_dt_map[] = { { "musb-hdrc.1.auto", "dmareq5", SDMA_FILTER_PARAM(64) }, /* OMAP2420 only */ }; +static struct omap_dma_dev_attr dma_attr = { + .dev_caps =RESERVE_CHANNEL |DMA_LINKED_LCH |GLOBAL_PRIORITY | +IS_CSSA_32 |IS_CDSA_32 , + .lch_count =32 , +}; +static struct omap_system_dma_plat_info dma_plat_info__initdata = { .reg_map = reg_map, .channel_stride =0x60 , + .dma_attr = &dma_attr, .show_dma_caps = omap2_show_dma_caps, .clear_dma = omap2_clear_dma, .dma_write = dma_write,
@@ -230,22 +237,25 @@ static struct platform_device_info omap_dma_dev_info __initdata = {static int __init omap2_system_dma_init_dev (struct omap_hwmod *oh,void *unused) {struct platform_device *pdev; -struct omap_system_dma_plat_info p; -struct omap_dma_dev_attr *d;struct resource *mem;char *name ="omap_dma_system" ; - p = dma_plat_info; - p.dma_attr = (struct omap_dma_dev_attr *)oh->dev_attr; - p.errata =configure_dma_errata (); + dma_plat_info.errata =configure_dma_errata ();if (soc_is_omap24xx ()) {/* DMA slave map for drivers not yet converted to DT */ - p.slave_map = omap24xx_sdma_dt_map; - p.slavecnt =ARRAY_SIZE (omap24xx_sdma_dt_map); + dma_plat_info.slave_map = omap24xx_sdma_dt_map; + dma_plat_info.slavecnt =ARRAY_SIZE (omap24xx_sdma_dt_map); } - pdev =omap_device_build (name,0 , oh, &p,sizeof (p)); +if (!soc_is_omap242x ()) + dma_attr.dev_caps |=IS_RW_PRIORITY ; + +if (soc_is_omap34xx () && (omap_type () !=OMAP2_DEVICE_TYPE_GP )) + dma_attr.dev_caps |=HS_CHANNELS_RESERVED ; + + pdev =omap_device_build (name,0 , oh, &dma_plat_info, +sizeof (dma_plat_info));if (IS_ERR (pdev)) {pr_err ("%s: Can't build omap_device for %s:%s.\n" , __func__, name, oh->name);
@@ -267,11 +277,6 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)return -ENOMEM ; } - d = oh->dev_attr; - -if (cpu_is_omap34xx () && (omap_type () !=OMAP2_DEVICE_TYPE_GP )) - d->dev_caps |=HS_CHANNELS_RESERVED ; -/* Check the capabilities register for descriptor loading feature */ if (soc_is_omap24xx () ||soc_is_omap34xx () ||soc_is_am35xx ()) dma_common_ch_end =CCFN ;
arch/arm/mach-omap2/omap_hwmod_2420_data.c +0 -8
@@ -126,18 +126,10 @@ static struct omap_hwmod omap2420_i2c2_hwmod = { .flags = HWMOD_16BIT_REG, }; -/* dma attributes */ -static struct omap_dma_dev_attr dma_dev_attr = { - .dev_caps =RESERVE_CHANNEL |DMA_LINKED_LCH |GLOBAL_PRIORITY | -IS_CSSA_32 |IS_CDSA_32 , - .lch_count =32 , -}; -static struct omap_hwmod omap2420_dma_system_hwmod = { .name ="dma" , .class = &omap2xxx_dma_hwmod_class, .main_clk ="core_l3_ck" , - .dev_attr = &dma_dev_attr, .flags =HWMOD_NO_IDLEST , };
arch/arm/mach-omap2/omap_hwmod_2430_data.c +0 -8
@@ -121,18 +121,10 @@ static struct omap_hwmod omap2430_gpio5_hwmod = { .class = &omap2xxx_gpio_hwmod_class, }; -/* dma attributes */ -static struct omap_dma_dev_attr dma_dev_attr = { - .dev_caps =RESERVE_CHANNEL |DMA_LINKED_LCH |GLOBAL_PRIORITY | -IS_CSSA_32 |IS_CDSA_32 |IS_RW_PRIORITY , - .lch_count =32 , -}; -static struct omap_hwmod omap2430_dma_system_hwmod = { .name ="dma" , .class = &omap2xxx_dma_hwmod_class, .main_clk ="core_l3_ck" , - .dev_attr = &dma_dev_attr, .flags =HWMOD_NO_IDLEST , };
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 -8
@@ -833,13 +833,6 @@ static struct omap_hwmod omap3xxx_gpio6_hwmod = { .class = &omap3xxx_gpio_hwmod_class, }; -/* dma attributes */ -static struct omap_dma_dev_attr dma_dev_attr = { - .dev_caps =RESERVE_CHANNEL |DMA_LINKED_LCH |GLOBAL_PRIORITY | -IS_CSSA_32 |IS_CDSA_32 |IS_RW_PRIORITY , - .lch_count =32 , -}; -static struct omap_hwmod_class_sysconfig omap3xxx_dma_sysc = { .rev_offs =0x0000 , .sysc_offs =0x002c ,
@@ -870,7 +863,6 @@ static struct omap_hwmod omap3xxx_dma_system_hwmod = { .idlest_idle_bit = OMAP3430_ST_SDMA_SHIFT, }, }, - .dev_attr = &dma_dev_attr, .flags = HWMOD_NO_IDLEST, };
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -8
@@ -422,13 +422,6 @@ static struct omap_hwmod_class omap44xx_dma_hwmod_class = { .sysc = &omap44xx_dma_sysc, }; -/* dma dev_attr */ -static struct omap_dma_dev_attr dma_dev_attr = { - .dev_caps =RESERVE_CHANNEL |DMA_LINKED_LCH |GLOBAL_PRIORITY | -IS_CSSA_32 |IS_CDSA_32 |IS_RW_PRIORITY , - .lch_count =32 , -}; -/* dma_system */ static struct omap_hwmod omap44xx_dma_system_hwmod = { .name ="dma_system" ,
@@ -441,7 +434,6 @@ static struct omap_hwmod omap44xx_dma_system_hwmod = { .context_offs = OMAP4_RM_SDMA_SDMA_CONTEXT_OFFSET, }, }, - .dev_attr = &dma_dev_attr, };/*
arch/arm/mach-omap2/omap_hwmod_54xx_data.c +0 -8
@@ -256,13 +256,6 @@ static struct omap_hwmod_class omap54xx_dma_hwmod_class = { .sysc = &omap54xx_dma_sysc, }; -/* dma dev_attr */ -static struct omap_dma_dev_attr dma_dev_attr = { - .dev_caps =RESERVE_CHANNEL |DMA_LINKED_LCH |GLOBAL_PRIORITY | -IS_CSSA_32 |IS_CDSA_32 |IS_RW_PRIORITY , - .lch_count =32 , -}; -/* dma_system */ static struct omap_hwmod omap54xx_dma_system_hwmod = { .name ="dma_system" ,
@@ -275,7 +268,6 @@ static struct omap_hwmod omap54xx_dma_system_hwmod = { .context_offs = OMAP54XX_RM_DMA_DMA_SYSTEM_CONTEXT_OFFSET, }, }, - .dev_attr = &dma_dev_attr, };/*
arch/arm/mach-omap2/omap_hwmod_7xx_data.c +0 -8
@@ -411,13 +411,6 @@ static struct omap_hwmod_class dra7xx_dma_hwmod_class = { .sysc = &dra7xx_dma_sysc, }; -/* dma dev_attr */ -static struct omap_dma_dev_attr dma_dev_attr = { - .dev_caps =RESERVE_CHANNEL |DMA_LINKED_LCH |GLOBAL_PRIORITY | -IS_CSSA_32 |IS_CDSA_32 |IS_RW_PRIORITY , - .lch_count =32 , -}; -/* dma_system */ static struct omap_hwmod dra7xx_dma_system_hwmod = { .name ="dma_system" ,
@@ -430,7 +423,6 @@ static struct omap_hwmod dra7xx_dma_system_hwmod = { .context_offs = DRA7XX_RM_DMA_DMA_SYSTEM_CONTEXT_OFFSET, }, }, - .dev_attr = &dma_dev_attr, };/*
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 8/14 dmaengine: ti: omap-dma: Add device tree match data and use it for cpu_pm
In reply to Tony LindgrenWith old DMA code disabled for handling DMA requests for device tree based SoCs, we can move omap3 specific context save and restore to the dmaengine driver.
Let's do this by adding cpu_pm notifier handling to save and restore context, and enable it based on device tree match data. This way we can use the match data later to configure more SoC specific features later on too.
Note that we only clear the channels in use while the platform code also clears reserved channels 0 and 1 on high-security SoCs. Based on testing on n900, this is not needed though and the system idles just fine.
With the dmaengine driver handling context save and restore, we must now remove the old custom calls for context save and restore.
--- arch/arm/mach-omap2/pm34xx.c | 5 -- arch/arm/plat-omap/dma.c | 43 ---------- drivers/dma/ti/omap-dma.c | 150 ++++++++++++++++++++++++++++++++--- include/linux/omap-dma.h | 2 - 4 files changed, 138 insertions(+), 62 deletions(-)
arch/arm/mach-omap2/pm34xx.c +0 -5
@@ -25,7 +25,6 @@#include <linux/clk.h> #include <linux/delay.h> #include <linux/slab.h> -#include <linux/omap-dma.h> #include <linux/omap-gpmc.h> #include <trace/events/power.h>
@@ -85,7 +84,6 @@ static void omap3_core_save_context(void)omap3_gpmc_save_context ();/* Save the system control module context, padconf already save above*/ omap3_control_save_context (); -omap_dma_global_context_save (); }static void omap3_core_restore_context (void )
@@ -96,7 +94,6 @@ static void omap3_core_restore_context(void)omap3_gpmc_restore_context ();/* Restore the interrupt controller context */ omap_intc_restore_context (); -omap_dma_global_context_restore (); }/*
@@ -547,9 +544,7 @@ int __init omap3_pm_init(void)local_irq_disable (); -omap_dma_global_context_save ();omap3_save_secure_ram_context (); -omap_dma_global_context_restore ();local_irq_enable (); }
arch/arm/plat-omap/dma.c +0 -43
55 lines not on this page · raw message
drivers/dma/ti/omap-dma.c +138 -12
232 lines not on this page · raw message
include/linux/omap-dma.h +0 -2
@@ -327,8 +327,6 @@ extern dma_addr_t omap_get_dma_src_pos(int lch);extern dma_addr_t omap_get_dma_dst_pos (int lch);extern int omap_get_dma_active_status (int lch);extern int omap_dma_running (void ); -void omap_dma_global_context_save (void ); -void omap_dma_global_context_restore (void );#if defined(CONFIG_ARCH_OMAP1 ) &&IS_ENABLED (CONFIG_FB_OMAP )#include <mach/lcd_dma.h>
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 9/14 dmaengine: ti: omap-dma: Configure global priority register directly
In reply to Tony LindgrenWe can move the global priority register configuration to the dmaengine driver and configure it based on the of_device_id match data.
--- arch/arm/plat-omap/dma.c | 36 ------------------------------------ drivers/dma/ti/omap-dma.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 36 deletions(-)
arch/arm/plat-omap/dma.c +0 -36
@@ -557,38 +557,6 @@ void omap_free_dma(int lch) }EXPORT_SYMBOL (omap_free_dma); -/** -* @brief omap_dma_set_global_params : Set global priority settings for dma -* -* @param arb_rate -* @param max_fifo_depth -* @param tparams - Number of threads to reserve : DMA_THREAD_RESERVE_NORM -* DMA_THREAD_RESERVE_ONET -* DMA_THREAD_RESERVE_TWOT -* DMA_THREAD_RESERVE_THREET -*/ -static void -omap_dma_set_global_params (int arb_rate,int max_fifo_depth,int tparams) -{ -u32 reg; - -if (dma_omap1 ()) { -printk (KERN_ERR "FIXME: no %s on 15xx/16xx\n" , __func__); -return ; - } - -if (max_fifo_depth ==0 ) - max_fifo_depth =1 ; -if (arb_rate ==0 ) - arb_rate =1 ; - - reg =0xff & max_fifo_depth; - reg |= (0x3 & tparams) <<12 ; - reg |= (arb_rate &0xff ) <<16 ; - - p->dma_write (reg,GCR ,0 ); -} -/* * Clears any DMA state so the DMA engine is ready to restart with new buffers * through omap_start_dma(). Any buffers in flight are discarded.
@@ -969,10 +937,6 @@ static int omap_system_dma_probe(struct platform_device *pdev) } } -if (d->dev_caps &IS_RW_PRIORITY ) -omap_dma_set_global_params (DMA_DEFAULT_ARB_RATE , -DMA_DEFAULT_FIFO_DEPTH ,0 ); -/* reserve dma channels 0 and 1 in high security devices on 34xx */ if (d->dev_caps &HS_CHANNELS_RESERVED ) {pr_info ("Reserving DMA channels 0 and 1 for HS ROM code\n" );
drivers/dma/ti/omap-dma.c +29 -0
@@ -26,6 +26,7 @@struct omap_dma_config {int lch_end; +unsigned int rw_priority:1 ;unsigned int may_lose_context:1 ; };
@@ -1536,6 +1537,27 @@ static int omap_dma_context_notifier(struct notifier_block *nb,return NOTIFY_OK ; } +static void omap_dma_init_gcr (struct omap_dmadev *od,int arb_rate, +int max_fifo_depth,int tparams) +{ +u32 val; + +/* Set only for omap2430 and later */ +if (!od->cfg->rw_priority) +return ; + +if (max_fifo_depth ==0 ) + max_fifo_depth =1 ; +if (arb_rate ==0 ) + arb_rate =1 ; + + val =0xff & max_fifo_depth; + val |= (0x3 & tparams) <<12 ; + val |= (arb_rate &0xff ) <<16 ; + +omap_dma_glbl_write (od,GCR , val); +} +#define OMAP_DMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \ BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ BIT(DMA_SLAVE_BUSWIDTH_4_BYTES))
@@ -1701,6 +1723,8 @@ static int omap_dma_probe(struct platform_device *pdev) } } +omap_dma_init_gcr (od,DMA_DEFAULT_ARB_RATE ,DMA_DEFAULT_FIFO_DEPTH ,0 ); +if (od->cfg->may_lose_context) { od->nb.notifier_call = omap_dma_context_notifier;cpu_pm_register_notifier (&od->nb);
@@ -1743,24 +1767,29 @@ static int omap_dma_remove(struct platform_device *pdev)static const struct omap_dma_config omap2420_data = { .lch_end =CCFN , + .rw_priority = true, };static const struct omap_dma_config omap2430_data = { .lch_end =CCFN , + .rw_priority = true, };static const struct omap_dma_config omap3430_data = { .lch_end =CCFN , + .rw_priority = true, .may_lose_context = true, };static const struct omap_dma_config omap3630_data = { .lch_end =CCDN , + .rw_priority = true, .may_lose_context = true, };static const struct omap_dma_config omap4_data = { .lch_end =CCDN , + .rw_priority = true, };static const struct of_device_id omap_dma_match[] = {
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 10/14 dmaengine: ti: omap-dma: Pass sdma auxdata to driver and use it
In reply to Tony LindgrenWe can now start passing sdma auxdata to the dmaengine driver to start removing the platform based sdma init.
--- arch/arm/mach-omap2/common.h | 3 +++ arch/arm/mach-omap2/dma.c | 2 +- arch/arm/mach-omap2/pdata-quirks.c | 1 + drivers/dma/ti/omap-dma.c | 14 +++++++++----- 4 files changed, 14 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/common.h +3 -0
@@ -345,9 +345,12 @@ static inline int dra7xx_pciess_reset(struct omap_hwmod *oh) }#endif +struct omap_system_dma_plat_info ; +void pdata_quirks_init (const struct of_device_id *);void omap_auxdata_legacy_init (struct device *dev);void omap_pcs_legacy_init (int irq,void (*rearm)(void )); +extern struct omap_system_dma_plat_info dma_plat_info;struct omap_sdrc_params ; extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
arch/arm/mach-omap2/dma.c +1 -1
@@ -217,7 +217,7 @@ static struct omap_dma_dev_attr dma_attr = { .lch_count = 32, }; -static struct omap_system_dma_plat_info dma_plat_info__initdata = { +struct omap_system_dma_plat_info dma_plat_info = { .reg_map = reg_map, .channel_stride =0x60 , .dma_attr = &dma_attr,
arch/arm/mach-omap2/pdata-quirks.c +1 -0
@@ -514,6 +514,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = {/* Common auxdata */ OF_DEV_AUXDATA ("ti,sysc" ,0 ,NULL , &ti_sysc_pdata),OF_DEV_AUXDATA ("pinctrl-single" ,0 ,NULL , &pcs_pdata), + OF_DEV_AUXDATA("ti,omap-sdma", 0, NULL, &dma_plat_info), { /* sentinel */ }, };
drivers/dma/ti/omap-dma.c +9 -5
@@ -1585,14 +1585,18 @@ static int omap_dma_probe(struct platform_device *pdev)return PTR_ERR (od->base); conf =of_device_get_match_data (&pdev->dev); -if (conf) +if (conf) { od->cfg = conf; -else + od->plat =dev_get_platdata (&pdev->dev); +if (!od->plat) +dev_warn (&pdev->dev,"no sdma auxdata needed?\n" ); + }else { od->cfg = &default_cfg; - od->plat =omap_get_plat_info (); -if (!od->plat) -return -EPROBE_DEFER ; + od->plat =omap_get_plat_info (); +if (!od->plat) +return -EPROBE_DEFER ; + } od->reg_map = od->plat->reg_map;
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 11/14 dmaengine: ti: omap-dma: Allocate channels directly
In reply to Tony LindgrenWith the legacy IRQ handling gone, we can now start allocating channels directly in the dmaengine driver for device tree based SoCs.
--- drivers/dma/ti/omap-dma.c | 62 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-)
drivers/dma/ti/omap-dma.c +58 -4
@@ -28,6 +28,7 @@ struct omap_dma_config {int lch_end; unsigned int rw_priority:1; unsigned int may_lose_context:1; + unsigned int needs_lch_clear:1; };struct omap_dma_context {
@@ -47,6 +48,8 @@ struct omap_dmadev {struct notifier_block nb;struct omap_dma_context context;int lch_count; +DECLARE_BITMAP (lch_bitmap,OMAP_SDMA_CHANNELS ); +struct mutex lch_lock;/* for assigning logical channels */ bool legacy;bool ll123_supported;struct dma_pool *desc_pool;
@@ -664,6 +667,37 @@ static irqreturn_t omap_dma_irq(int irq, void *devid)return IRQ_HANDLED ; } +static int omap_dma_get_lch (struct omap_dmadev *od,int *lch) +{ +int channel; + +mutex_lock (&od->lch_lock); + channel =find_first_zero_bit (od->lch_bitmap, od->lch_count); +if (channel >= od->lch_count) + goto out_busy; +set_bit (channel, od->lch_bitmap); +mutex_unlock (&od->lch_lock); + +omap_dma_clear_lch (od, channel); + *lch = channel; + +return 0 ; + +out_busy: +mutex_unlock (&od->lch_lock); + *lch = -EINVAL ; + +return -EBUSY ; +} + +static void omap_dma_put_lch (struct omap_dmadev *od,int lch) +{ +omap_dma_clear_lch (od, lch); +mutex_lock (&od->lch_lock); +clear_bit (lch, od->lch_bitmap); +mutex_unlock (&od->lch_lock); +} +static int omap_dma_alloc_chan_resources (struct dma_chan *chan) {struct omap_dmadev *od =to_omap_dma_dev (chan->device);
@@ -675,15 +709,13 @@ static int omap_dma_alloc_chan_resources(struct dma_chan *chan) ret =omap_request_dma (c->dma_sig,"DMA engine" , omap_dma_callback, c, &c->dma_ch); }else { - ret =omap_request_dma (c->dma_sig,"DMA engine" ,NULL ,NULL , - &c->dma_ch); + ret =omap_dma_get_lch (od, &c->dma_ch); }dev_dbg (dev,"allocating channel %u for %u\n" , c->dma_ch, c->dma_sig);if (ret >=0 ) {omap_dma_assign (od, c, c->dma_ch); -pr_info ("XXX %s: assigned lch: %i\n" , __func__, c->dma_ch);if (!od->legacy) {unsigned val;
@@ -734,7 +766,11 @@ static void omap_dma_free_chan_resources(struct dma_chan *chan) c->channel_base =NULL ; od->lch_map[c->dma_ch] =NULL ;vchan_free_chan_resources (&c->vc); -omap_free_dma (c->dma_ch); + +if (od->legacy) +omap_free_dma (c->dma_ch); +else +omap_dma_put_lch (od, c->dma_ch);dev_dbg (od->ddev.dev,"freeing channel %u used for %u\n" , c->dma_ch, c->dma_sig);
@@ -1574,6 +1610,7 @@ static int omap_dma_probe(struct platform_device *pdev)struct omap_dmadev *od;struct resource *res;int rc, i, irq; +u32 val; od =devm_kzalloc (&pdev->dev,sizeof (*od),GFP_KERNEL );if (!od)
@@ -1628,6 +1665,7 @@ static int omap_dma_probe(struct platform_device *pdev) od->ddev.max_burst =SZ_16M -1 ;/* CCEN: 24bit unsigned */ od->ddev.dev = &pdev->dev;INIT_LIST_HEAD (&od->ddev.channels); +mutex_init (&od->lch_lock);spin_lock_init (&od->lock);spin_lock_init (&od->irq_lock);
@@ -1654,6 +1692,17 @@ static int omap_dma_probe(struct platform_device *pdev) od->lch_count =OMAP_SDMA_CHANNELS ; } +/* Mask of allowed logical channels */ +if (pdev->dev.of_node && !of_property_read_u32 (pdev->dev.of_node, +"dma-channel-mask" , + &val)) { +/* Tag channels not in mask as reserved */ + val = ~val; +bitmap_from_arr32 (od->lch_bitmap, &val, od->lch_count); + } +if (od->plat->dma_attr->dev_caps &HS_CHANNELS_RESERVED ) +bitmap_set (od->lch_bitmap,0 ,2 ); + od->lch_map =devm_kcalloc (&pdev->dev, od->lch_count,sizeof (*od->lch_map),GFP_KERNEL );
@@ -1772,28 +1821,33 @@ static int omap_dma_remove(struct platform_device *pdev)static const struct omap_dma_config omap2420_data = { .lch_end =CCFN , .rw_priority = true, + .needs_lch_clear = true, };static const struct omap_dma_config omap2430_data = { .lch_end =CCFN , .rw_priority = true, + .needs_lch_clear = true, };static const struct omap_dma_config omap3430_data = { .lch_end =CCFN , .rw_priority = true, + .needs_lch_clear = true, .may_lose_context = true, };static const struct omap_dma_config omap3630_data = { .lch_end =CCDN , .rw_priority = true, + .needs_lch_clear = true, .may_lose_context = true, };static const struct omap_dma_config omap4_data = { .lch_end =CCDN , .rw_priority = true, + .needs_lch_clear = true, };static const struct of_device_id omap_dma_match[] = {
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 12/14 dmaengine: ti: omap-dma: Use cpu notifier to block idle for omap2
In reply to Tony LindgrenFor omap2, we need to block idle if SDMA is busy. Let's do this with a cpu notifier and remove the custom call.
--- arch/arm/mach-omap2/pm24xx.c | 22 +++++++++---------- drivers/dma/ti/omap-dma.c | 41 +++++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 13 deletions(-)
arch/arm/mach-omap2/pm24xx.c +10 -12
@@ -83,8 +83,6 @@ static int omap2_enter_full_retention(void) l =omap_ctrl_readl (OMAP2_CONTROL_DEVCONF0 ) |OMAP24XX_USBSTANDBYCTRL ;omap_ctrl_writel (l,OMAP2_CONTROL_DEVCONF0 ); -cpu_cluster_pm_enter (); -/* One last check for pending IRQs to avoid extra latency due * to sleeping unnecessarily. */ if (omap_irq_pending ())
@@ -96,8 +94,6 @@ static int omap2_enter_full_retention(void) OMAP_SDRC_REGADDR(SDRC_POWER)); no_sleep: -cpu_cluster_pm_exit (); -clk_enable (osc_ck);/* clear CORE wake-up events */
@@ -162,25 +158,27 @@ static int omap2_can_sleep(void)return 0 ;if (__clk_is_enabled (osc_ck))return 0 ; -if (omap_dma_running ()) -return 0 ;return 1 ; }static void omap2_pm_idle (void ) { -if (!omap2_can_sleep ()) { -if (omap_irq_pending ()) -return ; -omap2_enter_mpu_retention (); -return ; - } +int error;if (omap_irq_pending ())return ; + error =cpu_cluster_pm_enter (); +if (error || !omap2_can_sleep ()) { +omap2_enter_mpu_retention (); + goto out_cpu_cluster_pm; + } +omap2_enter_full_retention (); + +out_cpu_cluster_pm: +cpu_cluster_pm_exit (); }static void __init prcm_setup_regs (void )
drivers/dma/ti/omap-dma.c +40 -1
65 lines not on this page · raw message
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 13/14 ARM: OMAP2+: Drop legacy init for sdma
In reply to Tony LindgrenWe can now drop legacy init for sdma as we pass the quirks in auxdata to the dmaengine driver.
--- arch/arm/mach-omap2/dma.c | 91 +--------------- arch/arm/mach-omap2/omap_device.c | 170 ------------------------------ arch/arm/mach-omap2/omap_device.h | 4 - 3 files changed, 1 insertion(+), 264 deletions(-)
arch/arm/mach-omap2/dma.c +1 -90
@@ -30,10 +30,6 @@#include <linux/omap-dma.h> #include "soc.h" -#include "omap_hwmod.h" -#include "omap_device.h" - -static enum omap_reg_offsets dma_common_ch_end;static const struct omap_dma_reg reg_map[] = { [REVISION ] = {0x0000 ,0x00 ,OMAP_DMA_REG_32BIT },
@@ -81,42 +77,6 @@ static const struct omap_dma_reg reg_map[] = { [CCDN] = { 0x00d8, 0x60, OMAP_DMA_REG_32BIT }, }; -static void __iomem *dma_base; -static inline void dma_write (u32 val,int reg,int lch) -{ -void __iomem *addr = dma_base; - - addr += reg_map[reg].offset; - addr += reg_map[reg].stride * lch; - -writel_relaxed (val, addr); -} - -static inline u32 dma_read (int reg,int lch) -{ -void __iomem *addr = dma_base; - - addr += reg_map[reg].offset; - addr += reg_map[reg].stride * lch; - -return readl_relaxed (addr); -} - -static void omap2_clear_dma (int lch) -{ -int i; - -for (i =CSDP ; i <= dma_common_ch_end; i +=1 ) -dma_write (0 , i, lch); -} - -static void omap2_show_dma_caps (void ) -{ -u8 revision =dma_read (REVISION ,0 ) &0xff ; -printk (KERN_INFO "OMAP DMA hardware revision %d.%d\n" , - revision >>4 , revision &0xf ); -} -static unsigned configure_dma_errata (void ) {unsigned errata =0 ;
@@ -221,25 +181,11 @@ struct omap_system_dma_plat_info dma_plat_info = { .reg_map = reg_map, .channel_stride = 0x60, .dma_attr = &dma_attr, - .show_dma_caps = omap2_show_dma_caps, - .clear_dma = omap2_clear_dma, - .dma_write = dma_write, - .dma_read = dma_read, -}; - -static struct platform_device_info omap_dma_dev_info__initdata = { - .name ="omap-dma-engine" , - .id =-1 , - .dma_mask =DMA_BIT_MASK (32 ), };/* One time initializations */ -static int __init omap2_system_dma_init_dev (struct omap_hwmod *oh,void *unused) +static int __init omap2_system_dma_init (void ) { -struct platform_device *pdev; -struct resource *mem; -char *name ="omap_dma_system" ; - dma_plat_info.errata =configure_dma_errata ();if (soc_is_omap24xx ()) {
@@ -254,41 +200,6 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)if (soc_is_omap34xx () && (omap_type () !=OMAP2_DEVICE_TYPE_GP )) dma_attr.dev_caps |=HS_CHANNELS_RESERVED ; - pdev =omap_device_build (name,0 , oh, &dma_plat_info, -sizeof (dma_plat_info)); -if (IS_ERR (pdev)) { -pr_err ("%s: Can't build omap_device for %s:%s.\n" , - __func__, name, oh->name); -return PTR_ERR (pdev); - } - - omap_dma_dev_info.res = pdev->resource; - omap_dma_dev_info.num_res = pdev->num_resources; - - mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem) { -dev_err (&pdev->dev,"%s: no mem resource\n" , __func__); -return -EINVAL ; - } - - dma_base =ioremap (mem->start,resource_size (mem)); -if (!dma_base) { -dev_err (&pdev->dev,"%s: ioremap fail\n" , __func__); -return -ENOMEM ; - } - -/* Check the capabilities register for descriptor loading feature */ -if (soc_is_omap24xx () ||soc_is_omap34xx () ||soc_is_am35xx ()) - dma_common_ch_end =CCFN ; -else - dma_common_ch_end =CCDN ; -return 0 ; } - -static int __init omap2_system_dma_init (void ) -{ -return omap_hwmod_for_each_by_class ("dma" , - omap2_system_dma_init_dev,NULL ); -}omap_arch_initcall (omap2_system_dma_init);
arch/arm/mach-omap2/omap_device.c +0 -170
176 lines not on this page · raw message
arch/arm/mach-omap2/omap_device.h +0 -4
@@ -68,10 +68,6 @@ int omap_device_idle(struct platform_device *pdev);/* Core code interface */ -struct platform_device *omap_device_build (const char *pdev_name,int pdev_id, -struct omap_hwmod *oh,void *pdata, -int pdata_len); -struct omap_device *omap_device_alloc (struct platform_device *pdev,struct omap_hwmod **ohs,int oh_cnt);void omap_device_delete (struct omap_device *od);
Signature · 1 line
2.24.1
Tony Lindgren
maintainerPATCH 14/14 ARM: OMAP2+: Drop legacy platform data for sdma
In reply to Tony LindgrenWe can now probe devices with ti-sysc interconnect driver and dts data. Let's drop the related platform data and custom ti,hwmods dts property.
As we're just dropping data, and the early platform data init is based on the custom ti,hwmods property, we want to drop both the platform data and ti,hwmods property in a single patch.
--- arch/arm/boot/dts/dra7-l4.dtsi | 1 - arch/arm/boot/dts/omap2.dtsi | 1 - arch/arm/boot/dts/omap3.dtsi | 1 - arch/arm/boot/dts/omap4-l4.dtsi | 1 - arch/arm/boot/dts/omap5-l4.dtsi | 1 - arch/arm/mach-omap2/omap_hwmod_2420_data.c | 26 -------- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 26 -------- .../mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 18 ------ arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 53 ---------------- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 61 ------------------- arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 53 ---------------- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 53 ---------------- arch/arm/mach-omap2/omap_hwmod_common_data.h | 1 - 13 files changed, 296 deletions(-)
arch/arm/boot/dts/dra7-l4.dtsi +0 -1
@@ -186,7 +186,6 @@ cm_core_clockdomains: clockdomains { target-module@56000 { /* 0x4a056000, ap 9 02.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "dma_system"; reg = <0x56000 0x4>, <0x5602c 0x4>, <0x56028 0x4>;
arch/arm/boot/dts/omap2.dtsi +0 -1
@@ -82,7 +82,6 @@ intc: interrupt-controller@1 { target-module@48056000 { compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "dma"; reg = <0x48056000 0x4>, <0x4805602c 0x4>, <0x48056028 0x4>;
arch/arm/boot/dts/omap3.dtsi +0 -1
@@ -208,7 +208,6 @@ intc: interrupt-controller@48200000 { target-module@48056000 { compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "dma"; reg = <0x48056000 0x4>, <0x4805602c 0x4>, <0x48056028 0x4>;
arch/arm/boot/dts/omap4-l4.dtsi +0 -1
@@ -136,7 +136,6 @@ cm2_clockdomains: clockdomains { target-module@56000 { /* 0x4a056000, ap 7 0a.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "dma_system"; reg = <0x56000 0x4>, <0x5602c 0x4>, <0x56028 0x4>;
arch/arm/boot/dts/omap5-l4.dtsi +0 -1
@@ -213,7 +213,6 @@ dwc3: dwc3@10000 { target-module@56000 { /* 0x4a056000, ap 7 02.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "dma_system"; reg = <0x56000 0x4>, <0x5602c 0x4>, <0x56028 0x4>;
arch/arm/mach-omap2/omap_hwmod_2420_data.c +0 -26
@@ -11,7 +11,6 @@*/ #include <linux/platform_data/i2c-omap.h> -#include <linux/omap-dma.h> #include "omap_hwmod.h" #include "l3_2xxx.h"
@@ -126,13 +125,6 @@ static struct omap_hwmod omap2420_i2c2_hwmod = { .flags = HWMOD_16BIT_REG, }; -static struct omap_hwmod omap2420_dma_system_hwmod = { - .name ="dma" , - .class = &omap2xxx_dma_hwmod_class, - .main_clk ="core_l3_ck" , - .flags =HWMOD_NO_IDLEST , -}; -/* mailbox */ static struct omap_hwmod omap2420_mailbox_hwmod = { .name ="mailbox" ,
@@ -320,22 +312,6 @@ static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; -/* dma_system -> L3 */ -static struct omap_hwmod_ocp_if omap2420_dma_system__l3 = { - .master = &omap2420_dma_system_hwmod, - .slave = &omap2xxx_l3_main_hwmod, - .clk ="core_l3_ck" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; - -/* l4_core -> dma_system */ -static struct omap_hwmod_ocp_if omap2420_l4_core__dma_system = { - .master = &omap2xxx_l4_core_hwmod, - .slave = &omap2420_dma_system_hwmod, - .clk ="sdma_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; -/* l4_core -> mailbox */ static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = { .master = &omap2xxx_l4_core_hwmod,
@@ -427,8 +403,6 @@ static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = { &omap2420_l4_wkup__gpio2, &omap2420_l4_wkup__gpio3, &omap2420_l4_wkup__gpio4, - &omap2420_dma_system__l3, - &omap2420_l4_core__dma_system, &omap2420_l4_core__mailbox, &omap2420_l4_core__mcbsp1, &omap2420_l4_core__mcbsp2,
arch/arm/mach-omap2/omap_hwmod_2430_data.c +0 -26
@@ -12,7 +12,6 @@#include <linux/platform_data/i2c-omap.h> #include <linux/platform_data/hsmmc-omap.h> -#include <linux/omap-dma.h> #include "omap_hwmod.h" #include "l3_2xxx.h"
@@ -121,13 +120,6 @@ static struct omap_hwmod omap2430_gpio5_hwmod = { .class = &omap2xxx_gpio_hwmod_class, }; -static struct omap_hwmod omap2430_dma_system_hwmod = { - .name ="dma" , - .class = &omap2xxx_dma_hwmod_class, - .main_clk ="core_l3_ck" , - .flags =HWMOD_NO_IDLEST , -}; -/* mailbox */ static struct omap_hwmod omap2430_mailbox_hwmod = { .name ="mailbox" ,
@@ -500,22 +492,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__gpio5 = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; -/* dma_system -> L3 */ -static struct omap_hwmod_ocp_if omap2430_dma_system__l3 = { - .master = &omap2430_dma_system_hwmod, - .slave = &omap2xxx_l3_main_hwmod, - .clk ="core_l3_ck" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; - -/* l4_core -> dma_system */ -static struct omap_hwmod_ocp_if omap2430_l4_core__dma_system = { - .master = &omap2xxx_l4_core_hwmod, - .slave = &omap2430_dma_system_hwmod, - .clk ="sdma_ick" , - .user =OCP_USER_MPU |OCP_USER_SDMA , -}; -/* l4_core -> mailbox */ static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = { .master = &omap2xxx_l4_core_hwmod,
@@ -627,8 +603,6 @@ static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = { &omap2430_l4_wkup__gpio3, &omap2430_l4_wkup__gpio4, &omap2430_l4_core__gpio5, - &omap2430_dma_system__l3, - &omap2430_l4_core__dma_system, &omap2430_l4_core__mailbox, &omap2430_l4_core__mcbsp1, &omap2430_l4_core__mcbsp2,
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c +0 -18
@@ -7,7 +7,6 @@*/ #include <linux/types.h> -#include <linux/omap-dma.h> #include "omap_hwmod.h" #include "omap_hwmod_common_data.h"
@@ -95,23 +94,6 @@ struct omap_hwmod_class omap2xxx_gpio_hwmod_class = { .sysc = &omap2xxx_gpio_sysc, }; -/* system dma */ -static struct omap_hwmod_class_sysconfig omap2xxx_dma_sysc = { - .rev_offs =0x0000 , - .sysc_offs =0x002c , - .syss_offs =0x0028 , - .sysc_flags = (SYSC_HAS_SOFTRESET |SYSC_HAS_MIDLEMODE | -SYSC_HAS_CLOCKACTIVITY |SYSC_HAS_EMUFREE | -SYSC_HAS_AUTOIDLE |SYSS_HAS_RESET_STATUS ), - .idlemodes = (MSTANDBY_FORCE |MSTANDBY_NO |MSTANDBY_SMART ), - .sysc_fields = &omap_hwmod_sysc_type1, -}; - -struct omap_hwmod_class omap2xxx_dma_hwmod_class = { - .name ="dma" , - .sysc = &omap2xxx_dma_sysc, -}; -/* * 'mailbox' class * mailbox module allowing communication between the on-chip processors
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 -53
77 lines not on this page · raw message
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -61
103 lines not on this page · raw message
arch/arm/mach-omap2/omap_hwmod_54xx_data.c +0 -53
83 lines not on this page · raw message
arch/arm/mach-omap2/omap_hwmod_7xx_data.c +0 -53
83 lines not on this page · raw message
arch/arm/mach-omap2/omap_hwmod_common_data.h +0 -1
@@ -98,7 +98,6 @@ extern struct omap_hwmod_class omap2_hdq1w_class;extern struct omap_hwmod_class omap2xxx_timer_hwmod_class;extern struct omap_hwmod_class omap2xxx_wd_timer_hwmod_class;extern struct omap_hwmod_class omap2xxx_gpio_hwmod_class; -extern struct omap_hwmod_class omap2xxx_dma_hwmod_class;extern struct omap_hwmod_class omap2xxx_mailbox_hwmod_class;extern struct omap_hwmod_class omap2xxx_mcspi_class;
Signature · 1 line
2.24.1
Tony Lindgren
maintainerRe: [PATCH 12/14] dmaengine: ti: omap-dma: Use cpu notifier to block idle for omap2
In reply to Tony LindgrenQuoted 5 lines · Tony Lindgren
drivers/dma/ti/omap-dma.c +2
-0+case CPU_CLUSTER_PM_ENTER : +while (1 ) {
drivers/dma/ti/omap-dma.c static void omap_dma_free(struct omap_dmadev *od) · line 1547
Quoted 10 lines
drivers/dma/ti/omap-dma.c +10
-0+ lch =find_next_bit (od->lch_bitmap, od->lch_count, + lch +1 ); +if (lch >= od->lch_count) +break ; + c = od->lch_map[lch]; +if (!c) +continue ; +if (omap_dma_chan_read (c,CCR ) &CCR_ENABLE ) { +pr_info ("XXX %s: lch%i busy\n" , __func__, lch); +return NOTIFY_BAD ;
Oops the pr_info line here can be dropped :)
Regards,
Tony
Hi Tony,
Quoted 11 lines · Tony Lindgren
Hi all,
This series finally removes the legacy sdma code for omaps booting with devicetree. The legacy sdma code is still left for omap1, but makes further work a bit easier.
We do the removal of legacy sdma code with the following steps:
- Prepare for platform data removal by probing sdma with device tree data for the interconnect target module
Quoted 8 lines
- Drop unused code and legacy interrupt code for omap2 and later
- Update dmaengine driver to use device tree match data and add missing features
- Allocate logical channels directly in the dmaengine driver
- Drop legacy platform init and data
Thanks for doing this!
First things first:
But I was only able to test it with CPU_IDLE=n otherwise (even w/o this series) I got a flood of (PandaBoard-ES):
[ 315.995819] ------------[ cut here ]------------ [ 316.000457] WARNING: CPU: 0 PID: 0 at drivers/bus/omap_l3_noc.c:141 l3_interrupt_handler+0x264/0x384 [ 316.009613] 44000000.ocp:L3 Standard Error: MASTER USBHOSTHS TARGET ABE (Read Link): At Address: 0x00000000 : Data Access in User mode during Functional access [ 316.023925] Modules linked in: [ 316.027008] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 5.5.0-rc1-00016-g239582d9ad0c #1078 [ 316.036590] Hardware name: Generic OMAP4 (Flattened Device Tree) [ 316.042633] [<c01105ac>] (unwind_backtrace) from [<c010b81c>] (show_stack+0x10/0x14) [ 316.050415] [<c010b81c>] (show_stack) from [<c092dbf4>] (dump_stack+0xc0/0xdc) [ 316.057678] [<c092dbf4>] (dump_stack) from [<c01366b0>] (__warn+0xa8/0xd4) [ 316.064575] [<c01366b0>] (__warn) from [<c0136770>] (warn_slowpath_fmt+0x94/0xbc) [ 316.072204] [<c0136770>] (warn_slowpath_fmt) from [<c04b27c4>] (l3_interrupt_handler+0x264/0x384) [ 316.081176] [<c04b27c4>] (l3_interrupt_handler) from [<c018b420>] (__handle_irq_event_percpu+0x3c/0x128) [ 316.090698] [<c018b420>] (__handle_irq_event_percpu) from [<c018b53c>] (handle_irq_event_percpu+0x30/0x84) [ 316.100433] [<c018b53c>] (handle_irq_event_percpu) from [<c018b5c8>] (handle_irq_event+0x38/0x5c) [ 316.109344] [<c018b5c8>] (handle_irq_event) from [<c018fdec>] (handle_fasteoi_irq+0xc8/0x180) [ 316.117889] [<c018fdec>] (handle_fasteoi_irq) from [<c018a674>] (generic_handle_irq+0x20/0x34) [ 316.127197] [<c018a674>] (generic_handle_irq) from [<c018ac44>] (__handle_domain_irq+0x64/0xdc) [ 316.135955] [<c018ac44>] (__handle_domain_irq) from [<c04b0c44>] (gic_handle_irq+0x40/0x84) [ 316.144317] [<c04b0c44>] (gic_handle_irq) from [<c0101aac>] (__irq_svc+0x6c/0xa8) [ 316.151855] Exception stack(0xc0f01e10 to 0xc0f01e58) [ 316.157348] 1e00: ffffabcf 2e645000 00000000 c0e64040 [ 316.166107] 1e20: 00000082 c0e63ffc c0f052c0 c0f00000 00000001 ee80c000 c0f052c0 c0fa19c4 [ 316.174316] 1e40: 00000000 c0f01e60 c013bc44 c0102278 60000153 ffffffff [ 316.181121] [<c0101aac>] (__irq_svc) from [<c0102278>] (__do_softirq+0x78/0x280) [ 316.188568] [<c0102278>] (__do_softirq) from [<c013bc44>] (irq_exit+0xa8/0xec) [ 316.195831] [<c013bc44>] (irq_exit) from [<c018ac4c>] (__handle_domain_irq+0x6c/0xdc) [ 316.203674] [<c018ac4c>] (__handle_domain_irq) from [<c04b0c44>] (gic_handle_irq+0x40/0x84) [ 316.213134] [<c04b0c44>] (gic_handle_irq) from [<c0101aac>] (__irq_svc+0x6c/0xa8) [ 316.221130] Exception stack(0xc0f01ee8 to 0xc0f01f30) [ 316.226196] 1ee0: 00000000 00000000 00010001 ffffffff eef01580 00000002 [ 316.234405] 1f00: ef4a8678 c0f0b750 c0f05124 eef0158c c0f05244 c0fa19c4 00000010 c0f01f38 [ 316.242645] 1f20: ef4a86e8 c0773734 60000153 ffffffff [ 316.247711] [<c0101aac>] (__irq_svc) from [<c0773734>] (cpuidle_enter_state_coupled+0x2e4/0x428) [ 316.256530] [<c0773734>] (cpuidle_enter_state_coupled) from [<c0770be8>] (cpuidle_enter+0x44/0x5c) [ 316.265533] [<c0770be8>] (cpuidle_enter) from [<c0163818>] (do_idle+0x1d8/0x2a4) [ 316.272949] [<c0163818>] (do_idle) from [<c0163bc0>] (cpu_startup_entry+0x18/0x20) [ 316.280578] [<c0163bc0>] (cpu_startup_entry) from [<c0e00d04>] (start_kernel+0x3d0/0x46c) [ 316.288787] ---[ end trace be4a25d25ab32771 ]---
- Péter
Quoted 54 lines
The patches are against v5.5-rc1, and need the following fixes:
2c81f0f6d3f5("bus: ti-sysc: Fix iterating over clocks")e709ed70d122("bus: ti-sysc: Fix missing reset delay handling")93c60483b5fe("bus: ti-sysc: Fix missing force mstandby quirk handling")90bdfa0b05e3("ARM: OMAP2+: Fixti_sysc_find_one_clockdomainto check forto_clk_hw_omap")To make testing easier, I've also pushed out a testing branch at [0][1].
Regards,
Tony
[0]
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.gitomap-for-v5.6/sdma-testing
[1] https://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git/log/?h=omap-for-v5.6/sdma-testingTony Lindgren (14):
ARM: dts: Add generic compatible for omap sdma instances
ARM: dts: Configure interconnect target module for omap2 sdma
ARM: dts: Configure interconnect target module for omap3 sdma
ARM: OMAP2+: Drop unused sdma functions
ARM: OMAP2+: Drop sdma interrupt handling for mach-omap2
ARM: OMAP2+: Configure sdma capabilities directly
ARM: OMAP2+: Configuredma_plat_infodirectly and dropdma_dev_attr
dmaengine: ti: omap-dma: Add device tree match data and use it for
cpu_pm
dmaengine: ti: omap-dma: Configure global priority register directly
dmaengine: ti: omap-dma: Pass sdma auxdata to driver and use it
dmaengine: ti: omap-dma: Allocate channels directly
dmaengine: ti: omap-dma: Use cpu notifier to block idle for omap2
ARM: OMAP2+: Drop legacy init for sdma
ARM: OMAP2+: Drop legacy platform data for sdmaarch/arm/boot/dts/dra7-l4.dtsi | 3 +- arch/arm/boot/dts/omap2.dtsi | 43 +- arch/arm/boot/dts/omap2430.dtsi | 4 + arch/arm/boot/dts/omap3-n900.dts | 5 + arch/arm/boot/dts/omap3.dtsi | 46 +- arch/arm/boot/dts/omap36xx.dtsi | 4 + arch/arm/boot/dts/omap4-l4.dtsi | 3 +- arch/arm/boot/dts/omap5-l4.dtsi | 3 +- arch/arm/mach-omap2/common.h | 3 + arch/arm/mach-omap2/dma.c | 119 +---- arch/arm/mach-omap2/omap_device.c | 170 ------- arch/arm/mach-omap2/omap_device.h | 4 - arch/arm/mach-omap2/omap_hwmod_2420_data.c | 34 -- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 34 -- .../mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 18 - arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 61 --- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 69 --- arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 61 --- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 61 ---
Quoted 9 lines
arch/arm/mach-omap2/omap_hwmod_common_data.h | 1 - arch/arm/mach-omap2/pdata-quirks.c | 1 + arch/arm/mach-omap2/pm24xx.c | 22 +- arch/arm/mach-omap2/pm34xx.c | 5 - arch/arm/plat-omap/dma.c | 471 +----------------- drivers/dma/ti/omap-dma.c | 288 ++++++++++- include/linux/omap-dma.h | 18 - 26 files changed, 391 insertions(+), 1160 deletions(-)
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Tony Lindgren
maintainerQuoted 4 lines · Peter Ujfalusi
Thanks for doing this!
First things first:Acked-by Peter Ujfalusi <[email protected]>Tested-by Peter Ujfalusi <[email protected]>
Thanks for testing!
Quoted 6 lines
But I was only able to test it with CPU_IDLE=n otherwise (even w/o this series) I got a flood of (PandaBoard-ES):
[ 315.995819] ------------[ cut here ]------------ [ 316.000457] WARNING: CPU: 0 PID: 0 at drivers/bus/omap_l3_noc.c:141 l3_interrupt_handler+0x264/0x384 [ 316.009613] 44000000.ocp:L3 Standard Error: MASTER USBHOSTHS TARGET ABE (Read Link): At Address: 0x00000000 : Data Access in User mode during Functional access
Can you please email me your .config and I'll take a look?
I'm not seeing that with pandaboard es here at least with omap2plus_defconfig.
Regards,
Tony
Re: [PATCH 08/14] dmaengine: ti: omap-dma: Add device tree match data and use it for cpu_pm
In reply to Tony LindgrenQuoted 8 lines · Tony Lindgren
With old DMA code disabled for handling DMA requests for device tree based SoCs, we can move omap3 specific context save and restore to the dmaengine driver.
Let's do this by adding
cpu_pmnotifier handling to save and restore context, and enable it based on device tree match data. This way we can use the match data later to configure more SoC specific features later on too.
Quoted 6 lines
Note that we only clear the channels in use while the platform code also clears reserved channels 0 and 1 on high-security SoCs. Based on testing on n900, this is not needed though and the system idles just fine.
With the dmaengine driver handling context save and restore, we must now remove the old custom calls for context save and restore.
Signature · 1 line
~Vinod
Re: [PATCH 09/14] dmaengine: ti: omap-dma: Configure global priority register directly
In reply to Tony LindgrenQuoted 2 lines · Tony Lindgren
We can move the global priority register configuration to the dmaengine driver and configure it based on the
of_device_idmatch data.
Signature · 1 line
~Vinod
Re: [PATCH 10/14] dmaengine: ti: omap-dma: Pass sdma auxdata to driver and use it
In reply to Tony LindgrenQuoted 2 lines · Tony Lindgren
We can now start passing sdma auxdata to the dmaengine driver to start removing the platform based sdma init.
Signature · 1 line
~Vinod
Re: [PATCH 11/14] dmaengine: ti: omap-dma: Allocate channels directly
In reply to Tony LindgrenQuoted 2 lines · Tony Lindgren
With the legacy IRQ handling gone, we can now start allocating channels directly in the dmaengine driver for device tree based SoCs.
Signature · 1 line
~Vinod
Re: [PATCH 12/14] dmaengine: ti: omap-dma: Use cpu notifier to block idle for omap2
In reply to Tony LindgrenQuoted 10 lines · Tony Lindgren
Quoted 9 lines · Tony Lindgren
drivers/dma/ti/omap-dma.c +6
-0+case CPU_CLUSTER_PM_ENTER : +while (1 ) { + lch =find_next_bit (od->lch_bitmap, od->lch_count, + lch +1 ); +if (lch >= od->lch_count) +break ;
Quoted 8 lines
drivers/dma/ti/omap-dma.c static void omap_dma_free(struct omap_dmadev *od) · line 1547
Quoted 6 lines
drivers/dma/ti/omap-dma.c +6
-0+ c = od->lch_map[lch]; +if (!c) +continue ; +if (omap_dma_chan_read (c,CCR ) &CCR_ENABLE ) { +pr_info ("XXX %s: lch%i busy\n" , __func__, lch); +return NOTIFY_BAD ;Oops the
pr_infoline here can be dropped :)
feel free to add my after after fixing :)
Signature · 1 line
~Vinod