mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-14 18:36:34 +00:00
ARM: davinci: dm646x-evm: use cell nvmem lookup for mac address
We now support nvmem lookups and cell definitions for machine code. Add relevant data structures for the mac-address stored in at24 EEPROM. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
This commit is contained in:
parent
89c817c417
commit
628c75ddad
1 changed files with 24 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue