2019-04-19 22:55:28 +03:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2010-07-27 19:44:37 +04:00
|
|
|
/*
|
2012-04-22 14:01:19 +04:00
|
|
|
* Platform support for LPC32xx SoC
|
2010-07-27 19:44:37 +04:00
|
|
|
*
|
|
|
|
* Author: Kevin Wells <kevin.wells@nxp.com>
|
|
|
|
*
|
2012-04-22 14:01:19 +04:00
|
|
|
* Copyright (C) 2012 Roland Stigge <stigge@antcom.de>
|
2010-07-27 19:44:37 +04:00
|
|
|
* Copyright (C) 2010 NXP Semiconductors
|
|
|
|
*/
|
|
|
|
|
2012-06-14 18:16:17 +04:00
|
|
|
#include <linux/amba/pl08x.h>
|
2012-09-06 13:39:18 +04:00
|
|
|
#include <linux/mtd/lpc32xx_mlc.h>
|
2019-04-19 22:55:26 +03:00
|
|
|
#include <linux/mtd/lpc32xx_slc.h>
|
|
|
|
#include <linux/of_platform.h>
|
2010-07-27 19:44:37 +04:00
|
|
|
|
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
#include "common.h"
|
|
|
|
|
2012-06-14 18:16:17 +04:00
|
|
|
static struct pl08x_channel_data pl08x_slave_channels[] = {
|
|
|
|
{
|
|
|
|
.bus_id = "nand-slc",
|
|
|
|
.min_signal = 1, /* SLC NAND Flash */
|
|
|
|
.max_signal = 1,
|
|
|
|
.periph_buses = PL08X_AHB1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.bus_id = "nand-mlc",
|
|
|
|
.min_signal = 12, /* MLC NAND Flash */
|
|
|
|
.max_signal = 12,
|
|
|
|
.periph_buses = PL08X_AHB1,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2012-07-12 16:01:04 +04:00
|
|
|
static int pl08x_get_signal(const struct pl08x_channel_data *cd)
|
2012-06-14 18:16:17 +04:00
|
|
|
{
|
2012-07-12 16:01:04 +04:00
|
|
|
return cd->min_signal;
|
2012-06-14 18:16:17 +04:00
|
|
|
}
|
|
|
|
|
2012-07-12 16:01:04 +04:00
|
|
|
static void pl08x_put_signal(const struct pl08x_channel_data *cd, int ch)
|
2012-06-14 18:16:17 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-04-22 14:01:19 +04:00
|
|
|
static struct pl08x_platform_data pl08x_pd = {
|
2017-05-21 00:42:50 +03:00
|
|
|
/* Some reasonable memcpy defaults */
|
|
|
|
.memcpy_burst_size = PL08X_BURST_SZ_256,
|
|
|
|
.memcpy_bus_width = PL08X_BUS_WIDTH_32_BITS,
|
2012-06-14 18:16:17 +04:00
|
|
|
.slave_channels = &pl08x_slave_channels[0],
|
|
|
|
.num_slave_channels = ARRAY_SIZE(pl08x_slave_channels),
|
2013-06-19 23:38:28 +04:00
|
|
|
.get_xfer_signal = pl08x_get_signal,
|
|
|
|
.put_xfer_signal = pl08x_put_signal,
|
2012-06-14 18:16:17 +04:00
|
|
|
.lli_buses = PL08X_AHB1,
|
|
|
|
.mem_buses = PL08X_AHB1,
|
2010-07-27 19:44:37 +04:00
|
|
|
};
|
|
|
|
|
2012-09-06 13:39:18 +04:00
|
|
|
static struct lpc32xx_slc_platform_data lpc32xx_slc_data = {
|
|
|
|
.dma_filter = pl08x_filter_id,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct lpc32xx_mlc_platform_data lpc32xx_mlc_data = {
|
|
|
|
.dma_filter = pl08x_filter_id,
|
|
|
|
};
|
|
|
|
|
2016-04-18 04:37:38 +03:00
|
|
|
static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = {
|
2012-04-22 14:01:19 +04:00
|
|
|
OF_DEV_AUXDATA("arm,pl080", 0x31000000, "pl08xdmac", &pl08x_pd),
|
2012-09-06 13:39:18 +04:00
|
|
|
OF_DEV_AUXDATA("nxp,lpc3220-slc", 0x20020000, "20020000.flash",
|
|
|
|
&lpc32xx_slc_data),
|
|
|
|
OF_DEV_AUXDATA("nxp,lpc3220-mlc", 0x200a8000, "200a8000.flash",
|
|
|
|
&lpc32xx_mlc_data),
|
2012-04-22 14:01:19 +04:00
|
|
|
{ }
|
2010-07-27 19:44:37 +04:00
|
|
|
};
|
|
|
|
|
2012-04-22 14:01:19 +04:00
|
|
|
static void __init lpc3250_machine_init(void)
|
2010-07-27 19:44:37 +04:00
|
|
|
{
|
|
|
|
lpc32xx_serial_init();
|
|
|
|
|
2016-06-01 09:53:05 +03:00
|
|
|
of_platform_default_populate(NULL, lpc32xx_auxdata_lookup, NULL);
|
2010-07-27 19:44:37 +04:00
|
|
|
}
|
|
|
|
|
2015-07-28 01:27:52 +03:00
|
|
|
static const char *const lpc32xx_dt_compat[] __initconst = {
|
2012-04-22 14:01:19 +04:00
|
|
|
"nxp,lpc3220",
|
|
|
|
"nxp,lpc3230",
|
|
|
|
"nxp,lpc3240",
|
|
|
|
"nxp,lpc3250",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
DT_MACHINE_START(LPC32XX_DT, "LPC32XX SoC (Flattened Device Tree)")
|
2011-07-06 06:38:14 +04:00
|
|
|
.atag_offset = 0x100,
|
2010-07-27 19:44:37 +04:00
|
|
|
.map_io = lpc32xx_map_io,
|
2012-04-22 14:01:19 +04:00
|
|
|
.init_machine = lpc3250_machine_init,
|
|
|
|
.dt_compat = lpc32xx_dt_compat,
|
2010-07-27 19:44:37 +04:00
|
|
|
MACHINE_END
|