ARM: at91/tc: DT support
Subsystems (7)
cover ARM: at91/tc: DT support
This patch series adds the device tree support to the Timer Counter library and user. The only mainlined user is the clocksource tcb_clksrc.
This series goes on top of current work-in-progress for AIC irqdomain/DT support:
"[PATCH 0/6] ARM: at91: irqdomain and device tree for AIC and GPIO" and particularly:
"[PATCH v4 1/6] ARM: at91/aic: add irq domain and device tree support"
Uwe, I have added you to the recipient list because you have already seen a previous revision of the "32 bit enablement" patch ;-)
Nicolas Ferre (3):
ARM: at91/tclib: take iomem size from resource
ARM: at91/tc: add device tree support to atmel_tclib
ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter
arch/arm/boot/dts/at91sam9g20.dtsi | 14 +++++ arch/arm/boot/dts/at91sam9g45.dtsi | 15 +++++ arch/arm/mach-at91/at91sam9260.c | 7 ++ arch/arm/mach-at91/at91sam9260_devices.c | 21 ++++++- arch/arm/mach-at91/at91sam9g45.c | 3 + arch/arm/mach-at91/at91sam9g45_devices.c | 21 ++++++- drivers/clocksource/tcb_clksrc.c | 90 ++++++++++++++++++++--------- drivers/misc/atmel_tclib.c | 64 ++++++++++++++++++--- include/linux/atmel_tc.h | 10 +++ 9 files changed, 203 insertions(+), 42 deletions(-)
Best regards,
Signature · 1 line
Nicolas Ferre
PATCH 1/3 ARM: at91/tclib: take iomem size from resource
Requesting iomem region and ioremaping is now done using the resource size specified instead of a constant value.
Each <SoC>_device.c file is modified accordingly to reflect actual user interface size.
--- arch/arm/mach-at91/at91sam9260_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9g45_devices.c | 4 ++-- drivers/misc/atmel_tclib.c | 17 +++++++++-------- 3 files changed, 13 insertions(+), 12 deletions(-)
arch/arm/mach-at91/at91sam9260_devices.c +2 -2
@@ -641,7 +641,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)static struct resource tcb0_resources[] = { [0 ] = { .start =AT91SAM9260_BASE_TCB0 , - .end =AT91SAM9260_BASE_TCB0 +SZ_16K -1 , + .end =AT91SAM9260_BASE_TCB0 +SZ_256 -1 , .flags =IORESOURCE_MEM , }, [1 ] = {
@@ -671,7 +671,7 @@ static struct platform_device at91sam9260_tcb0_device = {static struct resource tcb1_resources[] = { [0 ] = { .start =AT91SAM9260_BASE_TCB1 , - .end =AT91SAM9260_BASE_TCB1 +SZ_16K -1 , + .end =AT91SAM9260_BASE_TCB1 +SZ_256 -1 , .flags =IORESOURCE_MEM , }, [1 ] = {
arch/arm/mach-at91/at91sam9g45_devices.c +2 -2
@@ -957,7 +957,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}static struct resource tcb0_resources[] = { [0 ] = { .start =AT91SAM9G45_BASE_TCB0 , - .end =AT91SAM9G45_BASE_TCB0 +SZ_16K -1 , + .end =AT91SAM9G45_BASE_TCB0 +SZ_256 -1 , .flags =IORESOURCE_MEM , }, [1 ] = {
@@ -978,7 +978,7 @@ static struct platform_device at91sam9g45_tcb0_device = {static struct resource tcb1_resources[] = { [0 ] = { .start =AT91SAM9G45_BASE_TCB1 , - .end =AT91SAM9G45_BASE_TCB1 +SZ_16K -1 , + .end =AT91SAM9G45_BASE_TCB1 +SZ_256 -1 , .flags =IORESOURCE_MEM , }, [1 ] = {
drivers/misc/atmel_tclib.c +9 -8
@@ -9,10 +9,6 @@#include <linux/slab.h> #include <linux/export.h> -/* Number of bytes to reserve for the iomem resource */ -#define ATMEL_TC_IOMEM_SIZE 256 - -/* * This is a thin library to solve the problem of how to portably allocate * one of the TC blocks. For simplicity, it doesn't currently expect to
@@ -48,6 +44,7 @@ struct atmel_tc *atmel_tc_alloc(unsigned block, const char *name)struct atmel_tc *tc;struct platform_device *pdev =NULL ;struct resource *r; +size_t size;spin_lock (&tc_list_lock);list_for_each_entry (tc, &tc_list, node) {
@@ -61,11 +58,15 @@ struct atmel_tc *atmel_tc_alloc(unsigned block, const char *name) goto fail; r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - r =request_mem_region (r->start,ATMEL_TC_IOMEM_SIZE , name);if (!r) goto fail; - tc->regs =ioremap (r->start,ATMEL_TC_IOMEM_SIZE ); + size =resource_size (r); + r =request_mem_region (r->start, size, name); +if (!r) + goto fail; + + tc->regs =ioremap (r->start, size);if (!tc->regs) goto fail_ioremap;
@@ -76,7 +77,7 @@ out:return tc; fail_ioremap: -release_mem_region (r->start,ATMEL_TC_IOMEM_SIZE ); +release_mem_region (r->start, size); fail: tc =NULL ; goto out;
@@ -96,7 +97,7 @@ void atmel_tc_free(struct atmel_tc *tc)spin_lock (&tc_list_lock);if (tc->regs) {iounmap (tc->regs); -release_mem_region (tc->iomem->start,ATMEL_TC_IOMEM_SIZE ); +release_mem_region (tc->iomem->start,resource_size (tc->iomem)); tc->regs =NULL ; tc->iomem =NULL ; }
Signature · 1 line
1.7.5.4
PATCH 1/3 ARM: at91/tclib: take iomem size from resource
Quoted 7 lines · Nicolas Ferre
Requesting iomem region and ioremaping is now done using the resource size specified instead of a constant value.
Each <SoC>_device.c file is modified accordingly to reflect actual user interface size.
Signed-off-by Nicolas Ferre <[email protected]>
this is a fix shoud go for 3.3
Best Regards,
J.
PATCH 2/3 ARM: at91/tc: add device tree support to atmel_tclib
In reply to Nicolas FerreDevice tree support added to atmel_tclib: the generic Timer Counter library. This is used by the clocksource/clockevent driver tcb_clksrc.
The current DT enabled platforms are also modified to use it:
- .dtsi files are modified to add Timer Counter Block entries
- alias are created to allow identification of each block
- clkdev lookup tables are added for clocks identification.
--- arch/arm/boot/dts/at91sam9g20.dtsi | 14 ++++++++++++++ arch/arm/boot/dts/at91sam9g45.dtsi | 15 +++++++++++++++ arch/arm/mach-at91/at91sam9260.c | 7 +++++++ arch/arm/mach-at91/at91sam9260_devices.c | 17 +++++++++++++++++ arch/arm/mach-at91/at91sam9g45.c | 3 +++ arch/arm/mach-at91/at91sam9g45_devices.c | 17 +++++++++++++++++ drivers/misc/atmel_tclib.c | 27 +++++++++++++++++++++++++-- 7 files changed, 98 insertions(+), 2 deletions(-)
arch/arm/boot/dts/at91sam9g20.dtsi +14 -0
@@ -26,6 +26,8 @@ gpio0 = &pioA; gpio1 = &pioB; gpio2 = &pioC; + tcb0 = &tcb0; + tcb1 = &tcb1; }; cpus { cpu at 0 {
@@ -63,6 +65,18 @@ interrupts = <1 4>; }; + tcb0: timer at fffa0000 { + compatible = "atmel,at91rm9200-tcb"; + reg = <0xfffa0000 0x100>; + interrupts = <17 4 18 4 19 4>; + }; + + tcb1: timer at fffdc000 { + compatible = "atmel,at91rm9200-tcb"; + reg = <0xfffdc000 0x100>; + interrupts = <26 4 27 4 28 4>; + }; + pioA: gpio at fffff400 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff400 0x100>;
arch/arm/boot/dts/at91sam9g45.dtsi +15 -0
@@ -27,6 +27,8 @@ gpio2 = &pioC; gpio3 = &pioD; gpio4 = &pioE; + tcb0 = &tcb0; + tcb1 = &tcb1; }; cpus { cpu at 0 {
@@ -64,6 +66,19 @@ interrupts = <1 4>; }; + + tcb0: timer at fff7c000 { + compatible = "atmel,at91rm9200-tcb"; + reg = <0xfff7c000 0x100>; + interrupts = <18 4>; + }; + + tcb1: timer at fffd4000 { + compatible = "atmel,at91rm9200-tcb"; + reg = <0xfffd4000 0x100>; + interrupts = <18 4>; + }; + dma: dma-controller at ffffec00 { compatible = "atmel,at91sam9g45-dma"; reg = <0xffffec00 0x200>;
arch/arm/mach-at91/at91sam9260.c +7 -0
@@ -208,6 +208,13 @@ static struct clk_lookup periph_clocks_lookups[] = {CLKDEV_CON_DEV_ID ("usart" ,"fffd0000.serial" , &usart3_clk),CLKDEV_CON_DEV_ID ("usart" ,"fffd4000.serial" , &usart4_clk),CLKDEV_CON_DEV_ID ("usart" ,"fffd8000.serial" , &usart5_clk), +/* more tc lookup table for DT entries */ +CLKDEV_CON_DEV_ID ("t0_clk" ,"fffa0000.timer" , &tc0_clk), +CLKDEV_CON_DEV_ID ("t1_clk" ,"fffa0000.timer" , &tc1_clk), +CLKDEV_CON_DEV_ID ("t2_clk" ,"fffa0000.timer" , &tc2_clk), +CLKDEV_CON_DEV_ID ("t0_clk" ,"fffdc000.timer" , &tc3_clk), +CLKDEV_CON_DEV_ID ("t1_clk" ,"fffdc000.timer" , &tc4_clk), +CLKDEV_CON_DEV_ID ("t2_clk" ,"fffdc000.timer" , &tc5_clk),/* fake hclk clock */ CLKDEV_CON_DEV_ID ("hclk" ,"at91_ohci" , &ohci_clk), CLKDEV_CON_ID("pioA", &pioA_clk),
arch/arm/mach-at91/at91sam9260_devices.c +17 -0
@@ -698,8 +698,25 @@ static struct platform_device at91sam9260_tcb1_device = { .num_resources = ARRAY_SIZE(tcb1_resources), }; +#if defined(CONFIG_OF ) +static struct of_device_id tcb_ids[] = { + { .compatible ="atmel,at91rm9200-tcb" }, + {/*sentinel*/ } +}; +#endif +static void __init at91_add_device_tc (void ) { +#if defined(CONFIG_OF ) +struct device_node *np; + + np =of_find_matching_node (NULL , tcb_ids); +if (np) { +of_node_put (np); +return ; + } +#endif +platform_device_register (&at91sam9260_tcb0_device);platform_device_register (&at91sam9260_tcb1_device); }
arch/arm/mach-at91/at91sam9g45.c +3 -0
@@ -230,6 +230,9 @@ static struct clk_lookup periph_clocks_lookups[] = {CLKDEV_CON_DEV_ID ("usart" ,"fff90000.serial" , &usart1_clk),CLKDEV_CON_DEV_ID ("usart" ,"fff94000.serial" , &usart2_clk),CLKDEV_CON_DEV_ID ("usart" ,"fff98000.serial" , &usart3_clk), +/* more tc lookup table for DT entries */ +CLKDEV_CON_DEV_ID ("t0_clk" ,"fff7c000.timer" , &tcb0_clk), +CLKDEV_CON_DEV_ID ("t0_clk" ,"fffd4000.timer" , &tcb0_clk),/* fake hclk clock */ CLKDEV_CON_DEV_ID ("hclk" ,"at91_ohci" , &uhphs_clk), CLKDEV_CON_ID("pioA", &pioA_clk),
arch/arm/mach-at91/at91sam9g45_devices.c +17 -0
@@ -995,8 +995,25 @@ static struct platform_device at91sam9g45_tcb1_device = { .num_resources = ARRAY_SIZE(tcb1_resources), }; +#if defined(CONFIG_OF ) +static struct of_device_id tcb_ids[] = { + { .compatible ="atmel,at91rm9200-tcb" }, + {/*sentinel*/ } +}; +#endif +static void __init at91_add_device_tc (void ) { +#if defined(CONFIG_OF ) +struct device_node *np; + + np =of_find_matching_node (NULL , tcb_ids); +if (np) { +of_node_put (np); +return ; + } +#endif +platform_device_register (&at91sam9g45_tcb0_device);platform_device_register (&at91sam9g45_tcb1_device); }
drivers/misc/atmel_tclib.c +25 -2
@@ -6,8 +6,10 @@#include <linux/ioport.h> #include <linux/kernel.h> #include <linux/platform_device.h> +#include <linux/module.h> #include <linux/slab.h> #include <linux/export.h> +#include <linux/of.h> /* * This is a thin library to solve the problem of how to portably allocate
@@ -48,7 +50,13 @@ struct atmel_tc *atmel_tc_alloc(unsigned block, const char *name)spin_lock (&tc_list_lock);list_for_each_entry (tc, &tc_list, node) { -if (tc->pdev->id == block) { +if (tc->pdev->dev.of_node) { +if (of_alias_get_id (tc->pdev->dev.of_node,"tcb" ) + == block) { + pdev = tc->pdev; +break ; + } + }else if (tc->pdev->id == block) { pdev = tc->pdev;break ; }
@@ -105,6 +113,18 @@ void atmel_tc_free(struct atmel_tc *tc) }EXPORT_SYMBOL_GPL (atmel_tc_free); +#if defined(CONFIG_OF ) +static const struct of_device_id atmel_tcb_dt_ids[] = { + { + .compatible ="atmel,at91rm9200-tcb" , + }, { +/* sentinel */ + } +}; + +MODULE_DEVICE_TABLE (of, atmel_tcb_dt_ids); +#endif +static int __init tc_probe (struct platform_device *pdev) {struct atmel_tc *tc;
@@ -154,7 +174,10 @@ static int __init tc_probe(struct platform_device *pdev) }static struct platform_driver tc_driver = { - .driver.name ="atmel_tcb" , + .driver = { + .name ="atmel_tcb" , + .of_match_table =of_match_ptr (atmel_tcb_dt_ids), + }, };static int __init tc_init (void )
Signature · 1 line
1.7.5.4
PATCH 2/3 ARM: at91/tc: add device tree support to atmel_tclib
Quoted 9 lines · Nicolas Ferre
Device tree support added to
atmel_tclib: the generic Timer Counter library. This is used by the clocksource/clockevent drivertcb_clksrc.The current DT enabled platforms are also modified to use it:
- .dtsi files are modified to add Timer Counter Block entries
- alias are created to allow identification of each block
- clkdev lookup tables are added for clocks identification.Signed-off-by Nicolas Ferre <[email protected]>
...
Quoted 5 lines
arch/arm/mach-at91/at91sam9g45_devices.c +0
-0
arch/arm/mach-at91/at91sam9g45_devices.c static struct platform_device at91sam9g45_tcb1_device = { · line 1004
Quoted 10 lines
arch/arm/mach-at91/at91sam9g45_devices.c +7
-0@@ -995,8 +995,25 @@ static struct platform_device at91sam9g45_tcb1_device = { .num_resources = ARRAY_SIZE(tcb1_resources), }; +#if defined(CONFIG_OF ) +static struct of_device_id tcb_ids[] = { + { .compatible ="atmel,at91rm9200-tcb" }, + {/*sentinel*/ } +}; +#endif +
Where is the documentation for this new binding? Every new binding must be documented in Documentation/devicetree/bindings, even if it is just a short file listing all the trivial (only reg and irq) bindings used by atmel devices.
Otherwise this looks fine and you can add my Acked-by:
g.
PATCH 3/3 ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter
In reply to Nicolas FerreSome SoC have a 32 bit variant of Timer Counter Blocks. We do not need the chaining of two 16 bit counters anymore for them.
The SoC nature is deduced from the device tree "compatible" string. For non-device-tree configurations, backward compatibility is maintained by using the default 16 bit counter configuration.
This patch addresses both the atmel_tclib and its user: tcb_clksrc clocksource.
--- drivers/clocksource/tcb_clksrc.c | 90 ++++++++++++++++++++++++++------------ drivers/misc/atmel_tclib.c | 20 ++++++++ include/linux/atmel_tc.h | 10 ++++ 3 files changed, 92 insertions(+), 28 deletions(-)
drivers/clocksource/tcb_clksrc.c +62 -28
@@ -19,6 +19,8 @@* - Two channels combine to create a free-running 32 bit counter * with a base rate of 5+ MHz, packaged as a clocksource (with * resolution better than 200 nsec). +* - Some chips support 32 bit counter. A single channel is used for +* this 32 bit free-running counter. the second channel is not used. * * - The third channel may be used to provide a 16-bit clockevent * source, used in either periodic or oneshot mode. This runs
@@ -54,6 +56,11 @@ static cycle_t tc_get_cycles(struct clocksource *cs)return (upper <<16 ) | lower; } +static cycle_t tc_get_cycles32 (struct clocksource *cs) +{ +return __raw_readl (tcaddr +ATMEL_TC_REG (0 ,CV )); +} +static struct clocksource clksrc = { .name ="tcb_clksrc" , .rating =200 ,
@@ -209,6 +216,48 @@ static void __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx)#endif +static void __init tcb_setup_dual_chan (struct atmel_tc *tc,int mck_divisor_idx) +{ +/* channel 0: waveform mode, input mclk/8, clock TIOA0 on overflow */ +__raw_writel (mck_divisor_idx/* likely divide-by-8 */ + |ATMEL_TC_WAVE + |ATMEL_TC_WAVESEL_UP /* free-run */ + |ATMEL_TC_ACPA_SET /* TIOA0 rises@0 */ + |ATMEL_TC_ACPC_CLEAR ,/* (duty cycle 50%) */ + tcaddr +ATMEL_TC_REG (0 ,CMR )); +__raw_writel (0x0000 , tcaddr +ATMEL_TC_REG (0 ,RA )); +__raw_writel (0x8000 , tcaddr +ATMEL_TC_REG (0 ,RC )); +__raw_writel (0xff , tcaddr +ATMEL_TC_REG (0 ,IDR ));/* no irqs */ +__raw_writel (ATMEL_TC_CLKEN , tcaddr +ATMEL_TC_REG (0 ,CCR )); + +/* channel 1: waveform mode, input TIOA0 */ +__raw_writel (ATMEL_TC_XC1 /* input: TIOA0 */ + |ATMEL_TC_WAVE + |ATMEL_TC_WAVESEL_UP ,/* free-run */ + tcaddr +ATMEL_TC_REG (1 ,CMR )); +__raw_writel (0xff , tcaddr +ATMEL_TC_REG (1 ,IDR ));/* no irqs */ +__raw_writel (ATMEL_TC_CLKEN , tcaddr +ATMEL_TC_REG (1 ,CCR )); + +/* chain channel 0 to channel 1*/ +__raw_writel (ATMEL_TC_TC1XC1S_TIOA0 , tcaddr +ATMEL_TC_BMR ); +/* then reset all the timers */ +__raw_writel (ATMEL_TC_SYNC , tcaddr +ATMEL_TC_BCR ); +} + +static void __init tcb_setup_single_chan (struct atmel_tc *tc,int mck_divisor_idx) +{ +/* channel 0: waveform mode, input mclk/8 */ +__raw_writel (mck_divisor_idx/* likely divide-by-8 */ + |ATMEL_TC_WAVE + |ATMEL_TC_WAVESEL_UP ,/* free-run */ + tcaddr +ATMEL_TC_REG (0 ,CMR )); +__raw_writel (0xff , tcaddr +ATMEL_TC_REG (0 ,IDR ));/* no irqs */ +__raw_writel (ATMEL_TC_CLKEN , tcaddr +ATMEL_TC_REG (0 ,CCR )); + +/* then reset all the timers */ +__raw_writel (ATMEL_TC_SYNC , tcaddr +ATMEL_TC_BCR ); +} +static int __init tcb_clksrc_init (void ) {static char bootinfo[]__initdata
@@ -260,34 +309,19 @@ static int __init tcb_clksrc_init(void) divided_rate /1000000 , ((divided_rate + 500000) % 1000000) / 1000); -/* tclib will give us three clocks no matter what the -* underlying platform supports. -*/ -clk_enable (tc->clk[1 ]); - -/* channel 0: waveform mode, input mclk/8, clock TIOA0 on overflow */ -__raw_writel (best_divisor_idx/* likely divide-by-8 */ - |ATMEL_TC_WAVE - |ATMEL_TC_WAVESEL_UP /* free-run */ - |ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */ - |ATMEL_TC_ACPC_CLEAR ,/* (duty cycle 50%) */ - tcaddr +ATMEL_TC_REG (0 ,CMR )); -__raw_writel (0x0000 , tcaddr +ATMEL_TC_REG (0 ,RA )); -__raw_writel (0x8000 , tcaddr +ATMEL_TC_REG (0 ,RC )); -__raw_writel (0xff , tcaddr +ATMEL_TC_REG (0 ,IDR ));/* no irqs */ -__raw_writel (ATMEL_TC_CLKEN , tcaddr +ATMEL_TC_REG (0 ,CCR )); - -/* channel 1: waveform mode, input TIOA0 */ -__raw_writel (ATMEL_TC_XC1 /* input: TIOA0 */ - |ATMEL_TC_WAVE - |ATMEL_TC_WAVESEL_UP ,/* free-run */ - tcaddr +ATMEL_TC_REG (1 ,CMR )); -__raw_writel (0xff , tcaddr +ATMEL_TC_REG (1 ,IDR ));/* no irqs */ -__raw_writel (ATMEL_TC_CLKEN , tcaddr +ATMEL_TC_REG (1 ,CCR )); - -/* chain channel 0 to channel 1, then reset all the timers */ -__raw_writel (ATMEL_TC_TC1XC1S_TIOA0 , tcaddr +ATMEL_TC_BMR ); -__raw_writel (ATMEL_TC_SYNC , tcaddr +ATMEL_TC_BCR ); +if (tc->tcb_config && tc->tcb_config->counter_width ==32 ) { +/* use apropriate function to read 32 bit counter */ + clksrc.read = tc_get_cycles32; +/* setup ony channel 0 */ +tcb_setup_single_chan (tc, best_divisor_idx); + }else { +/* tclib will give us three clocks no matter what the +* underlying platform supports. +*/ +clk_enable (tc->clk[1 ]); +/* setup both channel 0 & 1 */ +tcb_setup_dual_chan (tc, best_divisor_idx); + }/* and away we go! */ clocksource_register_hz (&clksrc, divided_rate);
drivers/misc/atmel_tclib.c +20 -0
@@ -114,9 +114,21 @@ void atmel_tc_free(struct atmel_tc *tc)EXPORT_SYMBOL_GPL (atmel_tc_free);#if defined(CONFIG_OF ) +static struct atmel_tcb_config tcb_rm9200_config = { + .counter_width =16 , +}; + +static struct atmel_tcb_config tcb_sam9x5_config = { + .counter_width =32 , +}; +static const struct of_device_id atmel_tcb_dt_ids[] = { { .compatible ="atmel,at91rm9200-tcb" , + .data = &tcb_rm9200_config, + }, { + .compatible ="atmel,at91sam9x5-tcb" , + .data = &tcb_sam9x5_config, }, {/* sentinel */ }
@@ -150,6 +162,14 @@ static int __init tc_probe(struct platform_device *pdev)return -EINVAL ; } +/* Now take SoC information if available */ +if (pdev->dev.of_node) { +const struct of_device_id *match; + match =of_match_node (atmel_tcb_dt_ids, pdev->dev.of_node); +if (match) + tc->tcb_config = match->data; + } + tc->clk[0 ] = clk; tc->clk[1 ] =clk_get (&pdev->dev,"t1_clk" );if (IS_ERR (tc->clk[1 ]))
include/linux/atmel_tc.h +10 -0
@@ -34,10 +34,19 @@struct clk ;/** +* struct atmel_tcb_config - SoC data for a Timer/Counter Block +* @counter_width: size in bits of a timer counter register +*/ +struct atmel_tcb_config { +size_t counter_width; +}; + +/** * struct atmel_tc - information about a Timer/Counter Block * @pdev: physical device * @iomem: resource associated with the I/O register * @regs: mapping through which the I/O registers can be accessed +* @tcb_config: configuration data from SoC * @irq: irq for each of the three channels * @clk: internal clock source for each of the three channels * @node: list node, for tclib internal use
@@ -54,6 +63,7 @@ struct atmel_tc {struct platform_device *pdev;struct resource *iomem;void __iomem *regs; +struct atmel_tcb_config *tcb_config;int irq[3 ];struct clk *clk[3 ];struct list_head node;
Signature · 1 line
1.7.5.4
PATCH 3/3 ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter
Quoted 11 lines · Nicolas Ferre
Some SoC have a 32 bit variant of Timer Counter Blocks. We do not need the chaining of two 16 bit counters anymore for them.
The SoC nature is deduced from the device tree "compatible" string. For non-device-tree configurations, backward compatibility is maintained by using the default 16 bit counter configuration.
This patch addresses both the
atmel_tcliband its user:tcb_clksrcclocksource.Signed-off-by Nicolas Ferre <[email protected]>
Best Regards,
J.
PATCH 3/3 ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter
In reply to Nicolas FerreQuoted 11 lines · Nicolas Ferre
Some SoC have a 32 bit variant of Timer Counter Blocks. We do not need the chaining of two 16 bit counters anymore for them.
The SoC nature is deduced from the device tree "compatible" string. For non-device-tree configurations, backward compatibility is maintained by using the default 16 bit counter configuration.
This patch addresses both the
atmel_tcliband its user:tcb_clksrcclocksource.Signed-off-by Nicolas Ferre <[email protected]>
Looks reasonable to me. One comment below, but otherwise:
drivers/misc/atmel_tclib.c void atmel_tc_free(struct atmel_tc *tc) · line 134
Quoted 10 lines
static const struct
of_device_idatmel_tcb_dt_ids[] = {drivers/misc/atmel_tclib.c +4
-0{ .compatible = "atmel,at91rm9200-tcb", + .data = &tcb_rm9200_config, + }, { + .compatible = "atmel,at91sam9x5-tcb", + .data = &tcb_sam9x5_config, }, { /* sentinel */ }
Using wildcards ('x') in compatible values is strongly discouraged. Use specific device names instead. You never know when a vendor may introduce another part number that fits with the wildcard, but isn't actually compatible.
Use the exact device name(s) and newer devices can claim compatibility with the old in the .dts file.
g.
PATCH 3/3 ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter
2012-01-28 19:31, Grant Likely skrev:
Quoted 16 lines · Nicolas Ferre
Quoted 11 lines
Some SoC have a 32 bit variant of Timer Counter Blocks. We do not need the chaining of two 16 bit counters anymore for them.
The SoC nature is deduced from the device tree "compatible" string. For non-device-tree configurations, backward compatibility is maintained by using the default 16 bit counter configuration.
This patch addresses both the
atmel_tcliband its user:tcb_clksrcclocksource.Signed-off-by Nicolas Ferre<[email protected]>Looks reasonable to me. One comment below, but otherwise:
Acked-by Grant Likely<[email protected]>
Quoted 14 lines
drivers/misc/atmel_tclib.c void atmel_tc_free(struct atmel_tc *tc) · line 134
Quoted 10 lines
static const struct of_device_id atmel_tcb_dt_ids[] = { { .compatible = "atmel,at91rm9200-tcb",drivers/misc/atmel_tclib.c +4
-0+ .data =&tcb_rm9200_config, + }, { + .compatible = "atmel,at91sam9x5-tcb", + .data =&tcb_sam9x5_config, }, {/* sentinel */ }Using wildcards ('x') in compatible values is strongly discouraged. Use specific device names instead. You never know when a vendor may introduce another part number that fits with the wildcard, but isn't actually compatible.
The SAM9x5 is a family of chips based on the same silicon.
* SAM9G15
* SAM9G25
* SAM9G35
* SAM9X25
* SAM9X35
I don't think 'x' is a wildcard, it is part of the name of the family.
There is another chip
* AT91SAM9G45
which is not a sam9x5 chip, even if it would fit, if the 'x' was a wildcard.
BR
ulf at emagii.com
Quoted 10 lines
Use the exact device name(s) and newer devices can claim compatibility with the old in the .dts file.
g.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel