4500_support-for-pogoplug-e02.patch 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
  2. index 0f2aa61..8c3146b 100644
  3. --- a/arch/arm/configs/kirkwood_defconfig
  4. +++ b/arch/arm/configs/kirkwood_defconfig
  5. @@ -20,6 +20,7 @@ CONFIG_MACH_NET2BIG_V2=y
  6. CONFIG_MACH_D2NET_V2=y
  7. CONFIG_MACH_NET2BIG_V2=y
  8. CONFIG_MACH_NET5BIG_V2=y
  9. +CONFIG_MACH_POGO_E02=n
  10. CONFIG_MACH_OPENRD_BASE=y
  11. CONFIG_MACH_OPENRD_CLIENT=y
  12. CONFIG_MACH_OPENRD_ULTIMATE=y
  13. diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
  14. index b634f96..cd7f289 100644
  15. --- a/arch/arm/mach-kirkwood/Kconfig
  16. +++ b/arch/arm/mach-kirkwood/Kconfig
  17. @@ -62,6 +62,15 @@ config MACH_NETSPACE_V2
  18. Say 'Y' here if you want your kernel to support the
  19. LaCie Network Space v2 NAS.
  20. +config MACH_POGO_E02
  21. + bool "CE Pogoplug E02"
  22. + default n
  23. + help
  24. + Say 'Y' here if you want your kernel to support the
  25. + CloudEngines Pogoplug e02. It differs from Marvell's
  26. + SheevaPlug Reference Board by a few details, but
  27. + especially in the led assignments.
  28. +
  29. config MACH_OPENRD
  30. bool
  31. diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
  32. index ac4cd75..dddbb40 100644
  33. --- a/arch/arm/mach-kirkwood/Makefile
  34. +++ b/arch/arm/mach-kirkwood/Makefile
  35. @@ -2,6 +2,7 @@ obj-y += common.o irq.o pcie.o mpp.o
  36. obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o
  37. obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
  38. obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
  39. +obj-$(CONFIG_MACH_POGO_E02) += pogo_e02-setup.o
  40. obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o
  41. obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o
  42. obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
  43. diff --git a/arch/arm/mach-kirkwood/pogo_e02-setup.c b/arch/arm/mach-kirkwood/pogo_e02-setup.c
  44. new file mode 100644
  45. index 0000000..f57e8f7
  46. --- /dev/null
  47. +++ b/arch/arm/mach-kirkwood/pogo_e02-setup.c
  48. @@ -0,0 +1,122 @@
  49. +/*
  50. + * arch/arm/mach-kirkwood/pogo_e02-setup.c
  51. + *
  52. + * CloudEngines Pogoplug E02 support
  53. + *
  54. + * Copyright (C) 2013 Christoph Junghans <ottxor@gentoo.org>
  55. + * Based on a patch in Arch Linux for Arm by:
  56. + * Copyright (C) 2012 Kevin Mihelich <kevin@miheli.ch>
  57. + * and <pazos@lavabit.com>
  58. + *
  59. + * Based on the board file sheevaplug-setup.c
  60. + *
  61. + * This file is licensed under the terms of the GNU General Public
  62. + * License version 2. This program is licensed "as is" without any
  63. + * warranty of any kind, whether express or implied.
  64. + */
  65. +
  66. +#include <linux/kernel.h>
  67. +#include <linux/init.h>
  68. +#include <linux/platform_device.h>
  69. +#include <linux/ata_platform.h>
  70. +#include <linux/mtd/partitions.h>
  71. +#include <linux/mv643xx_eth.h>
  72. +#include <linux/gpio.h>
  73. +#include <linux/leds.h>
  74. +#include <asm/mach-types.h>
  75. +#include <asm/mach/arch.h>
  76. +#include <mach/kirkwood.h>
  77. +#include "common.h"
  78. +#include "mpp.h"
  79. +
  80. +static struct mtd_partition pogo_e02_nand_parts[] = {
  81. + {
  82. + .name = "u-boot",
  83. + .offset = 0,
  84. + .size = SZ_1M
  85. + }, {
  86. + .name = "uImage",
  87. + .offset = MTDPART_OFS_NXTBLK,
  88. + .size = SZ_4M
  89. + }, {
  90. + .name = "pogoplug",
  91. + .offset = MTDPART_OFS_NXTBLK,
  92. + .size = SZ_32M
  93. + }, {
  94. + .name = "root",
  95. + .offset = MTDPART_OFS_NXTBLK,
  96. + .size = MTDPART_SIZ_FULL
  97. + },
  98. +};
  99. +
  100. +static struct mv643xx_eth_platform_data pogo_e02_ge00_data = {
  101. + .phy_addr = MV643XX_ETH_PHY_ADDR(0),
  102. +};
  103. +
  104. +static struct gpio_led pogo_e02_led_pins[] = {
  105. + {
  106. + .name = "status:green:health",
  107. + .default_trigger = "default-on",
  108. + .gpio = 48,
  109. + .active_low = 1,
  110. + },
  111. + {
  112. + .name = "status:orange:fault",
  113. + .default_trigger = "none",
  114. + .gpio = 49,
  115. + .active_low = 1,
  116. + }
  117. +};
  118. +
  119. +static struct gpio_led_platform_data pogo_e02_led_data = {
  120. + .leds = pogo_e02_led_pins,
  121. + .num_leds = ARRAY_SIZE(pogo_e02_led_pins),
  122. +};
  123. +
  124. +static struct platform_device pogo_e02_leds = {
  125. + .name = "leds-gpio",
  126. + .id = -1,
  127. + .dev = {
  128. + .platform_data = &pogo_e02_led_data,
  129. + }
  130. +};
  131. +
  132. +static unsigned int pogo_e02_mpp_config[] __initdata = {
  133. + MPP29_GPIO, /* USB Power Enable */
  134. + MPP48_GPIO, /* LED Green */
  135. + MPP49_GPIO, /* LED Orange */
  136. + 0
  137. +};
  138. +
  139. +static void __init pogo_e02_init(void)
  140. +{
  141. + /*
  142. + * Basic setup. Needs to be called early.
  143. + */
  144. + kirkwood_init();
  145. +
  146. + /* setup gpio pin select */
  147. + kirkwood_mpp_conf(pogo_e02_mpp_config);
  148. +
  149. + kirkwood_uart0_init();
  150. + kirkwood_nand_init(ARRAY_AND_SIZE(pogo_e02_nand_parts), 25);
  151. +
  152. + if (gpio_request(29, "USB Power Enable") != 0 ||
  153. + gpio_direction_output(29, 1) != 0)
  154. + pr_err("can't set up GPIO 29 (USB Power Enable)\n");
  155. + kirkwood_ehci_init();
  156. +
  157. + kirkwood_ge00_init(&pogo_e02_ge00_data);
  158. +
  159. + platform_device_register(&pogo_e02_leds);
  160. +}
  161. +
  162. +MACHINE_START(POGO_E02, "Pogoplug E02")
  163. + .atag_offset = 0x100,
  164. + .init_machine = pogo_e02_init,
  165. + .map_io = kirkwood_map_io,
  166. + .init_early = kirkwood_init_early,
  167. + .init_irq = kirkwood_init_irq,
  168. + .timer = &kirkwood_timer,
  169. + .restart = kirkwood_restart,
  170. +MACHINE_END