[openwrt/openwrt] generic: platform/mikrotik: move hard config tag ID-s to a header
LEDE Commits
lede-commits at lists.infradead.org
Thu Jun 20 06:53:59 PDT 2024
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/65276193955924c2256f6c93bdfdf6d81ed585ff
commit 65276193955924c2256f6c93bdfdf6d81ed585ff
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Mon Jun 10 12:20:11 2024 +0200
generic: platform/mikrotik: move hard config tag ID-s to a header
Move the hard config tag ID-s to a separate header so they can be reused
by the NVMEM driver as well.
Link: https://github.com/openwrt/openwrt/pull/15665
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
.../drivers/platform/mikrotik/rb_hardconfig.c | 19 +------------
.../drivers/platform/mikrotik/rb_hardconfig.h | 32 ++++++++++++++++++++++
2 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
index bd0469d5e8..78e39a7f94 100644
--- a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
+++ b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
@@ -37,29 +37,12 @@
#include <linux/sysfs.h>
#include <linux/lzo.h>
+#include "rb_hardconfig.h"
#include "routerboot.h"
#define RB_HARDCONFIG_VER "0.07"
#define RB_HC_PR_PFX "[rb_hardconfig] "
-/* ID values for hardware settings */
-#define RB_ID_FLASH_INFO 0x03
-#define RB_ID_MAC_ADDRESS_PACK 0x04
-#define RB_ID_BOARD_PRODUCT_CODE 0x05
-#define RB_ID_BIOS_VERSION 0x06
-#define RB_ID_SDRAM_TIMINGS 0x08
-#define RB_ID_DEVICE_TIMINGS 0x09
-#define RB_ID_SOFTWARE_ID 0x0A
-#define RB_ID_SERIAL_NUMBER 0x0B
-#define RB_ID_MEMORY_SIZE 0x0D
-#define RB_ID_MAC_ADDRESS_COUNT 0x0E
-#define RB_ID_HW_OPTIONS 0x15
-#define RB_ID_WLAN_DATA 0x16
-#define RB_ID_BOARD_IDENTIFIER 0x17
-#define RB_ID_PRODUCT_NAME 0x21
-#define RB_ID_DEFCONF 0x26
-#define RB_ID_BOARD_REVISION 0x27
-
/* Bit definitions for hardware options */
#define RB_HW_OPT_NO_UART BIT(0)
#define RB_HW_OPT_HAS_VOLTAGE BIT(1)
diff --git a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.h b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.h
new file mode 100644
index 0000000000..328f4fe3c3
--- /dev/null
+++ b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.h
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Common definitions for MikroTik RouterBoot hard config data.
+ *
+ * Copyright (C) 2020 Thibaut VARÈNE <hacks+kernel at slashdirt.org>
+ *
+ * Some constant defines extracted from routerboot.{c,h} by Gabor Juhos
+ * <juhosg at openwrt.org>
+ */
+
+#ifndef _ROUTERBOOT_HARD_CONFIG_H_
+#define _ROUTERBOOT_HARD_CONFIG_H_
+
+/* ID values for hardware settings */
+#define RB_ID_FLASH_INFO 0x03
+#define RB_ID_MAC_ADDRESS_PACK 0x04
+#define RB_ID_BOARD_PRODUCT_CODE 0x05
+#define RB_ID_BIOS_VERSION 0x06
+#define RB_ID_SDRAM_TIMINGS 0x08
+#define RB_ID_DEVICE_TIMINGS 0x09
+#define RB_ID_SOFTWARE_ID 0x0A
+#define RB_ID_SERIAL_NUMBER 0x0B
+#define RB_ID_MEMORY_SIZE 0x0D
+#define RB_ID_MAC_ADDRESS_COUNT 0x0E
+#define RB_ID_HW_OPTIONS 0x15
+#define RB_ID_WLAN_DATA 0x16
+#define RB_ID_BOARD_IDENTIFIER 0x17
+#define RB_ID_PRODUCT_NAME 0x21
+#define RB_ID_DEFCONF 0x26
+#define RB_ID_BOARD_REVISION 0x27
+
+#endif /* _ROUTERBOOT_HARD_CONFIG_H_ */
More information about the lede-commits
mailing list