diff mbox

[2/2] DaVinci: DM365: Enable DaVinci RTC support for DM365 EVM

Message ID 1257432725-12273-1-git-send-email-miguel.aguilar@ridgerun.com
State Not Applicable, archived
Headers show

Commit Message

miguel.aguilar@ridgerun.com Nov. 5, 2009, 2:52 p.m. UTC
From: Miguel Aguilar <miguel.aguilar@ridgerun.com>

The general structures are defined at DM365 SoC file and the specific
platform data structure for the EVM is defined at board file.

Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
---
 arch/arm/mach-davinci/board-dm365-evm.c    |    4 ++++
 arch/arm/mach-davinci/dm365.c              |   26 ++++++++++++++++++++++++++
 arch/arm/mach-davinci/include/mach/dm365.h |    3 +++
 arch/arm/mach-davinci/include/mach/irqs.h  |    1 +
 4 files changed, 34 insertions(+), 0 deletions(-)

Comments

Kevin Hilman Nov. 6, 2009, 2:20 a.m. UTC | #1
miguel.aguilar@ridgerun.com writes:

> From: Miguel Aguilar <miguel.aguilar@ridgerun.com>
>
> The general structures are defined at DM365 SoC file and the specific
> platform data structure for the EVM is defined at board file.
>
> Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>

Looks good, queuing in davinci-next.

Kevin

> ---
>  arch/arm/mach-davinci/board-dm365-evm.c    |    4 ++++
>  arch/arm/mach-davinci/dm365.c              |   26 ++++++++++++++++++++++++++
>  arch/arm/mach-davinci/include/mach/dm365.h |    3 +++
>  arch/arm/mach-davinci/include/mach/irqs.h  |    1 +
>  4 files changed, 34 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
> index 13b85ec..0d69abd 100644
> --- a/arch/arm/mach-davinci/board-dm365-evm.c
> +++ b/arch/arm/mach-davinci/board-dm365-evm.c
> @@ -484,6 +484,10 @@ static __init void dm365_evm_init(void)
>  	evm_init_cpld();
>  
>  	dm365_init_asp(&dm365_evm_snd_data);
> +
> +#ifdef CONFIG_RTC_DRV_DAVINCI
> +	dm365_init_rtc();
> +#endif
>  }
>  
>  static __init void dm365_evm_irq_init(void)
> diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
> index 2674438..cdfc12c 100644
> --- a/arch/arm/mach-davinci/dm365.c
> +++ b/arch/arm/mach-davinci/dm365.c
> @@ -700,6 +700,7 @@ static u8 dm365_default_priorities[DAVINCI_N_AINTC_IRQ] = {
>  	[IRQ_I2C]			= 3,
>  	[IRQ_UARTINT0]			= 3,
>  	[IRQ_UARTINT1]			= 3,
> +	[IRQ_DM365_RTCINT]		= 3,
>  	[IRQ_DM365_SPIINT0_0]		= 3,
>  	[IRQ_DM365_SPIINT3_0]		= 3,
>  	[IRQ_DM365_GPIO0]		= 3,
> @@ -835,6 +836,25 @@ static struct platform_device dm365_asp_device = {
>  	.resource	= dm365_asp_resources,
>  };
>  
> +static struct resource dm365_rtc_resources[] = {
> +	{
> +		.start = DM365_RTC_BASE,
> +		.end = DM365_RTC_BASE + SZ_1K - 1,
> +		.flags = IORESOURCE_MEM,
> +	},
> +	{
> +		.start = IRQ_DM365_RTCINT,
> +		.flags = IORESOURCE_IRQ,
> +	},
> +};
> +
> +static struct platform_device dm365_rtc_device = {
> +	.name = "rtc_davinci",
> +	.id = 0,
> +	.num_resources = ARRAY_SIZE(dm365_rtc_resources),
> +	.resource = dm365_rtc_resources,
> +};
> +
>  static struct map_desc dm365_io_desc[] = {
>  	{
>  		.virtual	= IO_VIRT,
> @@ -950,6 +970,12 @@ void __init dm365_init_asp(struct snd_platform_data *pdata)
>  	platform_device_register(&dm365_asp_device);
>  }
>  
> +void __init dm365_init_rtc(void)
> +{
> +	davinci_cfg_reg(DM365_INT_PRTCSS);
> +	platform_device_register(&dm365_rtc_device);
> +}
> +
>  void __init dm365_init(void)
>  {
>  	davinci_common_init(&davinci_soc_info_dm365);
> diff --git a/arch/arm/mach-davinci/include/mach/dm365.h b/arch/arm/mach-davinci/include/mach/dm365.h
> index 2291c0d..bcc2f0f 100644
> --- a/arch/arm/mach-davinci/include/mach/dm365.h
> +++ b/arch/arm/mach-davinci/include/mach/dm365.h
> @@ -25,7 +25,10 @@
>  #define DM365_EMAC_MDIO_OFFSET		(0x4000)
>  #define DM365_EMAC_CNTRL_RAM_SIZE	(0x2000)
>  
> +#define DM365_RTC_BASE			(0x01C69000)
> +
>  void __init dm365_init(void);
>  void __init dm365_init_asp(struct snd_platform_data *pdata);
> +void __init dm365_init_rtc(void);
>  
>  #endif /* __ASM_ARCH_DM365_H */
> diff --git a/arch/arm/mach-davinci/include/mach/irqs.h b/arch/arm/mach-davinci/include/mach/irqs.h
> index 3c918a7..354af71 100644
> --- a/arch/arm/mach-davinci/include/mach/irqs.h
> +++ b/arch/arm/mach-davinci/include/mach/irqs.h
> @@ -217,6 +217,7 @@
>  #define IRQ_DM365_SDIOINT0	23
>  #define IRQ_DM365_MMCINT1	27
>  #define IRQ_DM365_PWMINT3	28
> +#define IRQ_DM365_RTCINT	29
>  #define IRQ_DM365_SDIOINT1	31
>  #define IRQ_DM365_SPIINT0_0	42
>  #define IRQ_DM365_SPIINT3_0	43
> -- 
> 1.6.0.4

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---
miguel.aguilar@ridgerun.com Nov. 6, 2009, 3:44 p.m. UTC | #2
Kevin,

I just saw that you pushed this patch however you didn't include the 
modifications related to the file board-dm365-evm.c, Why?

Thanks,

Miguel Aguilar
Kevin Hilman wrote:
> miguel.aguilar@ridgerun.com writes:
> 
>> From: Miguel Aguilar <miguel.aguilar@ridgerun.com>
>>
>> The general structures are defined at DM365 SoC file and the specific
>> platform data structure for the EVM is defined at board file.
>>
>> Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
> 
> Looks good, queuing in davinci-next.
> 
> Kevin
> 
>> ---
>>  arch/arm/mach-davinci/board-dm365-evm.c    |    4 ++++
>>  arch/arm/mach-davinci/dm365.c              |   26 ++++++++++++++++++++++++++
>>  arch/arm/mach-davinci/include/mach/dm365.h |    3 +++
>>  arch/arm/mach-davinci/include/mach/irqs.h  |    1 +
>>  4 files changed, 34 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
>> index 13b85ec..0d69abd 100644
>> --- a/arch/arm/mach-davinci/board-dm365-evm.c
>> +++ b/arch/arm/mach-davinci/board-dm365-evm.c
>> @@ -484,6 +484,10 @@ static __init void dm365_evm_init(void)
>>  	evm_init_cpld();
>>  
>>  	dm365_init_asp(&dm365_evm_snd_data);
>> +
>> +#ifdef CONFIG_RTC_DRV_DAVINCI
>> +	dm365_init_rtc();
>> +#endif
>>  }
>>  
>>  static __init void dm365_evm_irq_init(void)
>> diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
>> index 2674438..cdfc12c 100644
>> --- a/arch/arm/mach-davinci/dm365.c
>> +++ b/arch/arm/mach-davinci/dm365.c
>> @@ -700,6 +700,7 @@ static u8 dm365_default_priorities[DAVINCI_N_AINTC_IRQ] = {
>>  	[IRQ_I2C]			= 3,
>>  	[IRQ_UARTINT0]			= 3,
>>  	[IRQ_UARTINT1]			= 3,
>> +	[IRQ_DM365_RTCINT]		= 3,
>>  	[IRQ_DM365_SPIINT0_0]		= 3,
>>  	[IRQ_DM365_SPIINT3_0]		= 3,
>>  	[IRQ_DM365_GPIO0]		= 3,
>> @@ -835,6 +836,25 @@ static struct platform_device dm365_asp_device = {
>>  	.resource	= dm365_asp_resources,
>>  };
>>  
>> +static struct resource dm365_rtc_resources[] = {
>> +	{
>> +		.start = DM365_RTC_BASE,
>> +		.end = DM365_RTC_BASE + SZ_1K - 1,
>> +		.flags = IORESOURCE_MEM,
>> +	},
>> +	{
>> +		.start = IRQ_DM365_RTCINT,
>> +		.flags = IORESOURCE_IRQ,
>> +	},
>> +};
>> +
>> +static struct platform_device dm365_rtc_device = {
>> +	.name = "rtc_davinci",
>> +	.id = 0,
>> +	.num_resources = ARRAY_SIZE(dm365_rtc_resources),
>> +	.resource = dm365_rtc_resources,
>> +};
>> +
>>  static struct map_desc dm365_io_desc[] = {
>>  	{
>>  		.virtual	= IO_VIRT,
>> @@ -950,6 +970,12 @@ void __init dm365_init_asp(struct snd_platform_data *pdata)
>>  	platform_device_register(&dm365_asp_device);
>>  }
>>  
>> +void __init dm365_init_rtc(void)
>> +{
>> +	davinci_cfg_reg(DM365_INT_PRTCSS);
>> +	platform_device_register(&dm365_rtc_device);
>> +}
>> +
>>  void __init dm365_init(void)
>>  {
>>  	davinci_common_init(&davinci_soc_info_dm365);
>> diff --git a/arch/arm/mach-davinci/include/mach/dm365.h b/arch/arm/mach-davinci/include/mach/dm365.h
>> index 2291c0d..bcc2f0f 100644
>> --- a/arch/arm/mach-davinci/include/mach/dm365.h
>> +++ b/arch/arm/mach-davinci/include/mach/dm365.h
>> @@ -25,7 +25,10 @@
>>  #define DM365_EMAC_MDIO_OFFSET		(0x4000)
>>  #define DM365_EMAC_CNTRL_RAM_SIZE	(0x2000)
>>  
>> +#define DM365_RTC_BASE			(0x01C69000)
>> +
>>  void __init dm365_init(void);
>>  void __init dm365_init_asp(struct snd_platform_data *pdata);
>> +void __init dm365_init_rtc(void);
>>  
>>  #endif /* __ASM_ARCH_DM365_H */
>> diff --git a/arch/arm/mach-davinci/include/mach/irqs.h b/arch/arm/mach-davinci/include/mach/irqs.h
>> index 3c918a7..354af71 100644
>> --- a/arch/arm/mach-davinci/include/mach/irqs.h
>> +++ b/arch/arm/mach-davinci/include/mach/irqs.h
>> @@ -217,6 +217,7 @@
>>  #define IRQ_DM365_SDIOINT0	23
>>  #define IRQ_DM365_MMCINT1	27
>>  #define IRQ_DM365_PWMINT3	28
>> +#define IRQ_DM365_RTCINT	29
>>  #define IRQ_DM365_SDIOINT1	31
>>  #define IRQ_DM365_SPIINT0_0	42
>>  #define IRQ_DM365_SPIINT3_0	43
>> -- 
>> 1.6.0.4



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---
Kevin Hilman Nov. 6, 2009, 4:35 p.m. UTC | #3
On Fri, Nov 6, 2009 at 7:44 AM, Miguel Aguilar
<miguel.aguilar@ridgerun.com> wrote:
> Kevin,
>
> I just saw that you pushed this patch however you didn't include the
> modifications related to the file board-dm365-evm.c, Why?
>

My fault.  Sorry about that.

Your RTC patch did not apply cleanly to davinci git master because it
had conflicts with the keypad driver.  The conflicts
were simple so I fixed them manually but didn't commit the manual
changes I made to the board file.

I fixed this in davinci-next and pushed a new master branch.

In the future, please make sure your patches apply to the current master branch.

Kevin

> Miguel Aguilar
> Kevin Hilman wrote:
>>
>> miguel.aguilar@ridgerun.com writes:
>>
>>> From: Miguel Aguilar <miguel.aguilar@ridgerun.com>
>>>
>>> The general structures are defined at DM365 SoC file and the specific
>>> platform data structure for the EVM is defined at board file.
>>>
>>> Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
>>
>> Looks good, queuing in davinci-next.
>>
>> Kevin
>>
>>> ---
>>>  arch/arm/mach-davinci/board-dm365-evm.c    |    4 ++++
>>>  arch/arm/mach-davinci/dm365.c              |   26
>>> ++++++++++++++++++++++++++
>>>  arch/arm/mach-davinci/include/mach/dm365.h |    3 +++
>>>  arch/arm/mach-davinci/include/mach/irqs.h  |    1 +
>>>  4 files changed, 34 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-davinci/board-dm365-evm.c
>>> b/arch/arm/mach-davinci/board-dm365-evm.c
>>> index 13b85ec..0d69abd 100644
>>> --- a/arch/arm/mach-davinci/board-dm365-evm.c
>>> +++ b/arch/arm/mach-davinci/board-dm365-evm.c
>>> @@ -484,6 +484,10 @@ static __init void dm365_evm_init(void)
>>>        evm_init_cpld();
>>>          dm365_init_asp(&dm365_evm_snd_data);
>>> +
>>> +#ifdef CONFIG_RTC_DRV_DAVINCI
>>> +       dm365_init_rtc();
>>> +#endif
>>>  }
>>>   static __init void dm365_evm_irq_init(void)
>>> diff --git a/arch/arm/mach-davinci/dm365.c
>>> b/arch/arm/mach-davinci/dm365.c
>>> index 2674438..cdfc12c 100644
>>> --- a/arch/arm/mach-davinci/dm365.c
>>> +++ b/arch/arm/mach-davinci/dm365.c
>>> @@ -700,6 +700,7 @@ static u8
>>> dm365_default_priorities[DAVINCI_N_AINTC_IRQ] = {
>>>        [IRQ_I2C]                       = 3,
>>>        [IRQ_UARTINT0]                  = 3,
>>>        [IRQ_UARTINT1]                  = 3,
>>> +       [IRQ_DM365_RTCINT]              = 3,
>>>        [IRQ_DM365_SPIINT0_0]           = 3,
>>>        [IRQ_DM365_SPIINT3_0]           = 3,
>>>        [IRQ_DM365_GPIO0]               = 3,
>>> @@ -835,6 +836,25 @@ static struct platform_device dm365_asp_device = {
>>>        .resource       = dm365_asp_resources,
>>>  };
>>>  +static struct resource dm365_rtc_resources[] = {
>>> +       {
>>> +               .start = DM365_RTC_BASE,
>>> +               .end = DM365_RTC_BASE + SZ_1K - 1,
>>> +               .flags = IORESOURCE_MEM,
>>> +       },
>>> +       {
>>> +               .start = IRQ_DM365_RTCINT,
>>> +               .flags = IORESOURCE_IRQ,
>>> +       },
>>> +};
>>> +
>>> +static struct platform_device dm365_rtc_device = {
>>> +       .name = "rtc_davinci",
>>> +       .id = 0,
>>> +       .num_resources = ARRAY_SIZE(dm365_rtc_resources),
>>> +       .resource = dm365_rtc_resources,
>>> +};
>>> +
>>>  static struct map_desc dm365_io_desc[] = {
>>>        {
>>>                .virtual        = IO_VIRT,
>>> @@ -950,6 +970,12 @@ void __init dm365_init_asp(struct snd_platform_data
>>> *pdata)
>>>        platform_device_register(&dm365_asp_device);
>>>  }
>>>  +void __init dm365_init_rtc(void)
>>> +{
>>> +       davinci_cfg_reg(DM365_INT_PRTCSS);
>>> +       platform_device_register(&dm365_rtc_device);
>>> +}
>>> +
>>>  void __init dm365_init(void)
>>>  {
>>>        davinci_common_init(&davinci_soc_info_dm365);
>>> diff --git a/arch/arm/mach-davinci/include/mach/dm365.h
>>> b/arch/arm/mach-davinci/include/mach/dm365.h
>>> index 2291c0d..bcc2f0f 100644
>>> --- a/arch/arm/mach-davinci/include/mach/dm365.h
>>> +++ b/arch/arm/mach-davinci/include/mach/dm365.h
>>> @@ -25,7 +25,10 @@
>>>  #define DM365_EMAC_MDIO_OFFSET         (0x4000)
>>>  #define DM365_EMAC_CNTRL_RAM_SIZE      (0x2000)
>>>  +#define DM365_RTC_BASE                 (0x01C69000)
>>> +
>>>  void __init dm365_init(void);
>>>  void __init dm365_init_asp(struct snd_platform_data *pdata);
>>> +void __init dm365_init_rtc(void);
>>>   #endif /* __ASM_ARCH_DM365_H */
>>> diff --git a/arch/arm/mach-davinci/include/mach/irqs.h
>>> b/arch/arm/mach-davinci/include/mach/irqs.h
>>> index 3c918a7..354af71 100644
>>> --- a/arch/arm/mach-davinci/include/mach/irqs.h
>>> +++ b/arch/arm/mach-davinci/include/mach/irqs.h
>>> @@ -217,6 +217,7 @@
>>>  #define IRQ_DM365_SDIOINT0     23
>>>  #define IRQ_DM365_MMCINT1      27
>>>  #define IRQ_DM365_PWMINT3      28
>>> +#define IRQ_DM365_RTCINT       29
>>>  #define IRQ_DM365_SDIOINT1     31
>>>  #define IRQ_DM365_SPIINT0_0    42
>>>  #define IRQ_DM365_SPIINT3_0    43
>>> --
>>> 1.6.0.4
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---
nsnehaprabha@ti.com Nov. 10, 2009, 10:11 p.m. UTC | #4
Miguel,

It seems like RTC driver does not work, if built as a module.

# insmod rtc-davinci.ko
insmod: error inserting 'rtc-davinci.ko': -1 No such device

I thought there was a comment about the usage of #ifdef CONFIG options in the board-dm365-evm.c, which should also take care of MODULE options - see below.

You may have to send an incremental patch update to the list. Similar issue exists with Keyscan driver as well. 

Thanks
Sneha

> -----Original Message-----
> From: Kevin Hilman [mailto:khilman@deeprootsystems.com]
> Sent: Friday, November 06, 2009 11:36 AM
> To: Miguel Aguilar
> Cc: Narnakaje, Snehaprabha; rtc-linux@googlegroups.com;
> todd.fischer@ridgerun.com; diego.dompe@ridgerun.com;
> clark.becker@ridgerun.com; santiago.nunez@ridgerun.com
> Subject: Re: [PATCH 2/2] DaVinci: DM365: Enable DaVinci RTC support for
> DM365 EVM
> 
> On Fri, Nov 6, 2009 at 7:44 AM, Miguel Aguilar
> <miguel.aguilar@ridgerun.com> wrote:
> > Kevin,
> >
> > I just saw that you pushed this patch however you didn't include the
> > modifications related to the file board-dm365-evm.c, Why?
> >
> 
> My fault.  Sorry about that.
> 
> Your RTC patch did not apply cleanly to davinci git master because it
> had conflicts with the keypad driver.  The conflicts
> were simple so I fixed them manually but didn't commit the manual
> changes I made to the board file.
> 
> I fixed this in davinci-next and pushed a new master branch.
> 
> In the future, please make sure your patches apply to the current master
> branch.
> 
> Kevin
> 
> > Miguel Aguilar
> > Kevin Hilman wrote:
> >>
> >> miguel.aguilar@ridgerun.com writes:
> >>
> >>> From: Miguel Aguilar <miguel.aguilar@ridgerun.com>
> >>>
> >>> The general structures are defined at DM365 SoC file and the specific
> >>> platform data structure for the EVM is defined at board file.
> >>>
> >>> Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
> >>
> >> Looks good, queuing in davinci-next.
> >>
> >> Kevin
> >>
> >>> ---
> >>>  arch/arm/mach-davinci/board-dm365-evm.c    |    4 ++++
> >>>  arch/arm/mach-davinci/dm365.c              |   26
> >>> ++++++++++++++++++++++++++
> >>>  arch/arm/mach-davinci/include/mach/dm365.h |    3 +++
> >>>  arch/arm/mach-davinci/include/mach/irqs.h  |    1 +
> >>>  4 files changed, 34 insertions(+), 0 deletions(-)
> >>>
> >>> diff --git a/arch/arm/mach-davinci/board-dm365-evm.c
> >>> b/arch/arm/mach-davinci/board-dm365-evm.c
> >>> index 13b85ec..0d69abd 100644
> >>> --- a/arch/arm/mach-davinci/board-dm365-evm.c
> >>> +++ b/arch/arm/mach-davinci/board-dm365-evm.c
> >>> @@ -484,6 +484,10 @@ static __init void dm365_evm_init(void)
> >>>        evm_init_cpld();
> >>>          dm365_init_asp(&dm365_evm_snd_data);
> >>> +
> >>> +#ifdef CONFIG_RTC_DRV_DAVINCI

This should also take care of MODULE config options.

> >>> +       dm365_init_rtc();
> >>> +#endif
> >>>  }
> >>>   static __init void dm365_evm_irq_init(void)
> >>> diff --git a/arch/arm/mach-davinci/dm365.c
> >>> b/arch/arm/mach-davinci/dm365.c
> >>> index 2674438..cdfc12c 100644
> >>> --- a/arch/arm/mach-davinci/dm365.c
> >>> +++ b/arch/arm/mach-davinci/dm365.c
> >>> @@ -700,6 +700,7 @@ static u8
> >>> dm365_default_priorities[DAVINCI_N_AINTC_IRQ] = {
> >>>        [IRQ_I2C]                       = 3,
> >>>        [IRQ_UARTINT0]                  = 3,
> >>>        [IRQ_UARTINT1]                  = 3,
> >>> +       [IRQ_DM365_RTCINT]              = 3,
> >>>        [IRQ_DM365_SPIINT0_0]           = 3,
> >>>        [IRQ_DM365_SPIINT3_0]           = 3,
> >>>        [IRQ_DM365_GPIO0]               = 3,
> >>> @@ -835,6 +836,25 @@ static struct platform_device dm365_asp_device =
> {
> >>>        .resource       = dm365_asp_resources,
> >>>  };
> >>>  +static struct resource dm365_rtc_resources[] = {
> >>> +       {
> >>> +               .start = DM365_RTC_BASE,
> >>> +               .end = DM365_RTC_BASE + SZ_1K - 1,
> >>> +               .flags = IORESOURCE_MEM,
> >>> +       },
> >>> +       {
> >>> +               .start = IRQ_DM365_RTCINT,
> >>> +               .flags = IORESOURCE_IRQ,
> >>> +       },
> >>> +};
> >>> +
> >>> +static struct platform_device dm365_rtc_device = {
> >>> +       .name = "rtc_davinci",
> >>> +       .id = 0,
> >>> +       .num_resources = ARRAY_SIZE(dm365_rtc_resources),
> >>> +       .resource = dm365_rtc_resources,
> >>> +};
> >>> +
> >>>  static struct map_desc dm365_io_desc[] = {
> >>>        {
> >>>                .virtual        = IO_VIRT,
> >>> @@ -950,6 +970,12 @@ void __init dm365_init_asp(struct
> snd_platform_data
> >>> *pdata)
> >>>        platform_device_register(&dm365_asp_device);
> >>>  }
> >>>  +void __init dm365_init_rtc(void)
> >>> +{
> >>> +       davinci_cfg_reg(DM365_INT_PRTCSS);
> >>> +       platform_device_register(&dm365_rtc_device);
> >>> +}
> >>> +
> >>>  void __init dm365_init(void)
> >>>  {
> >>>        davinci_common_init(&davinci_soc_info_dm365);
> >>> diff --git a/arch/arm/mach-davinci/include/mach/dm365.h
> >>> b/arch/arm/mach-davinci/include/mach/dm365.h
> >>> index 2291c0d..bcc2f0f 100644
> >>> --- a/arch/arm/mach-davinci/include/mach/dm365.h
> >>> +++ b/arch/arm/mach-davinci/include/mach/dm365.h
> >>> @@ -25,7 +25,10 @@
> >>>  #define DM365_EMAC_MDIO_OFFSET         (0x4000)
> >>>  #define DM365_EMAC_CNTRL_RAM_SIZE      (0x2000)
> >>>  +#define DM365_RTC_BASE                 (0x01C69000)
> >>> +
> >>>  void __init dm365_init(void);
> >>>  void __init dm365_init_asp(struct snd_platform_data *pdata);
> >>> +void __init dm365_init_rtc(void);
> >>>   #endif /* __ASM_ARCH_DM365_H */
> >>> diff --git a/arch/arm/mach-davinci/include/mach/irqs.h
> >>> b/arch/arm/mach-davinci/include/mach/irqs.h
> >>> index 3c918a7..354af71 100644
> >>> --- a/arch/arm/mach-davinci/include/mach/irqs.h
> >>> +++ b/arch/arm/mach-davinci/include/mach/irqs.h
> >>> @@ -217,6 +217,7 @@
> >>>  #define IRQ_DM365_SDIOINT0     23
> >>>  #define IRQ_DM365_MMCINT1      27
> >>>  #define IRQ_DM365_PWMINT3      28
> >>> +#define IRQ_DM365_RTCINT       29
> >>>  #define IRQ_DM365_SDIOINT1     31
> >>>  #define IRQ_DM365_SPIINT0_0    42
> >>>  #define IRQ_DM365_SPIINT3_0    43
> >>> --
> >>> 1.6.0.4
> >
> >
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 13b85ec..0d69abd 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -484,6 +484,10 @@  static __init void dm365_evm_init(void)
 	evm_init_cpld();
 
 	dm365_init_asp(&dm365_evm_snd_data);
+
+#ifdef CONFIG_RTC_DRV_DAVINCI
+	dm365_init_rtc();
+#endif
 }
 
 static __init void dm365_evm_irq_init(void)
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 2674438..cdfc12c 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -700,6 +700,7 @@  static u8 dm365_default_priorities[DAVINCI_N_AINTC_IRQ] = {
 	[IRQ_I2C]			= 3,
 	[IRQ_UARTINT0]			= 3,
 	[IRQ_UARTINT1]			= 3,
+	[IRQ_DM365_RTCINT]		= 3,
 	[IRQ_DM365_SPIINT0_0]		= 3,
 	[IRQ_DM365_SPIINT3_0]		= 3,
 	[IRQ_DM365_GPIO0]		= 3,
@@ -835,6 +836,25 @@  static struct platform_device dm365_asp_device = {
 	.resource	= dm365_asp_resources,
 };
 
+static struct resource dm365_rtc_resources[] = {
+	{
+		.start = DM365_RTC_BASE,
+		.end = DM365_RTC_BASE + SZ_1K - 1,
+		.flags = IORESOURCE_MEM,
+	},
+	{
+		.start = IRQ_DM365_RTCINT,
+		.flags = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device dm365_rtc_device = {
+	.name = "rtc_davinci",
+	.id = 0,
+	.num_resources = ARRAY_SIZE(dm365_rtc_resources),
+	.resource = dm365_rtc_resources,
+};
+
 static struct map_desc dm365_io_desc[] = {
 	{
 		.virtual	= IO_VIRT,
@@ -950,6 +970,12 @@  void __init dm365_init_asp(struct snd_platform_data *pdata)
 	platform_device_register(&dm365_asp_device);
 }
 
+void __init dm365_init_rtc(void)
+{
+	davinci_cfg_reg(DM365_INT_PRTCSS);
+	platform_device_register(&dm365_rtc_device);
+}
+
 void __init dm365_init(void)
 {
 	davinci_common_init(&davinci_soc_info_dm365);
diff --git a/arch/arm/mach-davinci/include/mach/dm365.h b/arch/arm/mach-davinci/include/mach/dm365.h
index 2291c0d..bcc2f0f 100644
--- a/arch/arm/mach-davinci/include/mach/dm365.h
+++ b/arch/arm/mach-davinci/include/mach/dm365.h
@@ -25,7 +25,10 @@ 
 #define DM365_EMAC_MDIO_OFFSET		(0x4000)
 #define DM365_EMAC_CNTRL_RAM_SIZE	(0x2000)
 
+#define DM365_RTC_BASE			(0x01C69000)
+
 void __init dm365_init(void);
 void __init dm365_init_asp(struct snd_platform_data *pdata);
+void __init dm365_init_rtc(void);
 
 #endif /* __ASM_ARCH_DM365_H */
diff --git a/arch/arm/mach-davinci/include/mach/irqs.h b/arch/arm/mach-davinci/include/mach/irqs.h
index 3c918a7..354af71 100644
--- a/arch/arm/mach-davinci/include/mach/irqs.h
+++ b/arch/arm/mach-davinci/include/mach/irqs.h
@@ -217,6 +217,7 @@ 
 #define IRQ_DM365_SDIOINT0	23
 #define IRQ_DM365_MMCINT1	27
 #define IRQ_DM365_PWMINT3	28
+#define IRQ_DM365_RTCINT	29
 #define IRQ_DM365_SDIOINT1	31
 #define IRQ_DM365_SPIINT0_0	42
 #define IRQ_DM365_SPIINT3_0	43