All of lore.kernel.org
 help / color / mirror / Atom feed
* OMAP850 RTC and MMC registers differ from other OMAP1, how to implement?
@ 2009-07-30 15:39 Alistair Buxton
  2009-08-04 14:18 ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Alistair Buxton @ 2009-07-30 15:39 UTC (permalink / raw)
  To: linux-omap

Hi,

I'm working on OMAP850 support. I have found that OMAP 15xx and 16xx have
32 bit registers, while 730 and 850 have 8 bit RTC registers and 16
bit MMC registers. At the moment I work around this using #defines as
such:

#if (defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850))
#define OMAP_RTC_SECONDS_REG           0x00
...
#define OMAP_RTC_OSC_REG               0x19
#else
#define OMAP_RTC_SECONDS_REG            0x00
...
#define OMAP_RTC_OSC_REG                0x54
#endif

I have been told that this isn't a good way to handle it because the
same binary kernel has to work on all OMAP1 machines. So this has to
be checked for at run time. We can check that with cpu_is_omap7xx()
but what would be the correct way to actually implement this? I could
do something like this:

#define OMAP_RTC_REGISTER_SIZE (cpu_is_omap7xx()?1:4)
#define OMAP_RTC_OSC_REG               (0x19*OMAP_RTC_REGISTER_SIZE)

Would that be acceptable? If not, how should I do it? Is there an
existing driver that does something similar I could look at?

Thanks,

-- 
Alistair Buxton
a.j.buxton@gmail.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: OMAP850 RTC and MMC registers differ from other OMAP1, how to implement?
  2009-07-30 15:39 OMAP850 RTC and MMC registers differ from other OMAP1, how to implement? Alistair Buxton
@ 2009-08-04 14:18 ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2009-08-04 14:18 UTC (permalink / raw)
  To: Alistair Buxton; +Cc: linux-omap

* Alistair Buxton <a.j.buxton@gmail.com> [090730 18:45]:
> Hi,
> 
> I'm working on OMAP850 support. I have found that OMAP 15xx and 16xx have
> 32 bit registers, while 730 and 850 have 8 bit RTC registers and 16
> bit MMC registers. At the moment I work around this using #defines as
> such:
> 
> #if (defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850))
> #define OMAP_RTC_SECONDS_REG           0x00
> ...
> #define OMAP_RTC_OSC_REG               0x19
> #else
> #define OMAP_RTC_SECONDS_REG            0x00
> ...
> #define OMAP_RTC_OSC_REG                0x54
> #endif
> 
> I have been told that this isn't a good way to handle it because the
> same binary kernel has to work on all OMAP1 machines. So this has to
> be checked for at run time. We can check that with cpu_is_omap7xx()
> but what would be the correct way to actually implement this? I could
> do something like this:
> 
> #define OMAP_RTC_REGISTER_SIZE (cpu_is_omap7xx()?1:4)
> #define OMAP_RTC_OSC_REG               (0x19*OMAP_RTC_REGISTER_SIZE)
> 
> Would that be acceptable? If not, how should I do it? Is there an
> existing driver that does something similar I could look at?

Maybe take a look at this recent post by Russell:

http://www.mail-archive.com/linux-omap@vger.kernel.org/msg14522.html

After you have the register offset arrays done, you can have the
drivers specific register read/write functions access the registers
based on cpu_is_omap7xx().

Regards,

Tony

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: OMAP850 RTC and MMC registers differ from other OMAP1, how to implement?
       [not found] ` <3d374d00907300825o13fa7b2frc22dae8a290f4118@mail.gmail.com>
@ 2009-10-07 16:13   ` Christopher Friedt
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Friedt @ 2009-10-07 16:13 UTC (permalink / raw)
  To: linux-omap

Hi Alistair,

I'm also doing a bit of work with the omap850 for my htc wizard.

Has anything happened with the rtc patches lately? I haven't seen
anything show up in linux-omap git, but I might have missed them.

If not, can you please post them ? I don't mind implementing the omap1
compatibiity pointed out by Russell & Tony [1].

Cheers,

Chris

[1] http://www.mail-archive.com/linux-omap@vger.kernel.org/msg16701.html


On Thu, Jul 30, 2009 at 5:25 PM, Alistair Buxton <a.j.buxton@gmail.com> wrote:
> Hi,
>
> I'm working on OMAP850 support. I have found that OMAP 15xx and 16xx have
> 32 bit registers, while 730 and 850 have 8 bit RTC registers and 16
> bit MMC registers. At the moment I work around this using #defines as
> such:
>
> #if (defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850))
> #define OMAP_RTC_SECONDS_REG           0x00
> ...
> #define OMAP_RTC_OSC_REG               0x19
> #else
> #define OMAP_RTC_SECONDS_REG            0x00
> ...
> #define OMAP_RTC_OSC_REG                0x54
> #endif
>
> I have been told that this isn't a good way to handle it because the
> same binary kernel has to work on all OMAP1 machines. So this has to
> be checked for at run time. We can check that with cpu_is_omap7xx()
> but what would be the correct way to actually implement this? I could
> do something like this:
>
> #define OMAP_RTC_REGISTER_SIZE (cpu_is_omap7xx()?1:4)
> #define OMAP_RTC_OSC_REG               (0x19*OMAP_RTC_REGISTER_SIZE)
>
> Would that be acceptable? If not, how should I do it? Is there an
> existing driver that does something similar I could look at?
>
> Thanks,
> --
> Alistair Buxton
> a.j.buxton@gmail.com
>
> -------------------------------------------------------------------
> List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
> FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
> Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-07 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-30 15:39 OMAP850 RTC and MMC registers differ from other OMAP1, how to implement? Alistair Buxton
2009-08-04 14:18 ` Tony Lindgren
     [not found] <3d374d00907300659y5af1bc0ctdd236d8b5f4712e4@mail.gmail.com>
     [not found] ` <3d374d00907300825o13fa7b2frc22dae8a290f4118@mail.gmail.com>
2009-10-07 16:13   ` Christopher Friedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.