ar71xx/sysmocom: register boot counter as platform_device

This commit is contained in:
Alexander Couzens 2015-06-30 18:02:04 +02:00
parent dca38a219e
commit 9e00cdf1ae
1 changed files with 18 additions and 0 deletions

View File

@ -112,6 +112,23 @@ static struct i2c_gpio_platform_data sob_ap2_i2c_gpio_data = {
.udelay = 20,
};
static struct resource boot_counter_resources[] = {
{
.name = "counter_base",
.flags = IORESOURCE_MEM,
.start = 0x1d000100,
.end = 0x1d000100 + 0x10 - 1,
}
};
static struct platform_device sob_boot_counter = {
.name = "boot-counter-sram",
.id = 0,
.resource = boot_counter_resources,
.num_resources = ARRAY_SIZE(boot_counter_resources),
};
static struct platform_device sob_ap1_i2c_gpio_device = {
.name = "i2c-gpio",
.id = 0,
@ -206,6 +223,7 @@ static void __init sysmocom_sob_ap2_setup(void)
ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP) |
AR933X_BOOTSTRAP_MDIO_GPIO_EN);
platform_device_register(&sob_boot_counter);
platform_device_register(&sob_ap2_i2c_gpio_device);
i2c_register_board_info(0, sob_ap_i2c_devs,
ARRAY_SIZE(sob_ap_i2c_devs));