From 9e00cdf1aeb0fce042a19714e212de1ec610f704 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Tue, 30 Jun 2015 18:02:04 +0200 Subject: [PATCH] ar71xx/sysmocom: register boot counter as platform_device --- .../files/arch/mips/ath79/mach-sysmocom.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-sysmocom.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-sysmocom.c index bd86c52..b290157 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-sysmocom.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-sysmocom.c @@ -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));