phy3250.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Platform support for LPC32xx SoC
  4. *
  5. * Author: Kevin Wells <kevin.wells@nxp.com>
  6. *
  7. * Copyright (C) 2012 Roland Stigge <stigge@antcom.de>
  8. * Copyright (C) 2010 NXP Semiconductors
  9. */
  10. #include <linux/amba/pl08x.h>
  11. #include <linux/mtd/lpc32xx_mlc.h>
  12. #include <linux/mtd/lpc32xx_slc.h>
  13. #include <linux/of_platform.h>
  14. #include <asm/mach/arch.h>
  15. #include "common.h"
  16. static struct pl08x_channel_data pl08x_slave_channels[] = {
  17. {
  18. .bus_id = "nand-slc",
  19. .min_signal = 1, /* SLC NAND Flash */
  20. .max_signal = 1,
  21. .periph_buses = PL08X_AHB1,
  22. },
  23. {
  24. .bus_id = "nand-mlc",
  25. .min_signal = 12, /* MLC NAND Flash */
  26. .max_signal = 12,
  27. .periph_buses = PL08X_AHB1,
  28. },
  29. };
  30. static int pl08x_get_signal(const struct pl08x_channel_data *cd)
  31. {
  32. return cd->min_signal;
  33. }
  34. static void pl08x_put_signal(const struct pl08x_channel_data *cd, int ch)
  35. {
  36. }
  37. static struct pl08x_platform_data pl08x_pd = {
  38. /* Some reasonable memcpy defaults */
  39. .memcpy_burst_size = PL08X_BURST_SZ_256,
  40. .memcpy_bus_width = PL08X_BUS_WIDTH_32_BITS,
  41. .slave_channels = &pl08x_slave_channels[0],
  42. .num_slave_channels = ARRAY_SIZE(pl08x_slave_channels),
  43. .get_xfer_signal = pl08x_get_signal,
  44. .put_xfer_signal = pl08x_put_signal,
  45. .lli_buses = PL08X_AHB1,
  46. .mem_buses = PL08X_AHB1,
  47. };
  48. static struct lpc32xx_slc_platform_data lpc32xx_slc_data = {
  49. .dma_filter = pl08x_filter_id,
  50. };
  51. static struct lpc32xx_mlc_platform_data lpc32xx_mlc_data = {
  52. .dma_filter = pl08x_filter_id,
  53. };
  54. static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = {
  55. OF_DEV_AUXDATA("arm,pl080", 0x31000000, "pl08xdmac", &pl08x_pd),
  56. OF_DEV_AUXDATA("nxp,lpc3220-slc", 0x20020000, "20020000.flash",
  57. &lpc32xx_slc_data),
  58. OF_DEV_AUXDATA("nxp,lpc3220-mlc", 0x200a8000, "200a8000.flash",
  59. &lpc32xx_mlc_data),
  60. { }
  61. };
  62. static void __init lpc3250_machine_init(void)
  63. {
  64. lpc32xx_serial_init();
  65. of_platform_default_populate(NULL, lpc32xx_auxdata_lookup, NULL);
  66. }
  67. static const char *const lpc32xx_dt_compat[] __initconst = {
  68. "nxp,lpc3220",
  69. "nxp,lpc3230",
  70. "nxp,lpc3240",
  71. "nxp,lpc3250",
  72. NULL
  73. };
  74. DT_MACHINE_START(LPC32XX_DT, "LPC32XX SoC (Flattened Device Tree)")
  75. .atag_offset = 0x100,
  76. .map_io = lpc32xx_map_io,
  77. .init_machine = lpc3250_machine_init,
  78. .dt_compat = lpc32xx_dt_compat,
  79. MACHINE_END