095-dsmg600_rtc_fixup.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Index: linux-2.6.22-rc4-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
  2. ===================================================================
  3. --- linux-2.6.22-rc4-armeb.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
  4. +++ linux-2.6.22-rc4-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
  5. @@ -16,6 +16,7 @@
  6. #include <linux/serial_8250.h>
  7. #include <linux/i2c-gpio.h>
  8. +#include <asm/setup.h>
  9. #include <asm/mach-types.h>
  10. #include <asm/mach/arch.h>
  11. #include <asm/mach/flash.h>
  12. @@ -145,6 +146,35 @@ static struct sys_timer dsmg600_timer =
  13. .init = dsmg600_timer_init,
  14. };
  15. +static char dsmg600_rtc_probe[] __initdata = "rtc-pcf8563.probe=0,0x51 ";
  16. +
  17. +static void __init dsmg600_fixup(struct machine_desc *desc,
  18. + struct tag *tags, char **cmdline, struct meminfo *mi)
  19. +{
  20. + struct tag *t = tags;
  21. + char *p = *cmdline;
  22. +
  23. + /* Find the end of the tags table, taking note of any cmdline tag. */
  24. + for (; t->hdr.size; t = tag_next(t)) {
  25. + if (t->hdr.tag == ATAG_CMDLINE) {
  26. + p = t->u.cmdline.cmdline;
  27. + }
  28. + }
  29. +
  30. + /* Overwrite the end of the table with a new cmdline tag. */
  31. + t->hdr.tag = ATAG_CMDLINE;
  32. + t->hdr.size = (sizeof (struct tag_header) +
  33. + strlen(dsmg600_rtc_probe) + strlen(p) + 1 + 4) >> 2;
  34. + strlcpy(t->u.cmdline.cmdline, dsmg600_rtc_probe, COMMAND_LINE_SIZE);
  35. + strlcpy(t->u.cmdline.cmdline + strlen(dsmg600_rtc_probe), p,
  36. + COMMAND_LINE_SIZE - strlen(dsmg600_rtc_probe));
  37. +
  38. + /* Terminate the table. */
  39. + t = tag_next(t);
  40. + t->hdr.tag = ATAG_NONE;
  41. + t->hdr.size = 0;
  42. +}
  43. +
  44. static void __init dsmg600_init(void)
  45. {
  46. ixp4xx_sys_init();
  47. @@ -177,6 +207,7 @@ MACHINE_START(DSMG600, "D-Link DSM-G600
  48. .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
  49. .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
  50. .boot_params = 0x00000100,
  51. + .fixup = dsmg600_fixup,
  52. .map_io = ixp4xx_map_io,
  53. .init_irq = ixp4xx_init_irq,
  54. .timer = &dsmg600_timer,