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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJcCmhBAAoJEGFBu2jqvgRNczIP/RI5wxYhhasdw76X1zjZLvIN
 bMpkQlqqqED2tPlVV4N1MmMsYWPbse65dlkIZGIABmcd+SfLeuVeXvJJCZhFI296
 RqmhjoeubIZ9/uYqYvEJVgBfisxXbJxHlXhCXbgAfOiuf6a8awt5U1nDp6G8OJU+
 SHDhkRr3hDczvhAjk9KBQBQ6w7Fq8ZEwd/PwQSTSkMo0aYbzlGV6CsdC2pal2xKd
 iXQSJTyZEU+GnkG20jTHdmfpCblwO3SKhUpPeul8CaWpdvQ3j9P2z3jEQadzVFn7
 N00VQsJv5kmsG9F6KyLhxbpc+y7tRdjfL55Qs4bzzcQLlKhl05YDNCLulRynIWLs
 MPEUiQUD53yUpC2I5K+vIOWJn0P2x2utWN4OO6zR5bCdntdSrERYW50FsO8aWDlw
 KvmPiXeFkQdJ1uJAyJmxM+Wn1sm/5u7/XuVufQPfpagqhKpHNwUTWiS8lTFd98+Y
 1+7SLuML0cB8HwBqiSdwo+OZiKsUNLcV/42bSwzSxUH60g9W1qhdkYbjrQEDmxES
 EP7Q2eZthJeSYEHupnG/Yz1fJMaK62BDEAtSVioluRSyeGuxj9TqL8KzldfvLyJk
 6sQm4/Kg9i+6OClZt9rfWc/LDXKGuhU6ORshQYdzQDMvyEUpsmavtHa7TEwJtz8j
 7bprINsEq2X/QQSY186D
 =//Y4
 -----END PGP SIGNATURE-----

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: Olof Johansson <olof@lixom.net>
This commit is contained in:
Olof Johansson 2018-12-12 13:51:05 -08:00
commit 767ae01748
6 changed files with 157 additions and 1 deletions

View File

@ -30,6 +30,7 @@
#include <linux/platform_data/usb-davinci.h> #include <linux/platform_data/usb-davinci.h>
#include <linux/platform_data/ti-aemif.h> #include <linux/platform_data/ti-aemif.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/nvmem-provider.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.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) { } static inline void da830_evm_init_lcdc(int mux_mode) { }
#endif #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 = { static struct at24_platform_data da830_evm_i2c_eeprom_info = {
.byte_len = SZ_256K / 8, .byte_len = SZ_256K / 8,
.page_size = 64, .page_size = 64,
@ -620,6 +642,10 @@ static __init void da830_evm_init(void)
__func__, ret); __func__, ret);
davinci_serial_init(da8xx_serial_device); 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, i2c_register_board_info(1, da830_evm_i2c_devices,
ARRAY_SIZE(da830_evm_i2c_devices)); ARRAY_SIZE(da830_evm_i2c_devices));

View File

@ -20,7 +20,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/platform_data/at24.h>
#include <linux/platform_data/pca953x.h> #include <linux/platform_data/pca953x.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/input/tps6507x-ts.h> #include <linux/input/tps6507x-ts.h>
@ -28,6 +27,7 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h> #include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/nvmem-provider.h>
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/platform_data/gpio-davinci.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 = { static struct flash_platform_data da850evm_spiflash_data = {
.name = "m25p80", .name = "m25p80",
.parts = da850evm_spiflash_part, .parts = da850evm_spiflash_part,
@ -1395,6 +1420,9 @@ static __init void da850_evm_init(void)
davinci_serial_init(da8xx_serial_device); 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, i2c_register_board_info(1, da850_evm_i2c_devices,
ARRAY_SIZE(da850_evm_i2c_devices)); ARRAY_SIZE(da850_evm_i2c_devices));

View File

@ -24,6 +24,7 @@
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mtd/rawnand.h> #include <linux/mtd/rawnand.h>
#include <linux/nvmem-provider.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/eeprom.h> #include <linux/spi/eeprom.h>
@ -203,6 +204,27 @@ static struct platform_device davinci_aemif_device = {
.num_resources = ARRAY_SIZE(davinci_aemif_resources), .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 = { static struct at24_platform_data eeprom_info = {
.byte_len = (256*1024) / 8, .byte_len = (256*1024) / 8,
.page_size = 64, .page_size = 64,
@ -781,6 +803,9 @@ static __init void dm365_evm_init(void)
if (ret) if (ret)
pr_warn("%s: GPIO init failed: %d\n", __func__, 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(); evm_init_i2c();
davinci_serial_init(dm365_serial_device); davinci_serial_init(dm365_serial_device);

View File

@ -22,6 +22,7 @@
#include <linux/mtd/rawnand.h> #include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/nvmem-provider.h>
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
@ -510,6 +511,27 @@ static struct pcf857x_platform_data pcf_data_u35 = {
* - ... newer boards may have more * - ... 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 = { static struct at24_platform_data eeprom_info = {
.byte_len = (256*1024) / 8, .byte_len = (256*1024) / 8,
.page_size = 64, .page_size = 64,
@ -842,6 +864,8 @@ static __init void davinci_evm_init(void)
platform_add_devices(davinci_evm_devices, platform_add_devices(davinci_evm_devices,
ARRAY_SIZE(davinci_evm_devices)); ARRAY_SIZE(davinci_evm_devices));
#ifdef CONFIG_I2C #ifdef CONFIG_I2C
nvmem_add_cell_table(&dm644evm_nvmem_cell_table);
nvmem_add_cell_lookups(&dm644evm_nvmem_cell_lookup, 1);
evm_init_i2c(); evm_init_i2c();
davinci_setup_mmc(0, &dm6446evm_mmc_config); davinci_setup_mmc(0, &dm6446evm_mmc_config);
#endif #endif

View File

@ -32,6 +32,7 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h> #include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/nvmem-provider.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/platform_data/gpio-davinci.h> #include <linux/platform_data/gpio-davinci.h>
@ -342,6 +343,27 @@ static struct pcf857x_platform_data pcf_data = {
* - ... newer boards may have more * - ... 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 = { static struct at24_platform_data eeprom_info = {
.byte_len = (256*1024) / 8, .byte_len = (256*1024) / 8,
.page_size = 64, .page_size = 64,
@ -815,6 +837,8 @@ static __init void evm_init(void)
pr_warn("%s: GPIO init failed: %d\n", __func__, ret); pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
#ifdef CONFIG_I2C #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(); evm_init_i2c();
#endif #endif

View File

@ -15,6 +15,7 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/nvmem-provider.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/platform_data/at24.h> #include <linux/platform_data/at24.h>
@ -161,6 +162,31 @@ bad_config:
mityomapl138_cpufreq_init(partnum); 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 = { static struct at24_platform_data mityomapl138_fd_chip = {
.byte_len = 256, .byte_len = 256,
.page_size = 8, .page_size = 8,
@ -543,6 +569,9 @@ static void __init mityomapl138_init(void)
davinci_serial_init(da8xx_serial_device); 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); ret = da8xx_register_i2c(0, &mityomap_i2c_0_pdata);
if (ret) if (ret)
pr_warn("i2c0 registration failed: %d\n", ret); pr_warn("i2c0 registration failed: %d\n", ret);