Module Name:    src
Committed By:   martin
Date:           Mon Nov 18 19:36:03 UTC 2019

Modified Files:
        src/sys/arch/arm/sunxi [netbsd-9]: sun50i_a64_ccu.c
        src/sys/arch/evbarm/conf [netbsd-9]: GENERIC64

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #439):

        sys/arch/evbarm/conf/GENERIC64: revision 1.115
        sys/arch/arm/sunxi/sun50i_a64_ccu.c: revision 1.15

Add SPI clocks
Add sun6ispi


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.1 -r1.13.2.2 src/sys/arch/arm/sunxi/sun50i_a64_ccu.c
cvs rdiff -u -r1.103.2.4 -r1.103.2.5 src/sys/arch/evbarm/conf/GENERIC64

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/sunxi/sun50i_a64_ccu.c
diff -u src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.13.2.1 src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.13.2.2
--- src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.13.2.1	Mon Nov 18 19:31:00 2019
+++ src/sys/arch/arm/sunxi/sun50i_a64_ccu.c	Mon Nov 18 19:36:03 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sun50i_a64_ccu.c,v 1.13.2.1 2019/11/18 19:31:00 martin Exp $ */
+/* $NetBSD: sun50i_a64_ccu.c,v 1.13.2.2 2019/11/18 19:36:03 martin Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcne...@invisible.ca>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.13.2.1 2019/11/18 19:31:00 martin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.13.2.2 2019/11/18 19:36:03 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -60,6 +60,8 @@ __KERNEL_RCSID(1, "$NetBSD: sun50i_a64_c
 #define	SDMMC0_CLK_REG		0x088
 #define	SDMMC1_CLK_REG		0x08c
 #define	SDMMC2_CLK_REG		0x090
+#define	SPI0_CLK_REG		0x0a0
+#define	SPI1_CLK_REG		0x0a4
 #define	I2SPCM0_CLK_REG		0x0b0
 #define	I2SPCM1_CLK_REG		0x0b4
 #define	I2SPCM2_CLK_REG		0x0b8
@@ -158,6 +160,7 @@ static const char *ths_parents[] = { "ho
 static const char *de_parents[] = { "pll_periph0_2x", "pll_de" };
 static const char *hdmi_parents[] = { "pll_video0", "pll_video1" };
 static const char *i2s_parents[] = { "pll_audio_8x", "pll_audio_4x", "pll_audio_2x", "pll_audio" };
+static const char *spi_parents[] = { "hosc", "pll_periph0", "pll_periph1", NULL };
 static const char *tcon1_parents[] = { "pll_video0", NULL, "pll_video1", NULL };
 static const char *gpu_parents[] = { "pll_gpu" };
 
@@ -260,6 +263,16 @@ static struct sunxi_ccu_clk sun50i_a64_c
 	    SUNXI_CCU_NKMP_DIVIDE_BY_TWO),
 	SUNXI_CCU_FIXED_FACTOR(A64_CLK_PLL_PERIPH0_2X, "pll_periph0_2x", "pll_periph0", 1, 2),
 
+	SUNXI_CCU_NKMP(A64_CLK_PLL_PERIPH1, "pll_periph1", "hosc",
+	    PLL_PERIPH1_CTRL_REG,	/* reg */
+	    __BITS(12,8),		/* n */
+	    __BITS(5,4), 		/* k */
+	    0,				/* m */
+	    __BITS(17,16),		/* p */
+	    __BIT(31),			/* enable */
+	    SUNXI_CCU_NKMP_DIVIDE_BY_TWO),
+	SUNXI_CCU_FIXED_FACTOR(A64_CLK_PLL_PERIPH1_2X, "pll_periph1_2x", "pll_periph1", 1, 2),
+
 	SUNXI_CCU_NKMP_TABLE(A64_CLK_PLL_AUDIO_BASE, "pll_audio_base", "hosc",
 	    PLL_AUDIO_CTRL_REG,		/* reg */
 	    __BITS(14,8),		/* n */
@@ -430,6 +443,21 @@ static struct sunxi_ccu_clk sun50i_a64_c
 	    __BIT(31),		/* enable */
 	    0),
 
+	SUNXI_CCU_NM(A64_CLK_SPI0, "spi0", spi_parents,
+	    SPI0_CLK_REG,	/* reg */
+	    __BITS(17,16),	/* n */
+	    __BITS(3,0),	/* m */
+	    __BITS(25,24),	/* sel */
+	    __BIT(31),		/* enable */
+	    SUNXI_CCU_NM_POWER_OF_TWO|SUNXI_CCU_NM_ROUND_DOWN),
+
+	SUNXI_CCU_NM(A64_CLK_SPI1, "spi1", spi_parents,
+	    SPI1_CLK_REG,	/* reg */
+	    __BITS(17,16),	/* n */
+	    __BITS(3,0),	/* m */
+	    __BITS(25,24),	/* sel */
+	    __BIT(31),		/* enable */
+	    SUNXI_CCU_NM_POWER_OF_TWO|SUNXI_CCU_NM_ROUND_DOWN),
 
 	SUNXI_CCU_DIV_GATE(A64_CLK_TCON1, "tcon1", tcon1_parents,
 	    TCON1_CLK_REG,	/* reg */

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.103.2.4 src/sys/arch/evbarm/conf/GENERIC64:1.103.2.5
--- src/sys/arch/evbarm/conf/GENERIC64:1.103.2.4	Mon Nov 18 19:33:10 2019
+++ src/sys/arch/evbarm/conf/GENERIC64	Mon Nov 18 19:36:03 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.103.2.4 2019/11/18 19:33:10 martin Exp $
+#	$NetBSD: GENERIC64,v 1.103.2.5 2019/11/18 19:36:03 martin Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -402,6 +402,7 @@ ld*		at nvme? nsid ?
 
 # SPI controllers
 bcmspi*		at fdt?			# Broadcom BCM283x SPI
+sun6ispi*	at fdt?			# Allwinner SPI
 spi*		at spibus?
 
 # Audio support

Reply via email to