930-falcon-95C3AM1.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. --- /dev/null
  2. +++ b/arch/mips/lantiq/falcon/mach-95C3AM1.c
  3. @@ -0,0 +1,103 @@
  4. +#include <linux/init.h>
  5. +#include <linux/platform_device.h>
  6. +#include <linux/i2c-gpio.h>
  7. +#include <machine.h>
  8. +
  9. +#include "devices.h"
  10. +#include "dev-leds-gpio.h"
  11. +
  12. +#define BOARD_95C3AM1_GPIO_LED_0 10
  13. +#define BOARD_95C3AM1_GPIO_LED_1 11
  14. +#define BOARD_95C3AM1_GPIO_LED_2 12
  15. +#define BOARD_95C3AM1_GPIO_LED_3 13
  16. +
  17. +extern unsigned char lq_ethaddr[6];
  18. +
  19. +#ifdef CONFIG_MTD_PARTITIONS
  20. +static struct mtd_partition board_95C3AM1_partitions[] =
  21. +{
  22. + {
  23. + .name = "uboot",
  24. + .offset = 0x0,
  25. + .size = 0x40000,
  26. + },
  27. + {
  28. + .name = "uboot_env",
  29. + .offset = 0x40000,
  30. + .size = 0x40000, /* 2 sectors for redundant env. */
  31. + },
  32. + {
  33. + .name = "linux",
  34. + .offset = 0x80000,
  35. + .size = 0xF80000, /* map only 16 MiB */
  36. + },
  37. +};
  38. +
  39. +static struct flash_platform_data board_95C3AM1_flash_platform_data = {
  40. + .name = "sflash",
  41. + .parts = board_95C3AM1_partitions,
  42. + .nr_parts = ARRAY_SIZE(board_95C3AM1_partitions)
  43. +};
  44. +#endif
  45. +
  46. +static struct spi_board_info board_95C3AM1_flash_data __initdata = {
  47. + .modalias = "m25p80",
  48. + .bus_num = 0,
  49. + .chip_select = 0,
  50. + .max_speed_hz = 10 * 1000 * 1000,
  51. + .mode = SPI_MODE_3,
  52. +#ifdef CONFIG_MTD_PARTITIONS
  53. + .platform_data = &board_95C3AM1_flash_platform_data
  54. +#endif
  55. +};
  56. +
  57. +static struct gpio_led board_95C3AM1_leds_gpio[] __initdata = {
  58. + {
  59. + .name = "power",
  60. + .gpio = BOARD_95C3AM1_GPIO_LED_0,
  61. + .active_low = 0,
  62. + }, {
  63. + .name = "optical",
  64. + .gpio = BOARD_95C3AM1_GPIO_LED_1,
  65. + .active_low = 0,
  66. + }, {
  67. + .name = "lan",
  68. + .gpio = BOARD_95C3AM1_GPIO_LED_2,
  69. + .active_low = 0,
  70. + }, {
  71. + .name = "update",
  72. + .gpio = BOARD_95C3AM1_GPIO_LED_3,
  73. + .active_low = 0,
  74. + }
  75. +};
  76. +
  77. +static struct i2c_gpio_platform_data board_95C3AM1_i2c_gpio_data = {
  78. + .sda_pin = 107,
  79. + .scl_pin = 108,
  80. +};
  81. +
  82. +static struct platform_device board_95C3AM1_i2c_gpio_device = {
  83. + .name = "i2c-gpio",
  84. + .id = 0,
  85. + .dev = {
  86. + .platform_data = &board_95C3AM1_i2c_gpio_data,
  87. + }
  88. +};
  89. +
  90. +static void __init board_95C3AM1_init(void)
  91. +{
  92. + falcon_register_asc(0);
  93. + falcon_register_gpio();
  94. + falcon_register_wdt();
  95. + falcon_register_i2c();
  96. + falcon_register_spi_flash(&board_95C3AM1_flash_data);
  97. + platform_device_register(&board_95C3AM1_i2c_gpio_device);
  98. + lq_add_device_leds_gpio(-1, ARRAY_SIZE(board_95C3AM1_leds_gpio),
  99. + board_95C3AM1_leds_gpio);
  100. + falcon_register_crypto();
  101. +}
  102. +
  103. +MIPS_MACHINE(LANTIQ_MACH_95C3AM1,
  104. + "95C3AM1",
  105. + "95C3AM1 Board",
  106. + board_95C3AM1_init);
  107. --- a/arch/mips/include/asm/mach-lantiq/machine.h
  108. +++ b/arch/mips/include/asm/mach-lantiq/machine.h
  109. @@ -7,6 +7,7 @@ enum lantiq_mach_type {
  110. LANTIQ_MACH_EASY98000, /* Falcon Eval Board, NOR Flash */
  111. LANTIQ_MACH_EASY98000SF, /* Falcon Eval Board, Serial Flash */
  112. LANTIQ_MACH_EASY98020, /* Falcon Reference Board */
  113. + LANTIQ_MACH_95C3AM1, /* Board 95C3AM1 */
  114. /* XWAY */
  115. LANTIQ_MACH_EASY4010, /* Twinpass evalkit */
  116. --- a/arch/mips/lantiq/falcon/Kconfig
  117. +++ b/arch/mips/lantiq/falcon/Kconfig
  118. @@ -10,6 +10,10 @@ config LANTIQ_MACH_EASY98020
  119. bool "Easy98020"
  120. default y
  121. +config LANTIQ_MACH_95C3AM1
  122. + bool "95C3AM1"
  123. + default y
  124. +
  125. endmenu
  126. endif
  127. --- a/arch/mips/lantiq/falcon/Makefile
  128. +++ b/arch/mips/lantiq/falcon/Makefile
  129. @@ -3,3 +3,4 @@ obj-y += softdog_vpe.o
  130. obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
  131. obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o
  132. obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o
  133. +obj-$(CONFIG_LANTIQ_MACH_95C3AM1) += mach-95C3AM1.o