MIPS: loongsonl: pull headers from linux kernel
PATCH 1/1 MIPS: loongsonl: pull headers from linux kernel
From: Du Huanpeng <[email protected]>
Signed-off-by Du Huanpeng <[email protected]>
--- arch/mips/mach-loongson/include/mach/loongson1.h | 50 ++++++--- arch/mips/mach-loongson/include/mach/regs-clk.h | 81 +++++++++++++++ arch/mips/mach-loongson/include/mach/regs-mux.h | 124 +++++++++++++++++++++++ arch/mips/mach-loongson/include/mach/regs-pwm.h | 25 +++++ arch/mips/mach-loongson/include/mach/regs-rtc.h | 19 ++++ arch/mips/mach-loongson/include/mach/regs-wdt.h | 15 +++ arch/mips/mach-loongson/loongson1_reset.c | 6 +- 7 files changed, 305 insertions(+), 15 deletions(-) create mode 100644 arch/mips/mach-loongson/include/mach/regs-clk.h create mode 100644 arch/mips/mach-loongson/include/mach/regs-mux.h create mode 100644 arch/mips/mach-loongson/include/mach/regs-pwm.h create mode 100644 arch/mips/mach-loongson/include/mach/regs-rtc.h create mode 100644 arch/mips/mach-loongson/include/mach/regs-wdt.h
arch/mips/mach-loongson/include/mach/loongson1.h +38 -12
@@ -1,28 +1,54 @@/* SPDX-License-Identifier: GPL-2.0-or-later */ /* -* Copyright (c) 2011 Zhang, Keguang <keguang.zhang at gmail.com> +* Copyright (c) 2011 Zhang, Keguang <[email protected]> * * Register mappings for Loongson 1 */ -#ifndef __ASM_MACH_LOONGSON1_LOONGSON1_H -#define __ASM_MACH_LOONGSON1_LOONGSON1_H +#ifndef __ASM_MACH_LOONGSON32_LOONGSON1_H +#define __ASM_MACH_LOONGSON32_LOONGSON1_H -#include <asm/addrspace.h> +#if defined(CONFIG_LOONGSON1_LS1B ) +#define DEFAULT_MEMSIZE 64/* If no memsize provided */ +#elif defined(CONFIG_LOONGSON1_LS1C ) +#define DEFAULT_MEMSIZE 32 +#endif /* Loongson 1 Register Bases */ +#define LS1X_MUX_BASE 0x1fd00420 +#define LS1X_INTC_BASE 0x1fd01040 +#define LS1X_GPIO0_BASE 0x1fd010c0 +#define LS1X_GPIO1_BASE 0x1fd010c4 +#define LS1X_DMAC_BASE 0x1fd01160 +#define LS1X_CBUS_BASE 0x1fd011c0 +#define LS1X_EHCI_BASE 0x1fe00000 +#define LS1X_OHCI_BASE 0x1fe08000 +#define LS1X_GMAC0_BASE 0x1fe10000 +#define LS1X_GMAC1_BASE 0x1fe20000 +#define LS1X_UART0_BASE 0x1fe40000#define LS1X_UART1_BASE 0x1fe44000#define LS1X_UART2_BASE 0x1fe48000#define LS1X_UART3_BASE 0x1fe4c000 +#define LS1X_CAN0_BASE 0x1fe50000 +#define LS1X_CAN1_BASE 0x1fe54000 +#define LS1X_I2C0_BASE 0x1fe58000 +#define LS1X_I2C1_BASE 0x1fe68000 +#define LS1X_I2C2_BASE 0x1fe70000 +#define LS1X_PWM0_BASE 0x1fe5c000 +#define LS1X_PWM1_BASE 0x1fe5c010 +#define LS1X_PWM2_BASE 0x1fe5c020 +#define LS1X_PWM3_BASE 0x1fe5c030#define LS1X_WDT_BASE 0x1fe5c060 +#define LS1X_RTC_BASE 0x1fe64000 +#define LS1X_AC97_BASE 0x1fe74000 +#define LS1X_NAND_BASE 0x1fe78000 +#define LS1X_CLK_BASE 0x1fe78030 -/* Loongson 1 watchdog register definitions */ -#define LS1X_WDT_REG (x) \ - ((void __iomem *)KSEG1ADDR(LS1X_WDT_BASE + (x))) - -#define LS1X_WDT_EN LS1X_WDT_REG(0x0) -#define LS1X_WDT_SET LS1X_WDT_REG(0x4) -#define LS1X_WDT_TIMER LS1X_WDT_REG(0x8) +#include <mach/regs-clk.h> +#include <mach/regs-mux.h> +#include <mach/regs-pwm.h> +#include <mach/regs-rtc.h> +#include <mach/regs-wdt.h> -#endif /* __ASM_MACH_LOONGSON1_LOONGSON1_H */ +#endif /* __ASM_MACH_LOONGSON32_LOONGSON1_H */
arch/mips/mach-loongson/include/mach/regs-clk.h new file +81 -0
81 lines not on this page · raw message
arch/mips/mach-loongson/include/mach/regs-mux.h new file +124 -0
124 lines not on this page · raw message
arch/mips/mach-loongson/include/mach/regs-pwm.h new file +25 -0
@@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* Copyright (c) 2014 Zhang, Keguang <[email protected]> +* +* Loongson 1 PWM Register Definitions. +*/ + +#ifndef __ASM_MACH_LOONGSON32_REGS_PWM_H +#define __ASM_MACH_LOONGSON32_REGS_PWM_H + +/* Loongson 1 PWM Timer Register Definitions */ +#define PWM_CNT 0x0 +#define PWM_HRC 0x4 +#define PWM_LRC 0x8 +#define PWM_CTRL 0xc + +/* PWM Control Register Bits */ +#define CNT_RST BIT(7) +#define INT_SR BIT(6) +#define INT_EN BIT(5) +#define PWM_SINGLE BIT(4) +#define PWM_OE BIT(3) +#define CNT_EN BIT(0) + +#endif /* __ASM_MACH_LOONGSON32_REGS_PWM_H */
arch/mips/mach-loongson/include/mach/regs-rtc.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* Copyright (c) 2016 Yang Ling <[email protected]> +* +* Loongson 1 RTC timer Register Definitions. +*/ + +#ifndef __ASM_MACH_LOONGSON32_REGS_RTC_H +#define __ASM_MACH_LOONGSON32_REGS_RTC_H + +#define LS1X_RTC_REG (x) \ + ((void __iomem *)KSEG1ADDR(LS1X_RTC_BASE + (x))) + +#define LS1X_RTC_CTRL LS1X_RTC_REG(0x40) + +#define RTC_EXTCLK_OK (BIT(5) | BIT(8)) +#define RTC_EXTCLK_EN BIT(8) + +#endif /* __ASM_MACH_LOONGSON32_REGS_RTC_H */
arch/mips/mach-loongson/include/mach/regs-wdt.h new file +15 -0
@@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* Copyright (c) 2011 Zhang, Keguang <[email protected]> +* +* Loongson 1 Watchdog Register Definitions. +*/ + +#ifndef __ASM_MACH_LOONGSON32_REGS_WDT_H +#define __ASM_MACH_LOONGSON32_REGS_WDT_H + +#define WDT_EN 0x0 +#define WDT_TIMER 0x4 +#define WDT_SET 0x8 + +#endif /* __ASM_MACH_LOONGSON32_REGS_WDT_H */
arch/mips/mach-loongson/loongson1_reset.c +3 -3
@@ -11,9 +11,9 @@static void __noreturn longhorn_restart_soc (struct restart_handler *rst) { -__raw_writel (0x1 ,LS1X_WDT_EN ); -__raw_writel (0x1 ,LS1X_WDT_SET ); -__raw_writel (0x1 ,LS1X_WDT_TIMER ); +__raw_writel (0x1 ,WDT_EN ); +__raw_writel (0x1 ,WDT_SET ); +__raw_writel (0x1 ,WDT_TIMER );hang (); }
Signature · 9 lines
2.7.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 4 lines · On Mon, Nov 04, 2019 at 03:57:33PM +0800, [email protected] wrote:
From: Du Huanpeng <[email protected]>
Signed-off-by Du Huanpeng <[email protected]>---
Applied, thanks
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox