Commit 767ae017 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'davinci-for-v4.21/soc' of...

Merge tag 'davinci-for-v4.21/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc

DaVinci SoC updates for v4.21
-----------------------------

This set of patches moves DaVinci one step closer to
not relying on at24 platform data by relying on nvmem
cell lookups instead.

Once other dependencies are merged, for v4.22, plan is
to merge another series of patches removing at24
platform data.

* tag 'davinci-for-v4.21/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: davinci: da850-evm: remove unnecessary include
  ARM: davinci: dm850-evm: use cell nvmem lookup for mac address
  ARM: davinci: mityomapl138: use cell nvmem lookup for mac address
  ARM: davinci: da830-evm: use cell nvmem lookup for mac address
  ARM: davinci: dm646x-evm: use cell nvmem lookup for mac address
  ARM: davinci: dm644x-evm: use cell nvmem lookup for mac address
  ARM: davinci: dm365-evm: use cell nvmem lookup for mac address
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 50ba3700 a2ce9a67
......@@ -30,6 +30,7 @@
#include <linux/platform_data/usb-davinci.h>
#include <linux/platform_data/ti-aemif.h>
#include <linux/regulator/machine.h>
#include <linux/nvmem-provider.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
......@@ -435,6 +436,27 @@ static inline void da830_evm_init_lcdc(int mux_mode)
static inline void da830_evm_init_lcdc(int mux_mode) { }
#endif
static struct nvmem_cell_info da830_evm_nvmem_cells[] = {
{
.name = "macaddr",
.offset = 0x7f00,
.bytes = ETH_ALEN,
}
};
static struct nvmem_cell_table da830_evm_nvmem_cell_table = {
.nvmem_name = "1-00500",
.cells = da830_evm_nvmem_cells,
.ncells = ARRAY_SIZE(da830_evm_nvmem_cells),
};
static struct nvmem_cell_lookup da830_evm_nvmem_cell_lookup = {
.nvmem_name = "1-00500",
.cell_name = "macaddr",
.dev_id = "davinci_emac.1",
.con_id = "mac-address",
};
static struct at24_platform_data da830_evm_i2c_eeprom_info = {
.byte_len = SZ_256K / 8,
.page_size = 64,
......@@ -620,6 +642,10 @@ static __init void da830_evm_init(void)
__func__, ret);
davinci_serial_init(da8xx_serial_device);
nvmem_add_cell_table(&da830_evm_nvmem_cell_table);
nvmem_add_cell_lookups(&da830_evm_nvmem_cell_lookup, 1);
i2c_register_board_info(1, da830_evm_i2c_devices,
ARRAY_SIZE(da830_evm_i2c_devices));
......
......@@ -20,7 +20,6 @@
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/i2c.h>
#include <linux/platform_data/at24.h>
#include <linux/platform_data/pca953x.h>
#include <linux/input.h>
#include <linux/input/tps6507x-ts.h>
......@@ -28,6 +27,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
#include <linux/nvmem-provider.h>
#include <linux/mtd/physmap.h>
#include <linux/platform_device.h>
#include <linux/platform_data/gpio-davinci.h>
......@@ -100,6 +100,31 @@ static struct mtd_partition da850evm_spiflash_part[] = {
},
};
static struct nvmem_cell_info da850evm_nvmem_cells[] = {
{
.name = "macaddr",
.offset = 0x0,
.bytes = ETH_ALEN,
}
};
static struct nvmem_cell_table da850evm_nvmem_cell_table = {
/*
* The nvmem name differs from the partition name because of the
* internal works of the nvmem framework.
*/
.nvmem_name = "MAC-Address0",
.cells = da850evm_nvmem_cells,
.ncells = ARRAY_SIZE(da850evm_nvmem_cells),
};
static struct nvmem_cell_lookup da850evm_nvmem_cell_lookup = {
.nvmem_name = "MAC-Address0",
.cell_name = "macaddr",
.dev_id = "davinci_emac.1",
.con_id = "mac-address",
};
static struct flash_platform_data da850evm_spiflash_data = {
.name = "m25p80",
.parts = da850evm_spiflash_part,
......@@ -1395,6 +1420,9 @@ static __init void da850_evm_init(void)
davinci_serial_init(da8xx_serial_device);
nvmem_add_cell_table(&da850evm_nvmem_cell_table);
nvmem_add_cell_lookups(&da850evm_nvmem_cell_lookup, 1);
i2c_register_board_info(1, da850_evm_i2c_devices,
ARRAY_SIZE(da850_evm_i2c_devices));
......
......@@ -24,6 +24,7 @@
#include <linux/mtd/partitions.h>
#include <linux/slab.h>
#include <linux/mtd/rawnand.h>
#include <linux/nvmem-provider.h>
#include <linux/input.h>
#include <linux/spi/spi.h>
#include <linux/spi/eeprom.h>
......@@ -203,6 +204,27 @@ static struct platform_device davinci_aemif_device = {
.num_resources = ARRAY_SIZE(davinci_aemif_resources),
};
static struct nvmem_cell_info davinci_nvmem_cells[] = {
{
.name = "macaddr",
.offset = 0x7f00,
.bytes = ETH_ALEN,
}
};
static struct nvmem_cell_table davinci_nvmem_cell_table = {
.nvmem_name = "1-00500",
.cells = davinci_nvmem_cells,
.ncells = ARRAY_SIZE(davinci_nvmem_cells),
};
static struct nvmem_cell_lookup davinci_nvmem_cell_lookup = {
.nvmem_name = "1-00500",
.cell_name = "macaddr",
.dev_id = "davinci_emac.1",
.con_id = "mac-address",
};
static struct at24_platform_data eeprom_info = {
.byte_len = (256*1024) / 8,
.page_size = 64,
......@@ -781,6 +803,9 @@ static __init void dm365_evm_init(void)
if (ret)
pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
nvmem_add_cell_table(&davinci_nvmem_cell_table);
nvmem_add_cell_lookups(&davinci_nvmem_cell_lookup, 1);
evm_init_i2c();
davinci_serial_init(dm365_serial_device);
......
......@@ -22,6 +22,7 @@
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#include <linux/nvmem-provider.h>
#include <linux/phy.h>
#include <linux/clk.h>
#include <linux/videodev2.h>
......@@ -510,6 +511,27 @@ static struct pcf857x_platform_data pcf_data_u35 = {
* - ... newer boards may have more
*/
static struct nvmem_cell_info dm644evm_nvmem_cells[] = {
{
.name = "macaddr",
.offset = 0x7f00,
.bytes = ETH_ALEN,
}
};
static struct nvmem_cell_table dm644evm_nvmem_cell_table = {
.nvmem_name = "1-00500",
.cells = dm644evm_nvmem_cells,
.ncells = ARRAY_SIZE(dm644evm_nvmem_cells),
};
static struct nvmem_cell_lookup dm644evm_nvmem_cell_lookup = {
.nvmem_name = "1-00500",
.cell_name = "macaddr",
.dev_id = "davinci_emac.1",
.con_id = "mac-address",
};
static struct at24_platform_data eeprom_info = {
.byte_len = (256*1024) / 8,
.page_size = 64,
......@@ -842,6 +864,8 @@ static __init void davinci_evm_init(void)
platform_add_devices(davinci_evm_devices,
ARRAY_SIZE(davinci_evm_devices));
#ifdef CONFIG_I2C
nvmem_add_cell_table(&dm644evm_nvmem_cell_table);
nvmem_add_cell_lookups(&dm644evm_nvmem_cell_lookup, 1);
evm_init_i2c();
davinci_setup_mmc(0, &dm6446evm_mmc_config);
#endif
......
......@@ -32,6 +32,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
#include <linux/nvmem-provider.h>
#include <linux/clk.h>
#include <linux/export.h>
#include <linux/platform_data/gpio-davinci.h>
......@@ -342,6 +343,27 @@ static struct pcf857x_platform_data pcf_data = {
* - ... newer boards may have more
*/
static struct nvmem_cell_info dm646x_evm_nvmem_cells[] = {
{
.name = "macaddr",
.offset = 0x7f00,
.bytes = ETH_ALEN,
}
};
static struct nvmem_cell_table dm646x_evm_nvmem_cell_table = {
.nvmem_name = "1-00500",
.cells = dm646x_evm_nvmem_cells,
.ncells = ARRAY_SIZE(dm646x_evm_nvmem_cells),
};
static struct nvmem_cell_lookup dm646x_evm_nvmem_cell_lookup = {
.nvmem_name = "1-00500",
.cell_name = "macaddr",
.dev_id = "davinci_emac.1",
.con_id = "mac-address",
};
static struct at24_platform_data eeprom_info = {
.byte_len = (256*1024) / 8,
.page_size = 64,
......@@ -815,6 +837,8 @@ static __init void evm_init(void)
pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
#ifdef CONFIG_I2C
nvmem_add_cell_table(&dm646x_evm_nvmem_cell_table);
nvmem_add_cell_lookups(&dm646x_evm_nvmem_cell_lookup, 1);
evm_init_i2c();
#endif
......
......@@ -15,6 +15,7 @@
#include <linux/console.h>
#include <linux/platform_device.h>
#include <linux/mtd/partitions.h>
#include <linux/nvmem-provider.h>
#include <linux/regulator/machine.h>
#include <linux/i2c.h>
#include <linux/platform_data/at24.h>
......@@ -161,6 +162,31 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context)
mityomapl138_cpufreq_init(partnum);
}
/*
* We don't define a cell for factory config as it will be accessed from the
* board file using the nvmem notifier chain.
*/
static struct nvmem_cell_info mityomapl138_nvmem_cells[] = {
{
.name = "macaddr",
.offset = 0x64,
.bytes = ETH_ALEN,
}
};
static struct nvmem_cell_table mityomapl138_nvmem_cell_table = {
.nvmem_name = "1-00500",
.cells = mityomapl138_nvmem_cells,
.ncells = ARRAY_SIZE(mityomapl138_nvmem_cells),
};
static struct nvmem_cell_lookup mityomapl138_nvmem_cell_lookup = {
.nvmem_name = "1-00500",
.cell_name = "macaddr",
.dev_id = "davinci_emac.1",
.con_id = "mac-address",
};
static struct at24_platform_data mityomapl138_fd_chip = {
.byte_len = 256,
.page_size = 8,
......@@ -543,6 +569,9 @@ static void __init mityomapl138_init(void)
davinci_serial_init(da8xx_serial_device);
nvmem_add_cell_table(&mityomapl138_nvmem_cell_table);
nvmem_add_cell_lookups(&mityomapl138_nvmem_cell_lookup, 1);
ret = da8xx_register_i2c(0, &mityomap_i2c_0_pdata);
if (ret)
pr_warn("i2c0 registration failed: %d\n", ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment