realizationOfDataCalculation.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * arch/arm/mach-orion5x/d2net-setup.c
  3. *
  4. * LaCie d2Network and Big Disk Network NAS setup
  5. *
  6. * Copyright (C) 2009 Simon Guinot <sguinot@lacie.com>
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/pci.h>
  16. #include <linux/irq.h>
  17. #include <linux/mtd/physmap.h>
  18. #include <linux/mv643xx_eth.h>
  19. #include <linux/leds.h>
  20. #include <linux/gpio_keys.h>
  21. #include <linux/input.h>
  22. #include <linux/i2c.h>
  23. #include <linux/ata_platform.h>
  24. #include <linux/gpio.h>
  25. #include <asm/mach-types.h>
  26. #include <asm/mach/arch.h>
  27. #include <asm/mach/pci.h>
  28. #include <mach/orion5x.h>
  29. #include <plat/orion-gpio.h>
  30. #include "common.h"
  31. #include "mpp.h"
  32. /*****************************************************************************
  33. * LaCie d2 Network Info
  34. ****************************************************************************/
  35. /*
  36. * 512KB NOR flash Device bus boot chip select
  37. */
  38. #define D2NET_NOR_BOOT_BASE 0xfff80000
  39. #define D2NET_NOR_BOOT_SIZE SZ_512K
  40. /*****************************************************************************
  41. * 512KB NOR Flash on Boot Device
  42. ****************************************************************************/
  43. /*
  44. * TODO: Check write support on flash MX29LV400CBTC-70G
  45. */
  46. static struct mtd_partition d2net_partitions[] = {
  47. {
  48. .name = "Full512kb",
  49. .size = MTDPART_SIZ_FULL,
  50. .offset = 0,
  51. .mask_flags = MTD_WRITEABLE,
  52. },
  53. };
  54. static struct physmap_flash_data d2net_nor_flash_data = {
  55. .width = 1,
  56. .parts = d2net_partitions,
  57. .nr_parts = ARRAY_SIZE(d2net_partitions),
  58. };
  59. static struct resource d2net_nor_flash_resource = {
  60. .flags = IORESOURCE_MEM,
  61. .start = D2NET_NOR_BOOT_BASE,
  62. .end = D2NET_NOR_BOOT_BASE
  63. + D2NET_NOR_BOOT_SIZE - 1,
  64. };
  65. static struct platform_device d2net_nor_flash = {
  66. .name = "physmap-flash",
  67. .id = 0,
  68. .dev = {
  69. .platform_data = &d2net_nor_flash_data,
  70. },
  71. .num_resources = 1,
  72. .resource = &d2net_nor_flash_resource,
  73. };