Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152220073
D5983.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D5983.diff
View Options
Index: head/sys/mips/mediatek/mtk_soc.c
===================================================================
--- head/sys/mips/mediatek/mtk_soc.c
+++ head/sys/mips/mediatek/mtk_soc.c
@@ -76,13 +76,17 @@
static uint32_t
mtk_detect_cpuclk_rt305x(bus_space_tag_t bst, bus_space_handle_t bsh)
{
- uint32_t clk;
+ uint32_t val;
+
+ val = bus_space_read_4(bst, bsh, SYSCTL_CHIPID0_3);
+ if (val == RT3350_CHIPID0_3)
+ return (MTK_CPU_CLK_320MHZ);
- clk = bus_space_read_4(bst, bsh, SYSCTL_SYSCFG);
- clk >>= RT305X_CPU_CLKSEL_OFF;
- clk &= RT305X_CPU_CLKSEL_MSK;
+ val = bus_space_read_4(bst, bsh, SYSCTL_SYSCFG);
+ val >>= RT305X_CPU_CLKSEL_OFF;
+ val &= RT305X_CPU_CLKSEL_MSK;
- return ((clk == 0) ? MTK_CPU_CLK_320MHZ : MTK_CPU_CLK_384MHZ);
+ return ((val == 0) ? MTK_CPU_CLK_320MHZ : MTK_CPU_CLK_384MHZ);
}
static uint32_t
@@ -265,10 +269,8 @@
switch (mtk_soc_socid) {
case MTK_SOC_RT3050: /* fallthrough */
case MTK_SOC_RT3052:
- mtk_soc_cpuclk = mtk_detect_cpuclk_rt305x(bst, bsh);
- break;
case MTK_SOC_RT3350:
- mtk_soc_cpuclk = MTK_CPU_CLK_320MHZ;
+ mtk_soc_cpuclk = mtk_detect_cpuclk_rt305x(bst, bsh);
break;
case MTK_SOC_RT3352:
mtk_soc_cpuclk = mtk_detect_cpuclk_rt3352(bst, bsh);
Index: head/sys/mips/mediatek/mtk_sysctl.h
===================================================================
--- head/sys/mips/mediatek/mtk_sysctl.h
+++ head/sys/mips/mediatek/mtk_sysctl.h
@@ -52,6 +52,8 @@
#define SYSCFG1_USB_HOST_MODE (1<<10)
+#define RT3350_CHIPID0_3 0x33335452
+
extern uint32_t mtk_sysctl_get(uint32_t);
extern void mtk_sysctl_set(uint32_t, uint32_t);
extern void mtk_sysctl_clr_set(uint32_t, uint32_t, uint32_t);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 14, 12:15 PM (19 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31473060
Default Alt Text
D5983.diff (1 KB)
Attached To
Mode
D5983: Allow RT3350 CPU clock to be detected as part of RT3050/RT3052 detection
Attached
Detach File
Event Timeline
Log In to Comment