File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed
include/asm/mach-loongson32 Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -30,5 +30,6 @@ void __init ls1x_clk_init(void);
3030void __init ls1x_dma_set_platdata (struct plat_ls1x_dma * pdata );
3131void __init ls1x_nand_set_platdata (struct plat_ls1x_nand * pdata );
3232void __init ls1x_serial_set_uartclk (struct platform_device * pdev );
33+ void __init ls1x_rtc_set_extclk (struct platform_device * pdev );
3334
3435#endif /* __ASM_MACH_LOONGSON32_PLATFORM_H */
Original file line number Diff line number Diff line change 2323#include <dma.h>
2424#include <nand.h>
2525
26+ #define LS1X_RTC_CTRL ((void __iomem *)KSEG1ADDR(LS1X_RTC_BASE + 0x40))
27+ #define RTC_EXTCLK_OK (BIT(5) | BIT(8))
28+ #define RTC_EXTCLK_EN BIT(8)
29+
2630/* 8250/16550 compatible UART */
2731#define LS1X_UART (_id ) \
2832 { \
@@ -66,6 +70,15 @@ void __init ls1x_serial_set_uartclk(struct platform_device *pdev)
6670 p -> uartclk = clk_get_rate (clk );
6771}
6872
73+ void __init ls1x_rtc_set_extclk (struct platform_device * pdev )
74+ {
75+ u32 val ;
76+
77+ val = __raw_readl (LS1X_RTC_CTRL );
78+ if (!(val & RTC_EXTCLK_OK ))
79+ __raw_writel (val | RTC_EXTCLK_EN , LS1X_RTC_CTRL );
80+ }
81+
6982/* CPUFreq */
7083static struct plat_ls1x_cpufreq ls1x_cpufreq_pdata = {
7184 .clk_name = "cpu_clk" ,
Original file line number Diff line number Diff line change 11#
2- # Makefile for loongson1B based machines.
2+ # Makefile for loongson1C based machines.
33#
44
55obj-y += board.o
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2016 Ling Yang <[email protected] > 2+ * Copyright (c) 2016 Yang Ling <[email protected] > 33 *
44 * This program is free software; you can redistribute it and/or modify it
55 * under the terms of the GNU General Public License as published by the
1212static struct platform_device * ls1c_platform_devices [] __initdata = {
1313 & ls1x_uart_pdev ,
1414 & ls1x_eth0_pdev ,
15+ & ls1x_rtc_pdev ,
1516};
1617
1718static int __init ls1c_platform_init (void )
1819{
19- int err ;
20-
2120 ls1x_serial_set_uartclk (& ls1x_uart_pdev );
21+ ls1x_rtc_set_extclk (& ls1x_rtc_pdev );
2222
23- err = platform_add_devices (ls1c_platform_devices ,
23+ return platform_add_devices (ls1c_platform_devices ,
2424 ARRAY_SIZE (ls1c_platform_devices ));
25- return err ;
2625}
2726
2827arch_initcall (ls1c_platform_init );
You can’t perform that action at this time.
0 commit comments