aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/rbcfg/src/rbcfg.h
diff options
context:
space:
mode:
authorThibaut VARENE <hacks@slashdirt.org>2017-02-25 17:34:50 +0100
committerJo-Philipp Wich <jo@mein.io>2017-10-07 15:00:26 +0200
commit2be307c99852dc859730b531e9b1cc2f9776234b (patch)
treec2fbee06ed0f16b80f6c74580836b24cd2c52948 /package/boot/rbcfg/src/rbcfg.h
parentb9c31c44d719c7749c058aaa13b9c1503e9968f0 (diff)
downloadupstream-2be307c99852dc859730b531e9b1cc2f9776234b.tar.gz
upstream-2be307c99852dc859730b531e9b1cc2f9776234b.tar.bz2
upstream-2be307c99852dc859730b531e9b1cc2f9776234b.zip
rbcfg: Implement CPU frequency control
This patch implements CPU frequency control as found on several routerboard devices. Supported SoCs: - QCA953X - AR9344 Tested on hAP lite and mAP lite (QCA953x): steps of 50MHz Tested on LHG 5 (AR9344): steps of 50MHz On unsupported hardware, this patch is a NOP: it will not alter the new field. "rbcfg help" will display an empty "cpu_freq" help listing. "rbcfg show" will not show the cpu_freq field. "rbcfg set/get cpu_freq" will return an error code. Signed-off-by: Thibaut VARENE <hacks@slashdirt.org> [adjusted subject] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/boot/rbcfg/src/rbcfg.h')
-rw-r--r--package/boot/rbcfg/src/rbcfg.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/package/boot/rbcfg/src/rbcfg.h b/package/boot/rbcfg/src/rbcfg.h
index 864bc82172..88acc13dc1 100644
--- a/package/boot/rbcfg/src/rbcfg.h
+++ b/package/boot/rbcfg/src/rbcfg.h
@@ -32,6 +32,7 @@
#define RB_ID_BOOT_PROTOCOL 9
#define RB_ID_SOFT_10 10
#define RB_ID_SOFT_11 11
+#define RB_ID_CPU_FREQ 12
#define RB_ID_BOOTER 13
#define RB_UART_SPEED_115200 0
@@ -71,6 +72,13 @@
#define RB_BOOT_PROTOCOL_BOOTP 0
#define RB_BOOT_PROTOCOL_DHCP 1
+#define RB_CPU_FREQ_L2 (0 << 3)
+#define RB_CPU_FREQ_L1 (1 << 3)
+#define RB_CPU_FREQ_N0 (2 << 3)
+#define RB_CPU_FREQ_H1 (3 << 3)
+#define RB_CPU_FREQ_H2 (4 << 3)
+#define RB_CPU_FREQ_H3 (5 << 3)
+
#define RB_BOOTER_REGULAR 0
#define RB_BOOTER_BACKUP 1