The NetBSD Project

CVS log for src/sys/arch/arm/sunxi/sun50i_a64_ccu.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / arch / arm / sunxi

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.24 / (download) - annotate - [select for diffs], Sun Nov 7 17:13:26 2021 UTC (2 years, 3 months ago) by jmcneill
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.23: +9 -2 lines
Diff to previous 1.23 (colored)

sunxi: sun50i-a64: add support for A64_CLK_CPUX clock

Revision 1.22.8.1 / (download) - annotate - [select for diffs], Sat Apr 3 22:28:18 2021 UTC (2 years, 11 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.22: +6 -6 lines
Diff to previous 1.22 (colored) next main 1.23 (colored)

Sync with HEAD.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Jan 27 03:10:20 2021 UTC (3 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.22: +6 -6 lines
Diff to previous 1.22 (colored)

Rename of_match_compat_data() to of_compatible_match().  Similarly,
rename of_search_compatible() to of_compatible_lookup().

Standardize on of_compatible_match() for driver matching, and adapt
all call sites.

Revision 1.13.2.4 / (download) - annotate - [select for diffs], Mon May 18 18:45:40 2020 UTC (3 years, 9 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE
Changes since 1.13.2.3: +12 -2 lines
Diff to previous 1.13.2.3 (colored) to branchpoint 1.13 (colored) next main 1.14 (colored)

Pull up following revision(s) (requested by riastradh in ticket #912):

	sys/arch/arm/dts/sun50i-a64.dtsi: revision 1.14
	sys/arch/evbarm/conf/GENERIC64: revision 1.116
	sys/arch/evbarm/conf/GENERIC64: revision 1.131
	sys/arch/arm/sunxi/sun50i_a64_ccu.c: revision 1.21
	sys/arch/arm/sunxi/sun50i_a64_ccu.c: revision 1.22
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.10
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.11
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.12
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.1
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.2
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.3
	sys/arch/arm/sunxi/sun8i_crypto.h: revision 1.1
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.4
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.5
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.6
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.7
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.8
	sys/arch/arm/sunxi/sun8i_crypto.c: revision 1.9
	sys/arch/arm/sunxi/files.sunxi: revision 1.67

Add crypto engine clock

Add SUNXI_CCU_NM_ROUND_DOWN to CE clock, fix pll parents to use 2X outputs

Add crypto engine block.

Draft driver for Allwinner Crypto Engine.
Found on, e.g., the Pinebook.

Only used for TRNG at the moment, but hooking it up to opencrypto(9)
shouldn't be too hard if anyone still cares about that these days.

The distribution of the alleged TRNG is very nonuniform distributed
seems to alternate between toward runs with exceptionally high
fractions of 0 bits and runs with exceptionally high fractions of 1
bits -- initially all my samples were mostly 0's, and then all my
samples were mostly 1's, and now I'm seeing more oscillation between
these runs.

So I've wired it up as RND_TYPE_UNKNOWN, not RND_TYPE_RNG (it will
immediately flunk our rngtest and be disabled), and I estimated it to
provide at most one bit of entropy per byte of data -- which may
still be optimistic.  I also added a sysctl node hw.sun8icryptoN.rng
to read out 1024-byte samples for analysis, and I left the driver
commented out in GENERIC64 for now.
(If anyone has contacts at Allwinner who can tell us about how the
alleged TRNG is supposed to work, please let me know!)

Reduce some duplicated bus_dma clutter.

Factor out some of the self-test logic used for debugging.

Add missing bus_dmamap_sync(POSTWRITE) while here.

Make sure ERESTART doesn't come flying out to userland.
I picked ERESTART to mean `all channels are occupied' because that's
what opencrypto(9) uses to decide whether to queue a request, but
it's not appropriate for sysctl(2) to return that.

Avoid a race between interruption and reacquisition of lock.
Otherwise, we would have leaked the memory in this case.

Tidy up comments.

Oops -- forgot to kmem_free.

Fix typo -- acknowledge interrupts _and_ errors.

Reduce entropy estimate for sun8icrypto TRNG.

NIST's SP800-90B entropy estimation tools put it at no more than .08
bits of entropy per byte of data(!), so estimate 100 bits of data per
bit of entropy.  This is probably not conservative enough -- the NIST
tools were written without knowledge of how this alleged TRNG works!
Knowledge of the physics of how the TRNG is supposed to work could
probably enable a better job at predicting the outputs.
While here, bump the size of data we can sample directly with sysctl
to 4096 bytes.

Enable sun8icrypto in GENERIC64.

But set its entropy estimate to zero until we have a better idea of
how it works.  Can't really hurt this way unless sun8icrypto is
maliciously dependent on all other inputs to the entropy pool, which
seems unlikely.

Fix (presently harmless) psato.

Don't overwrite cy_root_node; use cy_trng_node as intended.

Fix previous brainfart.

Don't use the uninitialized trng node as the root node -- derp.
Instead, use the root node as the root node, and initialize the trng
node here.

Revision 1.9.2.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:03:37 2020 UTC (3 years, 10 months ago) by martin
Branch: phil-wifi
Changes since 1.9.2.1: +116 -6 lines
Diff to previous 1.9.2.1 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.22 / (download) - annotate - [select for diffs], Sun Dec 8 18:13:24 2019 UTC (4 years, 2 months ago) by jmcneill
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: thorpej-futex
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored)

Add SUNXI_CCU_NM_ROUND_DOWN to CE clock, fix pll parents to use 2X outputs

Revision 1.21 / (download) - annotate - [select for diffs], Sun Dec 8 00:12:20 2019 UTC (4 years, 2 months ago) by jmcneill
Branch: MAIN
Changes since 1.20: +12 -2 lines
Diff to previous 1.20 (colored)

Add crypto engine clock

Revision 1.13.2.3 / (download) - annotate - [select for diffs], Mon Nov 25 16:18:40 2019 UTC (4 years, 3 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.13.2.2: +31 -6 lines
Diff to previous 1.13.2.2 (colored) to branchpoint 1.13 (colored)

Pull up following revision(s) (requested by jmcneill in ticket #470):

	sys/arch/arm/sunxi/sunxi_hdmiphy.c: revision 1.4
	sys/arch/arm/sunxi/sun50i_a64_ccu.c: revision 1.16
	sys/dev/ic/dw_hdmi.c: revision 1.5
	sys/arch/arm/sunxi/sunxi_hdmiphy.h: revision 1.2
	sys/arch/arm/sunxi/sun50i_a64_ccu.c: revision 1.17
	sys/dev/ic/dw_hdmi.c: revision 1.6
	sys/arch/arm/sunxi/sun50i_a64_ccu.c: revision 1.18
	sys/arch/arm/sunxi/sun50i_a64_ccu.c: revision 1.19
	sys/dev/ic/dw_hdmi.h: revision 1.5
	sys/arch/arm/sunxi/sunxi_mixer.c: revision 1.8
	sys/arch/arm/sunxi/sunxi_mixer.c: revision 1.9
	sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.22
	sys/arch/arm/sunxi/sunxi_dwhdmi.c: revision 1.5
	sys/arch/arm/sunxi/sunxi_dwhdmi.c: revision 1.6
	sys/arch/arm/sunxi/sunxi_dwhdmi.c: revision 1.7
	sys/arch/arm/sunxi/sunxi_dwhdmi.c: revision 1.8
	sys/arch/arm/sunxi/sun50i_a64_ccu.c: revision 1.20
	sys/arch/arm/sunxi/sunxi_mixer.c: revision 1.10
	sys/arch/arm/dts/sun50i-a64-pinebook.dts: revision 1.17
	sys/arch/arm/sunxi/sunxi_platform.c: revision 1.38
	sys/dev/fdt/fdt_port.c: revision 1.3
	sys/dev/fdt/fdt_port.c: revision 1.4
	sys/arch/arm/sunxi/sunxi_ccu_fractional.c: revision 1.5
	sys/arch/arm/sunxi/sunxi_lcdc.c: revision 1.7
	sys/arch/arm/sunxi/sunxi_ccu_fractional.c: revision 1.6
	sys/arch/arm/sunxi/sunxi_hdmiphy.c: revision 1.3

Fix CLK_BUS_HDMI bit

Enable TMDS clock

Store the flags passed to SUNXI_CCU_FRACTIONAL macro.
Previously the macro dropped the flags argument entirely, and did not
initialize the structure with it.

Allow bus glue to setup DDC clocks

Add TCON0 clock

HDMI PHY and TX share the same clocks. Do not enable clocks until both
reset resources have been deasserted. Explicitly set DDC clock dividers.
Honour SUNXI_CCU_FRACTIONAL_SET_ENABLE in fractional mode

Use fdtbus_get_reg to read "reg" property

Need to initialize the PHY before HPD sense and DDC will work

Set pixel clock on mode set

Set TCON1 parent to PLL_VIDEO1(1X)

Do not assume that an fb's pitch is width * 4 bytes.

Use actual hw mode, not proposed mode.

Set pre-divider M to 0 in fractional mode, as noted in user manual. Spotted by jak.

Support non-zero fb start pixels.

Set video PLLs to 297MHz

Do not assume the cursor pitch is the same as the primary fb

Enable HDMI and HDMI audio

Try to avoid changing hardware settings when the "nomodeset" kernel arg
is present.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Nov 24 10:27:37 2019 UTC (4 years, 3 months ago) by jmcneill
Branch: MAIN
Changes since 1.19: +21 -15 lines
Diff to previous 1.19 (colored)

Try to avoid changing hardware settings when the "nomodeset" kernel arg
is present.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Nov 23 22:46:53 2019 UTC (4 years, 3 months ago) by jmcneill
Branch: MAIN
Changes since 1.18: +9 -3 lines
Diff to previous 1.18 (colored)

Set video PLLs to 297MHz

Revision 1.18 / (download) - annotate - [select for diffs], Sat Nov 23 18:57:36 2019 UTC (4 years, 3 months ago) by jmcneill
Branch: MAIN
Changes since 1.17: +6 -2 lines
Diff to previous 1.17 (colored)

Set TCON1 parent to PLL_VIDEO1(1X)

Revision 1.17 / (download) - annotate - [select for diffs], Sat Nov 23 12:29:20 2019 UTC (4 years, 3 months ago) by jmcneill
Branch: MAIN
Changes since 1.16: +11 -2 lines
Diff to previous 1.16 (colored)

Add TCON0 clock

Revision 1.16 / (download) - annotate - [select for diffs], Fri Nov 22 19:46:38 2019 UTC (4 years, 3 months ago) by jmcneill
Branch: MAIN
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

Fix CLK_BUS_HDMI bit

Revision 1.13.2.2 / (download) - annotate - [select for diffs], Mon Nov 18 19:36:03 2019 UTC (4 years, 3 months ago) by martin
Branch: netbsd-9
Changes since 1.13.2.1: +30 -2 lines
Diff to previous 1.13.2.1 (colored) to branchpoint 1.13 (colored)

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

Revision 1.13.2.1 / (download) - annotate - [select for diffs], Mon Nov 18 19:31:00 2019 UTC (4 years, 3 months ago) by martin
Branch: netbsd-9
Changes since 1.13: +26 -2 lines
Diff to previous 1.13 (colored)

Pull up following revision(s) (requested by jmcneill in ticket #437):

	sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts: revision 1.2
	sys/arch/arm/sunxi/sunxi_ccu_div.c: revision 1.6
	sys/arch/arm/dts/sun50i-a64.dtsi: revision 1.13
	sys/arch/arm/dts/sun50i-a64-pine64.dts: revision 1.2
	sys/arch/arm/sunxi/sunxi_dwhdmi.c: revision 1.4
	sys/arch/arm/dts/sun50i-a64-pine64-plus.dts: revision 1.3
	sys/arch/arm/sunxi/sunxi_i2s.c: revision 1.7
	sys/arch/arm/sunxi/sun50i_a64_ccu.c: revision 1.14

Add support for A64 I2S clocks.
Add A64 HDMI audio support.
Enable HDMI audio support on Pine64, Pine64+, and Pine64 LTS boards.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Nov 17 19:51:12 2019 UTC (4 years, 3 months ago) by jmcneill
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.14: +30 -2 lines
Diff to previous 1.14 (colored)

Add SPI clocks

Revision 1.14 / (download) - annotate - [select for diffs], Sun Nov 17 17:33:17 2019 UTC (4 years, 3 months ago) by jmcneill
Branch: MAIN
Changes since 1.13: +26 -2 lines
Diff to previous 1.13 (colored)

Add support for A64 I2S clocks.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jul 1 21:06:47 2019 UTC (4 years, 8 months ago) by jmcneill
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

Fix gpu clock parent

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jun 27 14:51:33 2019 UTC (4 years, 8 months ago) by jmcneill
Branch: MAIN
Changes since 1.11: +25 -2 lines
Diff to previous 1.11 (colored)

Add GPU clocks

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:05:56 2019 UTC (4 years, 8 months ago) by christos
Branch: phil-wifi
Changes since 1.9: +81 -2 lines
Diff to previous 1.9 (colored)

Sync with HEAD

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jan 30 01:24:00 2019 UTC (5 years, 1 month ago) by jmcneill
Branch: MAIN
CVS Tags: phil-wifi-20190609, isaki-audio2-base, isaki-audio2
Changes since 1.10: +60 -4 lines
Diff to previous 1.10 (colored)

Add support for Allwinner A64's display pipeline.

Revision 1.3.4.2 / (download) - annotate - [select for diffs], Sat Jan 26 22:00:01 2019 UTC (5 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.3.4.1: +25 -2 lines
Diff to previous 1.3.4.1 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

Sync with HEAD

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jan 22 23:06:49 2019 UTC (5 years, 1 month ago) by jmcneill
Branch: MAIN
CVS Tags: pgoyette-compat-20190127
Changes since 1.9: +25 -2 lines
Diff to previous 1.9 (colored)

Add sun50i DE clocks.

Revision 1.3.4.1 / (download) - annotate - [select for diffs], Mon May 21 04:35:59 2018 UTC (5 years, 9 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.3: +159 -29 lines
Diff to previous 1.3 (colored)

Sync with HEAD

Revision 1.9 / (download) - annotate - [select for diffs], Fri May 18 02:03:00 2018 UTC (5 years, 9 months ago) by jmcneill
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521
Branch point for: phil-wifi
Changes since 1.8: +5 -5 lines
Diff to previous 1.8 (colored)

Set SUNXI_CCU_NM_DIVIDE_BY_TWO on mmc module clocks. There is an
undocumented post divider between the clock and mmc module.

Revision 1.8 / (download) - annotate - [select for diffs], Fri May 18 01:52:58 2018 UTC (5 years, 9 months ago) by jmcneill
Branch: MAIN
Changes since 1.7: +22 -9 lines
Diff to previous 1.7 (colored)

MMC clock source is the pll_periph's 2X output.

Revision 1.7 / (download) - annotate - [select for diffs], Thu May 10 23:58:05 2018 UTC (5 years, 9 months ago) by jmcneill
Branch: MAIN
Changes since 1.6: +85 -2 lines
Diff to previous 1.6 (colored)

Add PLL_CPUX clock

Revision 1.6 / (download) - annotate - [select for diffs], Wed May 9 19:38:40 2018 UTC (5 years, 9 months ago) by jmcneill
Branch: MAIN
Changes since 1.5: +19 -20 lines
Diff to previous 1.5 (colored)

Fix locations of bus gates

Revision 1.5 / (download) - annotate - [select for diffs], Tue May 8 22:07:02 2018 UTC (5 years, 9 months ago) by jmcneill
Branch: MAIN
Changes since 1.4: +28 -2 lines
Diff to previous 1.4 (colored)

Add audio clocks

Revision 1.4 / (download) - annotate - [select for diffs], Sat May 5 13:28:23 2018 UTC (5 years, 10 months ago) by jmcneill
Branch: MAIN
Changes since 1.3: +13 -4 lines
Diff to previous 1.3 (colored)

Add support for A64 thermal sensor clocks

Revision 1.3.2.2 / (download) - annotate - [select for diffs], Sun Dec 3 11:35:56 2017 UTC (6 years, 3 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.3.2.1: +333 -0 lines
Diff to previous 1.3.2.1 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

update from HEAD

Revision 1.3.2.1, Thu Sep 7 23:19:45 2017 UTC (6 years, 5 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.3: +0 -333 lines
FILE REMOVED

file sun50i_a64_ccu.c was added on branch tls-maxphys on 2017-12-03 11:35:56 +0000

Revision 1.3 / (download) - annotate - [select for diffs], Thu Sep 7 23:19:45 2017 UTC (6 years, 5 months ago) by jmcneill
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, pgoyette-compat-base, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: tls-maxphys, pgoyette-compat
Changes since 1.2: +2 -18 lines
Diff to previous 1.2 (colored)

Remove AHB2 source select init for now, it seems to cause EMAC RX problems

Revision 1.2 / (download) - annotate - [select for diffs], Thu Sep 7 10:23:32 2017 UTC (6 years, 5 months ago) by jmcneill
Branch: MAIN
Changes since 1.1: +4 -4 lines
Diff to previous 1.1 (colored)

Fix bit offsets for OHCI

Revision 1.1 / (download) - annotate - [select for diffs], Thu Sep 7 01:07:04 2017 UTC (6 years, 5 months ago) by jmcneill
Branch: MAIN

Add support for Allwinner A64 SoCs.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>