Amlogic T7 (A113D2) Clock Driver
Subsystems (4)
cover Amlogic T7 (A113D2) Clock Driver
I am trying to port the T7 clock driver from Khadas 5.4 kernel for Vim4 to mainline, but I am encountering some issues in the path.
The kernel panics at clk_mux_val_to_index, but I believe that all the needed clocks are registered.
If anyone from Amlogic or the community could help me understand what my driver is missing, that would be great.
I will continue to try to figure out, but it has been some weeks without progress =/.
Lucas Tanure (2):
clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
arm64: dts: amlogic: t7: SDCard, Ethernet and Clocking
.../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 66 + arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 189 + drivers/clk/meson/Kconfig | 25 + drivers/clk/meson/Makefile | 2 + drivers/clk/meson/t7-peripherals.c | 6368 +++++++++++++++++ drivers/clk/meson/t7-peripherals.h | 131 + drivers/clk/meson/t7-pll.c | 1543 ++++ drivers/clk/meson/t7-pll.h | 83 + .../clock/amlogic,t7-peripherals-clkc.h | 410 ++ .../dt-bindings/clock/amlogic,t7-pll-clkc.h | 69 + 10 files changed, 8886 insertions(+) create mode 100644 drivers/clk/meson/t7-peripherals.c create mode 100644 drivers/clk/meson/t7-peripherals.h create mode 100644 drivers/clk/meson/t7-pll.c create mode 100644 drivers/clk/meson/t7-pll.h create mode 100644 include/dt-bindings/clock/amlogic,t7-peripherals-clkc.h create mode 100644 include/dt-bindings/clock/amlogic,t7-pll-clkc.h
Starting kernel ...
uboot time: 14277917 us
boot 64bit kernel
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd092] [ 0.000000] Linux version 6.8.0-09793-gda876e5b54b3-dirty (tanureal@ryzen) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621, GNU ld (GNU Toolchain for the A-pr4 [ 0.000000] KASLR disabled due to lack of seed [ 0.000000] Machine model: Khadas vim4 [ 0.000000] efi: UEFI not found. [ 0.000000] OF: reserved mem: 0x0000000005000000..0x00000000052fffff (3072 KiB) nomap non-reusable secmon@5000000 [ 0.000000] OF: reserved mem: 0x0000000005300000..0x00000000072fffff (32768 KiB) nomap non-reusable secmon@5300000 [ 0.000000] NUMA: No NUMA configuration found [ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] NUMA: NODE_DATA [mem 0xdf10c9c0-0xdf10efff] [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000004ffffff] [ 0.000000] node 0: [mem 0x0000000005000000-0x00000000072fffff] [ 0.000000] node 0: [mem 0x0000000007300000-0x00000000df7fffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] On node 0, zone DMA: 2048 pages in unavailable ranges [ 0.000000] cma: Reserved 32 MiB at 0x00000000d9800000 on node -1 [ 0.000000] psci: probing for conduit method from DT. [ 0.000000] psci: PSCIv1.0 detected in firmware. [ 0.000000] psci: Using standard PSCI v0.2 function IDs [ 0.000000] psci: Trusted OS migration not required [ 0.000000] psci: SMC Calling Convention v1.1 [ 0.000000] percpu: Embedded 24 pages/cpu s58152 r8192 d31960 u98304 [ 0.000000] Detected VIPT I-cache on CPU0 [ 0.000000] CPU features: detected: Spectre-v2 [ 0.000000] CPU features: detected: Spectre-v4 [ 0.000000] CPU features: detected: Spectre-BHB [ 0.000000] CPU features: detected: ARM erratum 858921 [ 0.000000] alternatives: applying boot alternatives [ 0.000000] Kernel command line: root=UUID=a91e7bfe-4263-4e53-867d-7824e7c6a992 rw rootfstype=ext4 console=ttyS0,921600 no_console_suspend earlycon=ttyS0,0xfe078000 khadas_board=VIM4 androidboot.selinux=permissive androidboot.0 [ 0.000000] Unknown kernel command line parameters "khadas_board=VIM4", will be passed to user space. [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear) [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Fallback order for Node 0: 0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 901152 [ 0.000000] Policy zone: DMA [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] software IO TLB: SWIOTLB bounce buffer size adjusted to 3MB [ 0.000000] software IO TLB: area num 8. [ 0.000000] software IO TLB: SWIOTLB bounce buffer size roundup to 4MB [ 0.000000] software IO TLB: mapped [mem 0x00000000d8e00000-0x00000000d9200000] (4MB) [ 0.000000] Memory: 3445944K/3661824K available (16896K kernel code, 4426K rwdata, 9184K rodata, 9728K init, 611K bss, 183112K reserved, 32768K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=8. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] Tracing variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8 [ 0.000000] RCU Tasks: Setting shift to 3 and lim to 1 rcu_task_cb_adjust=1. [ 0.000000] RCU Tasks Trace: Setting shift to 3 and lim to 1 rcu_task_cb_adjust=1. [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set [ 0.000000] Root IRQ handler: gic_handle_irq [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. [ 0.000000] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.000000] arch_timer: CPU0: Trapping CNTVCT access [ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns [ 0.000000] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns [ 0.000210] Console: colour dummy device 80x25 [ 0.000253] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000) [ 0.000261] pid_max: default: 32768 minimum: 301 [ 0.000300] LSM: initializing lsm=capability [ 0.000358] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000371] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000920] cacheinfo: Unable to detect cache hierarchy for CPU 0 [ 0.001389] rcu: Hierarchical SRCU implementation. [ 0.001391] rcu: Max phase no-delay instances is 1000. [ 0.001834] EFI services will not be available. [ 0.001999] smp: Bringing up secondary CPUs ... [ 0.002408] CPU features: detected: ARM erratum 845719 [ 0.002426] Detected VIPT I-cache on CPU1 [ 0.002516] CPU1: Booted secondary processor 0x0000000100 [0x410fd034] [ 0.003007] Detected VIPT I-cache on CPU2 [ 0.003054] CPU2: Booted secondary processor 0x0000000101 [0x410fd034] [ 0.003497] Detected VIPT I-cache on CPU3 [ 0.003546] CPU3: Booted secondary processor 0x0000000102 [0x410fd034] [ 0.003988] Detected VIPT I-cache on CPU4 [ 0.004038] CPU4: Booted secondary processor 0x0000000103 [0x410fd034] [ 0.004472] Detected VIPT I-cache on CPU5 [ 0.004509] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.004519] arch_timer: CPU5: Trapping CNTVCT access [ 0.004527] CPU5: Booted secondary processor 0x0000000001 [0x410fd092] [ 0.004915] Detected VIPT I-cache on CPU6 [ 0.004940] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.004946] arch_timer: CPU6: Trapping CNTVCT access [ 0.004951] CPU6: Booted secondary processor 0x0000000002 [0x410fd092] [ 0.005333] Detected VIPT I-cache on CPU7 [ 0.005358] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.005364] arch_timer: CPU7: Trapping CNTVCT access [ 0.005369] CPU7: Booted secondary processor 0x0000000003 [0x410fd092] [ 0.005414] smp: Brought up 1 node, 8 CPUs [ 0.005419] SMP: Total of 8 processors activated. [ 0.005421] CPU: All CPU(s) started at EL2 [ 0.005434] CPU features: detected: 32-bit EL0 Support [ 0.005437] CPU features: detected: 32-bit EL1 Support [ 0.005440] CPU features: detected: CRC32 instructions [ 0.005485] alternatives: applying system-wide alternatives [ 0.006730] devtmpfs: initialized [ 0.008534] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.008545] futex hash table entries: 2048 (order: 5, 131072 bytes, linear) [ 0.008989] pinctrl core: initialized pinctrl subsystem [ 0.009581] DMI not present or invalid. [ 0.011290] NET: Registered PF_NETLINK/PF_ROUTE protocol family [ 0.011944] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations [ 0.012293] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.012711] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.012832] audit: initializing netlink subsys (disabled) [ 0.013075] audit: type=2000 audit(0.012:1): state=initialized audit_enabled=0 res=1 [ 0.013508] thermal_sys: Registered thermal governor 'step_wise' [ 0.013512] thermal_sys: Registered thermal governor 'power_allocator' [ 0.013557] cpuidle: using governor menu [ 0.013675] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. [ 0.013784] ASID allocator initialised with 65536 entries [ 0.014630] Serial: AMBA PL011 UART driver [ 0.017553] Modules: 22496 pages in range for non-PLT usage [ 0.017556] Modules: 514016 pages in range for PLT usage [ 0.017980] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages [ 0.017984] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page [ 0.017988] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages [ 0.017990] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page [ 0.017993] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages [ 0.017995] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page [ 0.017997] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages [ 0.018000] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page [ 0.018247] Demotion targets for Node 0: null [ 0.018884] ACPI: Interpreter disabled. [ 0.019584] iommu: Default domain type: Translated [ 0.019587] iommu: DMA domain TLB invalidation policy: strict mode [ 0.019979] SCSI subsystem initialized [ 0.020174] usbcore: registered new interface driver usbfs [ 0.020187] usbcore: registered new interface driver hub [ 0.020200] usbcore: registered new device driver usb [ 0.020434] pps_core: LinuxPPS API ver. 1 registered [ 0.020437] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]> [ 0.020443] PTP clock support registered [ 0.020487] EDAC MC: Ver: 3.0.0 [ 0.020717] scmi_core: SCMI protocol bus registered [ 0.021039] FPGA manager framework [ 0.021076] Advanced Linux Sound Architecture Driver Initialized. [ 0.021612] vgaarb: loaded [ 0.021857] clocksource: Switched to clocksource arch_sys_counter [ 0.021967] VFS: Disk quotas dquot_6.6.0 [ 0.021984] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) [ 0.022062] pnp: PnP ACPI: disabled [ 0.026651] NET: Registered PF_INET protocol family [ 0.026781] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear) [ 0.028598] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear) [ 0.028615] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) [ 0.028622] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 0.028750] TCP bind hash table entries: 32768 (order: 8, 1048576 bytes, linear) [ 0.029019] TCP: Hash tables configured (established 32768 bind 32768) [ 0.029096] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.029124] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.029225] NET: Registered PF_UNIX/PF_LOCAL protocol family [ 0.029506] RPC: Registered named UNIX socket transport module. [ 0.029510] RPC: Registered udp transport module. [ 0.029512] RPC: Registered tcp transport module. [ 0.029513] RPC: Registered tcp-with-tls transport module. [ 0.029515] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.029524] PCI: CLS 0 bytes, default 64 [ 0.029649] Unpacking initramfs... [ 0.033933] kvm [1]: IPA Size Limit: 40 bits [ 0.034713] kvm [1]: Hyp mode initialized successfully [ 0.035476] Initialise system trusted keyrings [ 0.035582] workingset: timestamp_bits=42 max_order=20 bucket_order=0 [ 0.035747] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.035906] NFS: Registering the id_resolver key type [ 0.035919] Key type id_resolver registered [ 0.035922] Key type id_legacy registered [ 0.035933] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 0.035935] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering... [ 0.036031] 9p: Installing v9fs 9p2000 file system support [ 0.062587] Key type asymmetric registered [ 0.062596] Asymmetric key parser 'x509' registered [ 0.062657] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245) [ 0.062661] io scheduler mq-deadline registered [ 0.062664] io scheduler kyber registered [ 0.062688] io scheduler bfq registered [ 0.063318] irq_meson_gpio: 157 to 12 gpio interrupt mux initialized [ 0.068061] EINJ: ACPI disabled. [ 0.072570] amlogic_t7_pll_probe [ 0.072855] amlogic_t7_pll_probe ret 0 [ 0.072943] amlogic_a1_periphs_probe [ 0.078155] amlogic_a1_periphs_probe ret 0 [ 0.084876] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 0.086691] fe078000.serial: ttyS0 at MMIO 0xfe078000 (irq = 14, base_baud = 1500000) is a meson_uart [ 0.086710] printk: legacy console [ttyS0] enabled [ 0.229167] sysfs: cannot create duplicate filename '/class/tty/ttyS0' [ 0.229669] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.230684] Hardware name: Khadas vim4 (DT) [ 0.231205] Call trace: [ 0.231509] dump_backtrace+0x94/0xec [ 0.231963] show_stack+0x18/0x24 [ 0.232374] dump_stack_lvl+0x78/0x90 [ 0.232829] dump_stack+0x18/0x24 [ 0.233241] sysfs_warn_dup+0x64/0x80 [ 0.233696] sysfs_do_create_link_sd+0xf0/0xf8 [ 0.234248] sysfs_create_link+0x20/0x40 [ 0.234736] device_add+0x27c/0x77c [ 0.235169] device_register+0x20/0x30 [ 0.235635] tty_register_device_attr+0xfc/0x240 [ 0.236209] tty_port_register_device_attr_serdev+0x8c/0xac [ 0.236902] serial_core_register_port+0x318/0x658 [ 0.237498] serial_ctrl_register_port+0x10/0x1c [ 0.238072] uart_add_one_port+0x10/0x1c [ 0.238560] meson_uart_probe+0x2c0/0x3b4 [ 0.239058] platform_probe+0x68/0xd8 [ 0.239513] really_probe+0x148/0x2b4 [ 0.239968] __driver_probe_device+0x78/0x12c [ 0.240510] driver_probe_device+0xdc/0x160 [ 0.241030] __driver_attach+0x94/0x19c [ 0.241507] bus_for_each_dev+0x74/0xd4 [ 0.241983] driver_attach+0x24/0x30 [ 0.242428] bus_add_driver+0xe4/0x1e8 [ 0.242893] driver_register+0x60/0x128 [ 0.243370] __platform_driver_register+0x28/0x34 [ 0.243955] meson_uart_platform_driver_init+0x1c/0x28 [ 0.244594] do_one_initcall+0x6c/0x1b0 [ 0.245071] kernel_init_freeable+0x1cc/0x294 [ 0.245613] kernel_init+0x20/0x1dc [ 0.246046] ret_from_fork+0x10/0x20 [ 0.246555] meson_uart fe078000.serial: Cannot register tty device on line 0 [ 0.247729] msm_serial: driver initialized [ 0.248150] SuperH (H)SCI(F) driver initialized [ 0.248544] STM32 USART driver initialized [ 0.263927] loop: module loaded [ 0.264952] megasas: 07.727.03.00-rc1 [ 0.271065] tun: Universal TUN/TAP device driver, 1.6 [ 0.271824] thunder_xcv, ver 1.0 [ 0.271878] thunder_bgx, ver 1.0 [ 0.271956] nicpf, ver 1.0 [ 0.273230] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version [ 0.273437] hns3: Copyright (c) 2017 Huawei Corporation. [ 0.274148] hclge is initializing [ 0.274541] e1000: Intel(R) PRO/1000 Network Driver [ 0.275116] e1000: Copyright (c) 1999-2006 Intel Corporation. [ 0.275860] e1000e: Intel(R) PRO/1000 Network Driver [ 0.276449] e1000e: Copyright(c) 1999 - 2015 Intel Corporation. [ 0.277209] igb: Intel(R) Gigabit Ethernet Network Driver [ 0.277867] igb: Copyright (c) 2007-2014 Intel Corporation. [ 0.278576] igbvf: Intel(R) Gigabit Virtual Function Network Driver [ 0.279330] igbvf: Copyright (c) 2009 - 2012 Intel Corporation. [ 0.280319] sky2: driver version 1.30 [ 0.281597] VFIO - User Level meta-driver version: 0.3 [ 0.283859] usbcore: registered new interface driver usb-storage [ 0.286328] i2c_dev: i2c /dev entries driver [ 0.292404] sdhci: Secure Digital Host Controller Interface driver [ 0.292481] sdhci: Copyright(c) Pierre Ossman [ 0.293577] Synopsys Designware Multimedia Card Interface Driver [ 0.294572] sdhci-pltfm: SDHCI platform and OF driver helper [ 0.296259] ledtrig-cpu: registered to indicate activity on CPUs [ 0.298966] meson-sm: secure-monitor enabled [ 0.299963] usbcore: registered new interface driver usbhid [ 0.299997] usbhid: USB HID core driver [ 0.306803] NET: Registered PF_PACKET protocol family [ 0.306919] 9pnet: Installing 9P2000 support [ 0.307331] Key type dns_resolver registered [ 0.318926] Timer migration: 1 hierarchy levels; 8 children per group; 1 crossnode level [ 0.319462] registered taskstats version 1 [ 0.319968] Loading compiled-in X.509 certificates [ 0.362771] clk: Disabling unused clocks [ 0.363100] PM: genpd: Disabling unused power domains [ 0.363383] ALSA device list: [ 0.363580] No soundcards found. [ 0.368194] meson-gx-mmc fe08a000.sd: Got CD GPIO [ 0.368524] SError Interrupt on CPU6, code 0x00000000bf000002 -- SError [ 0.368531] CPU: 6 PID: 87 Comm: kworker/u32:3 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.368537] Hardware name: Khadas vim4 (DT) [ 0.368540] Workqueue: async async_run_entry_fn [ 0.368552] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.368556] pc : clk_mux_val_to_index+0x0/0xc0 [ 0.368565] lr : clk_mux_get_parent+0x4c/0x84 [ 0.368571] sp : ffff800082efba10 [ 0.368572] x29: ffff800082efba10 x28: ffff8000823279c0 x27: ffff800082327000 [ 0.368578] x26: ffff000004c361c0 x25: 0000000000000000 x24: 0000000000000002 [ 0.368584] x23: ffff000003f1d300 x22: ffff000003f1d2a0 x21: ffff000004c37280 [ 0.368589] x20: ffff000004c36ec0 x19: ffff000004bba800 x18: 0000000000000020 [ 0.368594] x17: ffff000000022000 x16: 0000000000000003 x15: ffffffffffffffff [ 0.368599] x14: ffffffffffffffff x13: 0078756d2364732e x12: 3030306138306566 [ 0.368604] x11: 7f7f7f7f7f7f7f7f x10: ffff7fff83438910 x9 : 0000000000000005 [ 0.368609] x8 : 0101010101010101 x7 : 0000000000000000 x6 : 05114367045e5359 [ 0.368613] x5 : 0000000000000006 x4 : 0000000000000000 x3 : 0000000000000000 [ 0.368618] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000004c36ec0 [ 0.368624] Kernel panic - not syncing: Asynchronous SError Interrupt [ 0.368626] CPU: 6 PID: 87 Comm: kworker/u32:3 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.368630] Hardware name: Khadas vim4 (DT) [ 0.368631] Workqueue: async async_run_entry_fn [ 0.368635] Call trace: [ 0.368637] dump_backtrace+0x94/0xec [ 0.368644] show_stack+0x18/0x24 [ 0.368649] dump_stack_lvl+0x38/0x90 [ 0.368656] dump_stack+0x18/0x24 [ 0.368661] panic+0x388/0x3c8 [ 0.368666] nmi_panic+0x48/0x94 [ 0.368670] arm64_serror_panic+0x6c/0x78 [ 0.368674] do_serror+0x3c/0x78 [ 0.368677] el1h_64_error_handler+0x30/0x48 [ 0.368681] el1h_64_error+0x64/0x68 [ 0.368684] clk_mux_val_to_index+0x0/0xc0 [ 0.368689] __clk_register+0x440/0x82c [ 0.368693] devm_clk_register+0x5c/0xbc [ 0.368697] meson_mmc_clk_init+0x11c/0x2a8 [ 0.368702] meson_mmc_probe+0x18c/0x3c0 [ 0.368705] platform_probe+0x68/0xd8 [ 0.368711] really_probe+0x148/0x2b4 [ 0.368714] __driver_probe_device+0x78/0x12c [ 0.368718] driver_probe_device+0xdc/0x160 [ 0.368721] __device_attach_driver+0xb8/0x134 [ 0.368724] bus_for_each_drv+0x84/0xe0 [ 0.368727] __device_attach_async_helper+0xac/0xd0 [ 0.368730] async_run_entry_fn+0x34/0xe0 [ 0.368734] process_one_work+0x150/0x294 [ 0.368740] worker_thread+0x304/0x408 [ 0.368744] kthread+0x118/0x11c [ 0.368748] ret_from_fork+0x10/0x20 [ 0.368753] SMP: stopping secondary CPUs [ 0.368760] Kernel Offset: disabled [ 0.368761] CPU features: 0x0,00000060,d0080000,0200421b [ 0.368765] Memory Limit: none [ 0.400328] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---
Signature · 1 line
2.44.0
RFC PATCH 1/2 clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
Add the T7 PLL clock controller driver in the T7 SoC family.
This is RFC patch that enables SDCard, Ethernet and Clocking for Amlogic T7 soc.
In this current state the patch doesn't work and gives a kernel panic when probing the meson-axg-mmc for the SDCard. DO NOT MERGE.
--- drivers/clk/meson/Kconfig | 25 + drivers/clk/meson/Makefile | 2 + drivers/clk/meson/t7-peripherals.c | 6368 +++++++++++++++++ drivers/clk/meson/t7-peripherals.h | 131 + drivers/clk/meson/t7-pll.c | 1543 ++++ drivers/clk/meson/t7-pll.h | 83 + .../clock/amlogic,t7-peripherals-clkc.h | 410 ++ .../dt-bindings/clock/amlogic,t7-pll-clkc.h | 69 + 8 files changed, 8631 insertions(+) create mode 100644 drivers/clk/meson/t7-peripherals.c create mode 100644 drivers/clk/meson/t7-peripherals.h create mode 100644 drivers/clk/meson/t7-pll.c create mode 100644 drivers/clk/meson/t7-pll.h create mode 100644 include/dt-bindings/clock/amlogic,t7-peripherals-clkc.h create mode 100644 include/dt-bindings/clock/amlogic,t7-pll-clkc.h
drivers/clk/meson/Kconfig +25 -0
@@ -169,4 +169,29 @@ config COMMON_CLK_S4_PERIPHERALS help Support for the peripherals clock controller on Amlogic S805X2 and S905Y4 devices, AKA S4. Say Y if you want S4 peripherals clock controller to work. + +config COMMON_CLK_T7_PLL + tristate "T7 SoC PLL clock controllers support" + depends on ARM64 + default y + select COMMON_CLK_MESON_CLKC_UTILS + select COMMON_CLK_MESON_MPLL + select COMMON_CLK_MESON_PLL + select COMMON_CLK_MESON_REGMAP + help + Support for the PLL clock controller on Amlogic A113D2 device,AKA T7. + Say Y if you want the board to work, because PLLs are the parent of + most peripherals. + +config COMMON_CLK_T7_PERIPHERALS + tristate "T7 SoC peripherals clock controllers support" + depends on ARM64 + default y + select COMMON_CLK_MESON_CLKC_UTILS + select COMMON_CLK_MESON_REGMAP + select COMMON_CLK_MESON_DUALDIV + select COMMON_CLK_MESON_VID_PLL_DIV + help + Support for the peripherals clock controller on Amlogic A113D2 device, AKA T7. + Say Y if you want T7 peripherals clock controller to work. endmenu
drivers/clk/meson/Makefile +2 -0
@@ -24,3 +24,5 @@ obj-$(CONFIG_COMMON_CLK_G12A) += g12a.o g12a-aoclk.o obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o meson8-ddr.o obj-$(CONFIG_COMMON_CLK_S4_PLL) += s4-pll.o obj-$(CONFIG_COMMON_CLK_S4_PERIPHERALS) += s4-peripherals.o +obj-$(CONFIG_COMMON_CLK_T7_PLL) += t7-pll.o +obj-$(CONFIG_COMMON_CLK_T7_PERIPHERALS) += t7-peripherals.o
drivers/clk/meson/t7-peripherals.c new file +6368 -0
2,966 lines not on this page · raw message
drivers/clk/meson/t7-peripherals.h new file +131 -0
131 lines not on this page · raw message
drivers/clk/meson/t7-pll.c new file +1543 -0
1,543 lines not on this page · raw message
drivers/clk/meson/t7-pll.h new file +83 -0
83 lines not on this page · raw message
include/dt-bindings/clock/amlogic,t7-peripherals-clkc.h new file +410 -0
410 lines not on this page · raw message
include/dt-bindings/clock/amlogic,t7-pll-clkc.h new file +69 -0
69 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.44.0
Part of the diff is not shown here. View the raw message.
RFC PATCH 2/2 arm64: dts: amlogic: t7: SDCard, Ethernet and Clocking
In reply to Lucas TanureTest Clocking, SDCard and Ethernet for Khadas Vim4.
This is RFC patch that enables SDCard, Ethernet and Clocking for Amlogic T7 soc.
In this current state the patch doesn't work and gives a kernel panic when probing the meson-axg-mmc for the SDCard. DO NOT MERGE.
--- .../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 66 ++++++ arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 189 ++++++++++++++++++ 2 files changed, 255 insertions(+)
arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts +66 -0
@@ -6,6 +6,8 @@ /dts-v1/; #include "amlogic-t7.dtsi" +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/gpio/amlogic,t7-periphs-pinctrl.h> / { model = "Khadas vim4";
@@ -44,6 +46,27 @@ xtal: xtal-clk { clock-output-names = "xtal"; #clock-cells = <0>; }; + + sdcard_power: regulator-sdcard { + compatible = "regulator-fixed"; + regulator-name = "SDCARD_POWER"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio GPIOD_11 GPIO_ACTIVE_LOW>; + regulator-boot-on; + enable-active-low; + regulator-always-on; + }; + + vddio_card: gpio-regulator { + compatible = "regulator-gpio"; + regulator-name = "VDDIO_CARD"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + gpios = <&gpio GPIOD_9 GPIO_ACTIVE_HIGH>; + gpios-states = <1>; + states = <1800000 1 3300000 0>; + }; };
@@ -52,3 +75,46 @@ &uart_a { clocks = <&xtal>, <&xtal>, <&xtal>; clock-names = "xtal", "pclk", "baud"; }; + +/* SD card */ +&sd_emmc_b { + status = "okay"; + pinctrl-0 = <&sd_all_pins>; + pinctrl-1 = <&sd_1bit_pins>; + pinctrl-2 = <&sd_clk_gate_pins>; + pinctrl-names = "sd_default", + "sd_1bit_pins", + "clk-gate"; + bus-width = <4>; + cap-sd-highspeed; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + max-frequency = <200000000>; + + disable-wp; + + cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_HIGH>; + //dat1-gpios = <&gpio GPIOC_1 GPIO_ACTIVE_HIGH>; + vmmc-supply = <&sdcard_power>; + vqmmc-supply = <&vddio_card>; +}; + +&ext_mdio { + external_phy: ethernet-phy@0 { + reg = <0>; + max-speed = <1000>; + }; +}; + +ðmac { + pinctrl-0 = <ð_pins>, <ð_rgmii_pins>; + pinctrl-names = "default"; + status = "okay"; + phy-mode = "rgmii"; + phy-handle = <&external_phy>; + mc_val = <0x1621>; + cali_val = <0xa0000>; + amlogic,tx-delay-ns = <2>; +};
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +189 -0
214 lines not on this page · raw message
Signature · 1 line
2.44.0
Rob Herring
maintainerRe: [RFC][PATCH 1/2] clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
In reply to Lucas TanureQuoted 24 lines · Lucas Tanure
Add the T7 PLL clock controller driver in the T7 SoC family.
This is RFC patch that enables SDCard, Ethernet and Clocking for Amlogic T7 soc.
In this current state the patch doesn't work and gives a kernel panic when probing the meson-axg-mmc for the SDCard. DO NOT MERGE.Signed-off-by Lucas Tanure <[email protected]>--- drivers/clk/meson/Kconfig | 25 + drivers/clk/meson/Makefile | 2 + drivers/clk/meson/t7-peripherals.c | 6368 +++++++++++++++++ drivers/clk/meson/t7-peripherals.h | 131 + drivers/clk/meson/t7-pll.c | 1543 ++++ drivers/clk/meson/t7-pll.h | 83 + .../clock/amlogic,t7-peripherals-clkc.h | 410 ++ .../dt-bindings/clock/amlogic,t7-pll-clkc.h | 69 + 8 files changed, 8631 insertions(+) create mode 100644 drivers/clk/meson/t7-peripherals.c create mode 100644 drivers/clk/meson/t7-peripherals.h create mode 100644 drivers/clk/meson/t7-pll.c create mode 100644 drivers/clk/meson/t7-pll.h
Quoted 2 lines
create mode 100644 include/dt-bindings/clock/amlogic,t7-peripherals-clkc.h create mode 100644 include/dt-bindings/clock/amlogic,t7-pll-clkc.h
I'm assuming since this is an RFC you know these go in a separate patch with the DT binding schema which is missing.
Rob
Re: [RFC][PATCH 1/2] clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
Quoted 26 lines · Rob Herring
Quoted 23 lines · Lucas Tanure
Add the T7 PLL clock controller driver in the T7 SoC family.
This is RFC patch that enables SDCard, Ethernet and Clocking for Amlogic T7 soc.
In this current state the patch doesn't work and gives a kernel panic when probing the meson-axg-mmc for the SDCard. DO NOT MERGE.Signed-off-by Lucas Tanure <[email protected]>--- drivers/clk/meson/Kconfig | 25 + drivers/clk/meson/Makefile | 2 + drivers/clk/meson/t7-peripherals.c | 6368 +++++++++++++++++ drivers/clk/meson/t7-peripherals.h | 131 + drivers/clk/meson/t7-pll.c | 1543 ++++ drivers/clk/meson/t7-pll.h | 83 + .../clock/amlogic,t7-peripherals-clkc.h | 410 ++ .../dt-bindings/clock/amlogic,t7-pll-clkc.h | 69 + 8 files changed, 8631 insertions(+) create mode 100644 drivers/clk/meson/t7-peripherals.c create mode 100644 drivers/clk/meson/t7-peripherals.h create mode 100644 drivers/clk/meson/t7-pll.c create mode 100644 drivers/clk/meson/t7-pll.h
Quoted 7 lines
Quoted 2 lines
create mode 100644 include/dt-bindings/clock/amlogic,t7-peripherals-clkc.h create mode 100644 include/dt-bindings/clock/amlogic,t7-pll-clkc.hI'm assuming since this is an RFC you know these go in a separate patch with the DT binding schema which is missing.
Rob
Yes, This would be a few patches at least. The thing right now is to get it to work.
I think some obscure thing is missing when setting up these clocks, and only Amlogic knows.
After I have a working driver, I will submit a proper patch series with documentation for the drivers and device trees.
Thanks
Lucas Tanure
kernel test robot
build botRe: [RFC][PATCH 1/2] clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
In reply to Lucas Tanurekernel test robot noticed the following build warnings:
Hi Lucas,
[This is a private test report for your RFC patch.] kernel test robot noticed the following build warnings:
[auto build test WARNING on clk/clk-next]
[also build test WARNING on robh/for-next krzk/for-next krzk-dt/for-next linus/master v6.8 next-20240318] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Lucas-Tanure/clk-meson-T7-add-support-for-Amlogic-T7-SoC-PLL-clock-driver/20240318-194707 base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next patch link: https://lore.kernel.org/r/20240318114346.112935-2-tanure%40linux.com patch subject: [RFC][PATCH 1/2] clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver config: arm64-defconfig (https://download.01.org/0day-ci/archive/20240319/[email protected]/config) compiler: aarch64-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240319/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/clk/meson/t7-pll.c:87:29: warning: 'meson_pll_clk_no_ops' defined but not used [-Wunused-const-variable=]
87 | static const struct clk_ops meson_pll_clk_no_ops = {};
| ^~~~~~~~~~~~~~~~~~~~vim +/meson_pll_clk_no_ops +87 drivers/clk/meson/t7-pll.c
86
> 87 static const struct clk_ops meson_pll_clk_no_ops = {};
88 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [RFC][PATCH 1/2] clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
In reply to Lucas Tanurekernel test robot noticed the following build warnings:
Hi Lucas,
[This is a private test report for your RFC patch.] kernel test robot noticed the following build warnings:
[auto build test WARNING on clk/clk-next]
[also build test WARNING on robh/for-next krzk/for-next krzk-dt/for-next linus/master v6.8 next-20240319] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Lucas-Tanure/clk-meson-T7-add-support-for-Amlogic-T7-SoC-PLL-clock-driver/20240318-194707 base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next patch link: https://lore.kernel.org/r/20240318114346.112935-2-tanure%40linux.com patch subject: [RFC][PATCH 1/2] clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20240320/[email protected]/config) compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 8f68022f8e6e54d1aeae4ed301f5a015963089b7) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240320/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/clk/meson/t7-pll.c:87:29: warning: unused variable 'meson_pll_clk_no_ops' [-Wunused-const-variable]
87 | static const struct clk_ops meson_pll_clk_no_ops = {};
| ^~~~~~~~~~~~~~~~~~~~1 warning generated.
vim +/meson_pll_clk_no_ops +87 drivers/clk/meson/t7-pll.c
86
> 87 static const struct clk_ops meson_pll_clk_no_ops = {};
88 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [RFC][PATCH 1/2] clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
In reply to a message not in the archiveQuoted 8,708 lines · Lucas Tanure
Quoted 8,706 lines · Lucas Tanure
Add the T7 PLL clock controller driver in the T7 SoC family.
This is RFC patch that enables SDCard, Ethernet and Clocking for Amlogic T7 soc.
In this current state the patch doesn't work and gives a kernel panic when probing the meson-axg-mmc for the SDCard. DO NOT MERGE.Signed-off-by Lucas Tanure <[email protected]>--- drivers/clk/meson/Kconfig | 25 + drivers/clk/meson/Makefile | 2 + drivers/clk/meson/t7-peripherals.c | 6368 +++++++++++++++++ drivers/clk/meson/t7-peripherals.h | 131 + drivers/clk/meson/t7-pll.c | 1543 ++++ drivers/clk/meson/t7-pll.h | 83 + .../clock/amlogic,t7-peripherals-clkc.h | 410 ++ .../dt-bindings/clock/amlogic,t7-pll-clkc.h | 69 + 8 files changed, 8631 insertions(+) create mode 100644 drivers/clk/meson/t7-peripherals.c create mode 100644 drivers/clk/meson/t7-peripherals.h create mode 100644 drivers/clk/meson/t7-pll.c create mode 100644 drivers/clk/meson/t7-pll.h create mode 100644 include/dt-bindings/clock/amlogic,t7-peripherals-clkc.h create mode 100644 include/dt-bindings/clock/amlogic,t7-pll-clkc.hdrivers/clk/meson/Kconfig +25
-0@@ -169,4 +169,29 @@ config COMMON_CLK_S4_PERIPHERALS help Support for the peripherals clock controller on Amlogic S805X2 and S905Y4 devices, AKA S4. Say Y if you want S4 peripherals clock controller to work. + +config COMMON_CLK_T7_PLL + tristate "T7 SoC PLL clock controllers support" + depends on ARM64 + default y + select COMMON_CLK_MESON_CLKC_UTILS + select COMMON_CLK_MESON_MPLL + select COMMON_CLK_MESON_PLL + select COMMON_CLK_MESON_REGMAP + help + Support for the PLL clock controller on Amlogic A113D2 device,AKA T7. + Say Y if you want the board to work, because PLLs are the parent of + most peripherals. + +config COMMON_CLK_T7_PERIPHERALS + tristate "T7 SoC peripherals clock controllers support" + depends on ARM64 + default y + select COMMON_CLK_MESON_CLKC_UTILS + select COMMON_CLK_MESON_REGMAP + select COMMON_CLK_MESON_DUALDIV + select COMMON_CLK_MESON_VID_PLL_DIV + help + Support for the peripherals clock controller on Amlogic A113D2 device, AKA T7. + Say Y if you want T7 peripherals clock controller to work. endmenudrivers/clk/meson/Makefile +2
-0@@ -24,3 +24,5 @@ obj-$(CONFIG_COMMON_CLK_G12A) += g12a.o g12a-aoclk.o obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o meson8-ddr.o obj-$(CONFIG_COMMON_CLK_S4_PLL) += s4-pll.o obj-$(CONFIG_COMMON_CLK_S4_PERIPHERALS) += s4-peripherals.o +obj-$(CONFIG_COMMON_CLK_T7_PLL) += t7-pll.o +obj-$(CONFIG_COMMON_CLK_T7_PERIPHERALS) += t7-peripherals.odrivers/clk/meson/t7-peripherals.c new file +6368
-0@@ -0,0 +1,6368 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Amlogic Meson-T7 Clock Controller Driver +* +* Copyright (c) 2018 Amlogic, inc. +*/ + +#include <linux/clk-provider.h> +#include <linux/of_device.h> +#include <linux/platform_device.h> + +#include "clk-regmap.h" +#include "vid-pll-div.h" +#include "clk-dualdiv.h" +#include "t7-peripherals.h" +#include "meson-clkc-utils.h" +#include <dt-bindings/clock/amlogic,t7-peripherals-clkc.h> + + +/* +*rtc 32k clock +* +*xtal--GATE------------------GATE---------------------|\ +* | -------- | \ +* | | | | \ +* ---| DUAL |----------------------| | +* | | | |____GATE__ +* -------- | | rtc_32k_out +* PAD-----------------------------------------| / +* | / +* DUAL function: |/ +* bit 28 in RTC_BY_OSCIN_CTRL0 control the dual function. +* when bit 28 = 0 +* f = 24M/N0 +* when bit 28 = 1 +* output N1 and N2 in turns. +* T = (x*T1 + y*T2)/x+y +* f = (24M/(N0*M0 + N1*M1)) * (M0 + M1) +* f: the frequecy value (HZ) +* | | | | +* | Div1 |-| Cnt1 | +* /|______| |______|\ +* -| ______ ______ ---> Out +* \| | | |/ +* | Div2 |-| Cnt2 | +* |______| |______| +**/ + +/* +* rtc 32k clock in gate +*/ +static struct clk_regmap t7_rtc_32k_clkin = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_RTC_BY_OSCIN_CTRL0 , + .bit_idx =31 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="rtc_32k_clkin" , + .ops = &clk_regmap_gate_ops, + .parent_data = &(const struct clk_parent_data ) { + .fw_name ="xtal" , + }, + .num_parents =1 , + }, +}; + +static const struct meson_clk_dualdiv_param t7_32k_div_table[] = { + { + .dual =1 , + .n1 =733 , + .m1 =8 , + .n2 =732 , + .m2 =11 , + }, + {} +}; + +static struct clk_regmap t7_rtc_32k_div = { + .data = &(struct meson_clk_dualdiv_data ){ + .n1 = { + .reg_off =CLKCTRL_RTC_BY_OSCIN_CTRL0 , + .shift =0 , + .width =12 , + }, + .n2 = { + .reg_off =CLKCTRL_RTC_BY_OSCIN_CTRL0 , + .shift =12 , + .width =12 , + }, + .m1 = { + .reg_off =CLKCTRL_RTC_BY_OSCIN_CTRL1 , + .shift =0 , + .width =12 , + }, + .m2 = { + .reg_off =CLKCTRL_RTC_BY_OSCIN_CTRL1 , + .shift =12 , + .width =12 , + }, + .dual = { + .reg_off =CLKCTRL_RTC_BY_OSCIN_CTRL0 , + .shift =28 , + .width =1 , + }, + .table = t7_32k_div_table, + }, + .hw.init = &(struct clk_init_data ){ + .name ="rtc_32k_div" , + .ops = &meson_clk_dualdiv_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_rtc_32k_clkin.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_rtc_32k_xtal = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_RTC_BY_OSCIN_CTRL1 , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="rtc_32k_xtal" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_rtc_32k_clkin.hw + }, + .num_parents =1 , + }, +}; + +/* +* three parent for rtc clock out +* pad is from where? +*/ +static u32 rtc_32k_sel[] = {0 ,1 }; +static struct clk_regmap t7_rtc_32k_sel = { + .data = &(struct clk_regmap_mux_data ) { + .offset =CLKCTRL_RTC_CTRL , + .mask =0x3 , + .shift =0 , + .table = rtc_32k_sel, + .flags =CLK_MUX_ROUND_CLOSEST , + }, + .hw.init = &(struct clk_init_data ){ + .name ="rtc_32k_sel" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_rtc_32k_xtal.hw, + &t7_rtc_32k_div.hw + }, + .num_parents =2 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_rtc_clk = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_RTC_BY_OSCIN_CTRL0 , + .bit_idx =30 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="rtc_clk" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_rtc_32k_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +/* sys clk */ +static u32 mux_table_sys_ab_clk_sel[] = {0 ,1 ,2 ,3 ,4 ,5 ,7 }; +static const struct clk_parent_data t7_table_sys_ab_clk_sel[] = { + { .fw_name ="xtal" , }, + { .fw_name ="fclk_div2" , }, + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div4" , }, + { .fw_name ="fclk_div5" , }, + { .fw_name ="axi_clk_frcpu" , }, + { .hw = &t7_rtc_clk.hw } +}; + +static struct clk_regmap t7_sysclk_b_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_SYS_CLK_CTRL0 , + .mask =0x7 , + .shift =26 , + .table = mux_table_sys_ab_clk_sel, + }, + .hw.init = &(struct clk_init_data ){ + .name ="sysclk_b_sel" , + .ops = &clk_regmap_mux_ro_ops, + .parent_data = t7_table_sys_ab_clk_sel, + .num_parents =ARRAY_SIZE (t7_table_sys_ab_clk_sel), + }, +}; + +static struct clk_regmap t7_sysclk_b_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_SYS_CLK_CTRL0 , + .shift =16 , + .width =10 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="sysclk_b_div" , + .ops = &clk_regmap_divider_ro_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_sysclk_b_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_sysclk_b = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_SYS_CLK_CTRL0 , + .bit_idx =29 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="sysclk_b" , + .ops = &clk_regmap_gate_ro_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_sysclk_b_div.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_sysclk_a_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_SYS_CLK_CTRL0 , + .mask =0x7 , + .shift =10 , + .table = mux_table_sys_ab_clk_sel, + }, + .hw.init = &(struct clk_init_data ){ + .name ="sysclk_a_sel" , + .ops = &clk_regmap_mux_ro_ops, + .parent_data = t7_table_sys_ab_clk_sel, + .num_parents =ARRAY_SIZE (t7_table_sys_ab_clk_sel), + }, +}; + +static struct clk_regmap t7_sysclk_a_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_SYS_CLK_CTRL0 , + .shift =0 , + .width =10 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="sysclk_a_div" , + .ops = &clk_regmap_divider_ro_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_sysclk_a_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_sysclk_a = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_SYS_CLK_CTRL0 , + .bit_idx =13 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="sysclk_a" , + .ops = &clk_regmap_gate_ro_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_sysclk_a_div.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_sys_clk = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_SYS_CLK_CTRL0 , + .mask =0x1 , + .shift =15 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="sys_clk" , + .ops = &clk_regmap_mux_ro_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_sysclk_a.hw, + &t7_sysclk_b.hw, + }, + .num_parents =2 , + }, +}; + +/*axi clk*/ + +/*ceca_clk*/ +static struct clk_regmap t7_ceca_32k_clkin = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_CECA_CTRL0 , + .bit_idx =31 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="ceca_32k_clkin" , + .ops = &clk_regmap_gate_ops, + .parent_data = &(const struct clk_parent_data ) { + .fw_name ="xtal" , + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_ceca_32k_div = { + .data = &(struct meson_clk_dualdiv_data ){ + .n1 = { + .reg_off =CLKCTRL_CECA_CTRL0 , + .shift =0 , + .width =12 , + }, + .n2 = { + .reg_off =CLKCTRL_CECA_CTRL0 , + .shift =12 , + .width =12 , + }, + .m1 = { + .reg_off =CLKCTRL_CECA_CTRL1 , + .shift =0 , + .width =12 , + }, + .m2 = { + .reg_off =CLKCTRL_CECA_CTRL1 , + .shift =12 , + .width =12 , + }, + .dual = { + .reg_off =CLKCTRL_CECA_CTRL0 , + .shift =28 , + .width =1 , + }, + .table = t7_32k_div_table, + }, + .hw.init = &(struct clk_init_data ){ + .name ="ceca_32k_div" , + .ops = &meson_clk_dualdiv_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_ceca_32k_clkin.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_ceca_32k_sel_pre = { + .data = &(struct clk_regmap_mux_data ) { + .offset =CLKCTRL_CECA_CTRL1 , + .mask =0x1 , + .shift =24 , + .flags =CLK_MUX_ROUND_CLOSEST , + }, + .hw.init = &(struct clk_init_data ){ + .name ="ceca_32k_sel_pre" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_ceca_32k_div.hw, + &t7_ceca_32k_clkin.hw + }, + .num_parents =2 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_ceca_32k_sel = { + .data = &(struct clk_regmap_mux_data ) { + .offset =CLKCTRL_CECA_CTRL1 , + .mask =0x1 , + .shift =31 , + .flags =CLK_MUX_ROUND_CLOSEST , + }, + .hw.init = &(struct clk_init_data ){ + .name ="ceca_32k_sel" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_ceca_32k_sel_pre.hw, + &t7_rtc_clk.hw + }, + .num_parents =2 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_ceca_32k_clkout = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_CECA_CTRL0 , + .bit_idx =30 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="ceca_32k_clkout" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_ceca_32k_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +/*cecb_clk*/ +static struct clk_regmap t7_cecb_32k_clkin = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_CECB_CTRL0 , + .bit_idx =31 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="cecb_32k_clkin" , + .ops = &clk_regmap_gate_ops, + .parent_data = &(const struct clk_parent_data ) { + .fw_name ="xtal" , + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_cecb_32k_div = { + .data = &(struct meson_clk_dualdiv_data ){ + .n1 = { + .reg_off =CLKCTRL_CECB_CTRL0 , + .shift =0 , + .width =12 , + }, + .n2 = { + .reg_off =CLKCTRL_CECB_CTRL0 , + .shift =12 , + .width =12 , + }, + .m1 = { + .reg_off =CLKCTRL_CECB_CTRL1 , + .shift =0 , + .width =12 , + }, + .m2 = { + .reg_off =CLKCTRL_CECB_CTRL1 , + .shift =12 , + .width =12 , + }, + .dual = { + .reg_off =CLKCTRL_CECB_CTRL0 , + .shift =28 , + .width =1 , + }, + .table = t7_32k_div_table, + }, + .hw.init = &(struct clk_init_data ){ + .name ="cecb_32k_div" , + .ops = &meson_clk_dualdiv_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_cecb_32k_clkin.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_cecb_32k_sel_pre = { + .data = &(struct clk_regmap_mux_data ) { + .offset =CLKCTRL_CECB_CTRL1 , + .mask =0x1 , + .shift =24 , + .flags =CLK_MUX_ROUND_CLOSEST , + }, + .hw.init = &(struct clk_init_data ){ + .name ="cecb_32k_sel_pre" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_cecb_32k_div.hw, + &t7_cecb_32k_clkin.hw + }, + .num_parents =2 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_cecb_32k_sel = { + .data = &(struct clk_regmap_mux_data ) { + .offset =CLKCTRL_CECB_CTRL1 , + .mask =0x1 , + .shift =31 , + .flags =CLK_MUX_ROUND_CLOSEST , + }, + .hw.init = &(struct clk_init_data ){ + .name ="cecb_32k_sel" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_cecb_32k_sel_pre.hw, + &t7_rtc_clk.hw + }, + .num_parents =2 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_cecb_32k_clkout = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_CECB_CTRL0 , + .bit_idx =30 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="cecb_32k_clkout" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_cecb_32k_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static const struct clk_parent_data t7_sc_parent_data[] = { + { .fw_name ="fclk_div4" , }, + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div5" , }, + { .fw_name ="xtal" , } +}; + +static struct clk_regmap t7_sc_clk_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_SC_CLK_CTRL , + .mask =0x3 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="sc_clk_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_sc_parent_data, + .num_parents =ARRAY_SIZE (t7_sc_parent_data), + .flags =CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_sc_clk_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_SC_CLK_CTRL , + .shift =0 , + .width =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="sc_clk_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_sc_clk_mux.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_sc_clk_gate = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_SC_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="sc_clk_gate" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_sc_clk_div.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +/*rama_clk*/ + +/*dspa_clk*/ +static const struct clk_parent_data t7_dsp_parent_hws[] = { + { .fw_name ="xtal" , }, + { .fw_name ="fclk_div2p5" , }, + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div5" , }, + { .fw_name ="hifi_pll" , }, + { .fw_name ="fclk_div4" , }, + { .fw_name ="fclk_div7" , }, + { .hw = &t7_rtc_clk.hw } +}; + +static struct clk_regmap t7_dspa_a_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_DSPA_CLK_CTRL0 , + .mask =0x7 , + .shift =10 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="dspa_a_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_dsp_parent_hws, + .num_parents =ARRAY_SIZE (t7_dsp_parent_hws), + }, +}; + +static struct clk_regmap t7_dspa_a_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_DSPA_CLK_CTRL0 , + .shift =0 , + .width =10 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="dspa_a_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_dspa_a_mux.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_dspa_a_gate = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_DSPA_CLK_CTRL0 , + .bit_idx =13 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="dspa_a_gate" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_dspa_a_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_dspa_b_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_DSPA_CLK_CTRL0 , + .mask =0x7 , + .shift =26 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="dspa_b_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_dsp_parent_hws, + .num_parents =ARRAY_SIZE (t7_dsp_parent_hws), + }, +}; + +static struct clk_regmap t7_dspa_b_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_DSPA_CLK_CTRL0 , + .shift =16 , + .width =10 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="dspa_b_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_dspa_b_mux.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_dspa_b_gate = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_DSPA_CLK_CTRL0 , + .bit_idx =29 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="dspa_b_gate" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_dspa_b_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_dspa_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_DSPA_CLK_CTRL0 , + .mask =0x1 , + .shift =15 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="dspa_mux" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_dspa_a_gate.hw, + &t7_dspa_b_gate.hw, + }, + .num_parents =2 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_dspb_a_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_DSPB_CLK_CTRL0 , + .mask =0x7 , + .shift =10 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="dspb_a_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_dsp_parent_hws, + .num_parents =ARRAY_SIZE (t7_dsp_parent_hws), + }, +}; + +static struct clk_regmap t7_dspb_a_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_DSPB_CLK_CTRL0 , + .shift =0 , + .width =10 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="dspb_a_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_dspb_a_mux.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_dspb_a_gate = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_DSPB_CLK_CTRL0 , + .bit_idx =13 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="dspb_a_gate" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_dspb_a_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_dspb_b_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_DSPB_CLK_CTRL0 , + .mask =0x7 , + .shift =26 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="dspb_b_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_dsp_parent_hws, + .num_parents =ARRAY_SIZE (t7_dsp_parent_hws), + }, +}; + +static struct clk_regmap t7_dspb_b_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_DSPB_CLK_CTRL0 , + .shift =16 , + .width =10 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="dspb_b_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_dspb_b_mux.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_dspb_b_gate = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_DSPB_CLK_CTRL0 , + .bit_idx =29 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="dspb_b_gate" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_dspb_b_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_dspb_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_DSPB_CLK_CTRL0 , + .mask =0x1 , + .shift =15 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="dspb_mux" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_dspb_a_gate.hw, + &t7_dspb_b_gate.hw, + }, + .num_parents =2 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +/*12_24M clk*/ +static struct clk_regmap t7_24M_clk_gate = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_CLK12_24_CTRL , + .bit_idx =11 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="24m" , + .ops = &clk_regmap_gate_ops, + .parent_data = &(const struct clk_parent_data ) { + .fw_name ="xtal" , + }, + .num_parents =1 , + }, +}; + +static struct clk_fixed_factor t7_12M_clk_div = { + .mult =1 , + .div =2 , + .hw.init = &(struct clk_init_data ){ + .name ="24m_div2" , + .ops = &clk_fixed_factor_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_24M_clk_gate.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_12M_clk_gate = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_CLK12_24_CTRL , + .bit_idx =10 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="12m" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_12M_clk_div.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_25M_clk_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_CLK12_24_CTRL , + .shift =0 , + .width =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="25M_clk_div" , + .ops = &clk_regmap_divider_ops, + .parent_data = &(const struct clk_parent_data ) { + .fw_name ="fclk_div2" , + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_25M_clk_gate = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_CLK12_24_CTRL , + .bit_idx =12 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="25m" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_25M_clk_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +/* Video Clocks */ +static struct clk_regmap t7_vid_pll_div = { + .data = &(struct meson_vid_pll_div_data ){ + .val = { + .reg_off =CLKCTRL_VID_PLL_CLK0_DIV , + .shift =0 , + .width =15 , + }, + .sel = { + .reg_off =CLKCTRL_VID_PLL_CLK0_DIV , + .shift =16 , + .width =2 , + }, + }, + .hw.init = &(struct clk_init_data ) { + .name ="vid_pll_div" , + .ops = &meson_vid_pll_div_ro_ops, + .parent_data = &(const struct clk_parent_data ) { + .fw_name ="hdmi_pll" , + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_GET_RATE_NOCACHE , + }, +}; + +static const struct clk_parent_data t7_vid_pll_parent_data[] = { + { .hw = &t7_vid_pll_div.hw, }, + { .fw_name ="hdmi_pll" , }, +}; + +static struct clk_regmap t7_vid_pll_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VID_PLL_CLK0_DIV , + .mask =0x1 , + .shift =18 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="vid_pll_sel" , + .ops = &clk_regmap_mux_ops, +/* +* bit 18 selects from 2 possible parents: +* vid_pll_div or hdmi_pll +*/ + .parent_data = t7_vid_pll_parent_data, + .num_parents =ARRAY_SIZE (t7_vid_pll_parent_data), + .flags =CLK_SET_RATE_NO_REPARENT |CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_vid_pll = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_PLL_CLK0_DIV , + .bit_idx =19 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vid_pll" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vid_pll_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static const struct clk_parent_data t7_vclk_parent_data[] = { + { .hw = &t7_vid_pll.hw }, + { .fw_name ="gp0_pll" , }, + { .fw_name ="hifi_pll" , }, + { .fw_name ="mpll1" , }, + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div4" , }, + { .fw_name ="fclk_div5" , }, + { .fw_name ="fclk_div7" }, +}; + +static struct clk_regmap t7_vclk_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VID_CLK0_CTRL , + .mask =0x7 , + .shift =16 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="vclk_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_vclk_parent_data, + .num_parents =ARRAY_SIZE (t7_vclk_parent_data), + .flags =CLK_SET_RATE_NO_REPARENT |CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_vclk2_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VIID_CLK0_CTRL , + .mask =0x7 , + .shift =16 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="vclk2_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_vclk_parent_data, + .num_parents =ARRAY_SIZE (t7_vclk_parent_data), + .flags =CLK_SET_RATE_NO_REPARENT |CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_vclk_input = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK0_DIV , + .bit_idx =16 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk_input" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk2_input = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VIID_CLK0_DIV , + .bit_idx =16 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk2_input" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk2_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VID_CLK0_DIV , + .shift =0 , + .width =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="vclk_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vclk_input.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_vclk2_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VIID_CLK0_DIV , + .shift =0 , + .width =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="vclk2_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vclk2_input.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_vclk = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK0_CTRL , + .bit_idx =19 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk_div.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk2 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VIID_CLK0_CTRL , + .bit_idx =19 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk2" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk2_div.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk_div1 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK0_CTRL , + .bit_idx =0 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk_div1" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk_div2_en = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK0_CTRL , + .bit_idx =1 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk_div2_en" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk_div4_en = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK0_CTRL , + .bit_idx =2 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk_div4_en" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk_div6_en = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK0_CTRL , + .bit_idx =3 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk_div6_en" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk_div12_en = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK0_CTRL , + .bit_idx =4 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk_div12_en" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk2_div1 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VIID_CLK0_CTRL , + .bit_idx =0 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk2_div1" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk2.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk2_div2_en = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VIID_CLK0_CTRL , + .bit_idx =1 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk2_div2_en" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk2.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk2_div4_en = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VIID_CLK0_CTRL , + .bit_idx =2 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk2_div4_en" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk2.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk2_div6_en = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VIID_CLK0_CTRL , + .bit_idx =3 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk2_div6_en" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk2.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_vclk2_div12_en = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VIID_CLK0_CTRL , + .bit_idx =4 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vclk2_div12_en" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vclk2.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_fixed_factor t7_vclk_div2 = { + .mult =1 , + .div =2 , + .hw.init = &(struct clk_init_data ){ + .name ="vclk_div2" , + .ops = &clk_fixed_factor_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vclk_div2_en.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_fixed_factor t7_vclk_div4 = { + .mult =1 , + .div =4 , + .hw.init = &(struct clk_init_data ){ + .name ="vclk_div4" , + .ops = &clk_fixed_factor_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vclk_div4_en.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_fixed_factor t7_vclk_div6 = { + .mult =1 , + .div =6 , + .hw.init = &(struct clk_init_data ){ + .name ="vclk_div6" , + .ops = &clk_fixed_factor_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vclk_div6_en.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_fixed_factor t7_vclk_div12 = { + .mult =1 , + .div =12 , + .hw.init = &(struct clk_init_data ){ + .name ="vclk_div12" , + .ops = &clk_fixed_factor_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vclk_div12_en.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_fixed_factor t7_vclk2_div2 = { + .mult =1 , + .div =2 , + .hw.init = &(struct clk_init_data ){ + .name ="vclk2_div2" , + .ops = &clk_fixed_factor_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vclk2_div2_en.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_fixed_factor t7_vclk2_div4 = { + .mult =1 , + .div =4 , + .hw.init = &(struct clk_init_data ){ + .name ="vclk2_div4" , + .ops = &clk_fixed_factor_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vclk2_div4_en.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_fixed_factor t7_vclk2_div6 = { + .mult =1 , + .div =6 , + .hw.init = &(struct clk_init_data ){ + .name ="vclk2_div6" , + .ops = &clk_fixed_factor_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vclk2_div6_en.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_fixed_factor t7_vclk2_div12 = { + .mult =1 , + .div =12 , + .hw.init = &(struct clk_init_data ){ + .name ="vclk2_div12" , + .ops = &clk_fixed_factor_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vclk2_div12_en.hw + }, + .num_parents =1 , + }, +}; + +static u32 mux_table_cts_sel[] = {0 ,1 ,2 ,3 ,4 ,8 ,9 ,10 ,11 ,12 }; +static const struct clk_hw *t7_cts_parent_hws[] = { + &t7_vclk_div1.hw, + &t7_vclk_div2.hw, + &t7_vclk_div4.hw, + &t7_vclk_div6.hw, + &t7_vclk_div12.hw, + &t7_vclk2_div1.hw, + &t7_vclk2_div2.hw, + &t7_vclk2_div4.hw, + &t7_vclk2_div6.hw, + &t7_vclk2_div12.hw +}; + +static struct clk_regmap t7_cts_enci_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VID_CLK0_DIV , + .mask =0xf , + .shift =28 , + .table = mux_table_cts_sel, + }, + .hw.init = &(struct clk_init_data ){ + .name ="cts_enci_sel" , + .ops = &clk_regmap_mux_ops, + .parent_hws = t7_cts_parent_hws, + .num_parents =ARRAY_SIZE (t7_cts_parent_hws), + .flags =CLK_SET_RATE_NO_REPARENT |CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_cts_encp_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VID_CLK1_DIV , + .mask =0xf , + .shift =20 , + .table = mux_table_cts_sel, + }, + .hw.init = &(struct clk_init_data ){ + .name ="cts_encp_sel" , + .ops = &clk_regmap_mux_ops, + .parent_hws = t7_cts_parent_hws, + .num_parents =ARRAY_SIZE (t7_cts_parent_hws), + .flags =CLK_SET_RATE_NO_REPARENT |CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_cts_vdac_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VIID_CLK1_DIV , + .mask =0xf , + .shift =28 , + .table = mux_table_cts_sel, + }, + .hw.init = &(struct clk_init_data ){ + .name ="cts_vdac_sel" , + .ops = &clk_regmap_mux_ops, + .parent_hws = t7_cts_parent_hws, + .num_parents =ARRAY_SIZE (t7_cts_parent_hws), + .flags =CLK_SET_RATE_NO_REPARENT |CLK_GET_RATE_NOCACHE , + }, +}; + +/* TOFIX: add support for cts_tcon */ +static u32 mux_table_hdmi_tx_sel[] = {0 ,1 ,2 ,3 ,4 ,8 ,9 ,10 ,11 ,12 }; +static const struct clk_hw *t7_cts_hdmi_tx_parent_hws[] = { + &t7_vclk_div1.hw, + &t7_vclk_div2.hw, + &t7_vclk_div4.hw, + &t7_vclk_div6.hw, + &t7_vclk_div12.hw, + &t7_vclk2_div1.hw, + &t7_vclk2_div2.hw, + &t7_vclk2_div4.hw, + &t7_vclk2_div6.hw, + &t7_vclk2_div12.hw +}; + +static struct clk_regmap t7_hdmi_tx_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HDMI_CLK_CTRL , + .mask =0xf , + .shift =16 , + .table = mux_table_hdmi_tx_sel, + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmi_tx_sel" , + .ops = &clk_regmap_mux_ops, + .parent_hws = t7_cts_hdmi_tx_parent_hws, + .num_parents =ARRAY_SIZE (t7_cts_hdmi_tx_parent_hws), + .flags =CLK_SET_RATE_NO_REPARENT |CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_cts_enci = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK2_CTRL2 , + .bit_idx =0 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="cts_enci" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_cts_enci_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_cts_encp = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK2_CTRL2 , + .bit_idx =2 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="cts_encp" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_cts_encp_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_cts_vdac = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK2_CTRL2 , + .bit_idx =4 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="cts_vdac" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_cts_vdac_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static struct clk_regmap t7_hdmi_tx = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_CLK2_CTRL2 , + .bit_idx =5 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmi_tx" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hdmi_tx_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED , + }, +}; + +static const struct clk_parent_data t7_hdmitx_sys_parent_data[] = { + { .fw_name ="xtal" , }, + { .fw_name ="fclk_div4" , }, + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div5" , } +}; + +static struct clk_regmap t7_hdmitx_sys_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HDMI_CLK_CTRL , + .mask =0x3 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmitx_sys_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmitx_sys_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HDMI_CLK_CTRL , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmitx_sys_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmitx_sys_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmitx_sys = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HDMI_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmitx_sys" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmitx_sys.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmitx_prif_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HTX_CLK_CTRL0 , + .mask =0x3 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmitx_prif_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmitx_prif_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HTX_CLK_CTRL0 , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmitx_prif_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmitx_prif_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmitx_prif = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HTX_CLK_CTRL0 , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmitx_prif" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmitx_prif.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmitx_200m_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HTX_CLK_CTRL0 , + .mask =0x3 , + .shift =25 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmitx_200m_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmitx_200m_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HTX_CLK_CTRL0 , + .shift =16 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmitx_200m_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmitx_200m_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmitx_200m = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HTX_CLK_CTRL0 , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmitx_200m" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmitx_200m.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmitx_aud_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HTX_CLK_CTRL1 , + .mask =0x3 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmitx_aud_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmitx_aud_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HTX_CLK_CTRL1 , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmitx_aud_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmitx_aud_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmitx_aud = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HTX_CLK_CTRL1 , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmitx_aud" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmitx_aud_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_5m_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL0 , + .mask =0x3 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_5m_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmirx_5m_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL0 , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_5m_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_5m_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_5m = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL0 , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmirx_5m" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_5m_div.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_2m_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL0 , + .mask =0x3 , + .shift =25 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_2m_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmirx_2m_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL0 , + .shift =16 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_2m_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_2m_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_2m = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL0 , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmirx_2m" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_2m_div.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_cfg_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL1 , + .mask =0x3 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_cfg_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmirx_cfg_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL1 , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_cfg_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_cfg_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_cfg = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL1 , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmirx_cfg" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_cfg_div.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_hdcp_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL1 , + .mask =0x3 , + .shift =25 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_hdcp_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmirx_hdcp_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL1 , + .shift =16 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_hdcp_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_hdcp_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_hdcp = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL1 , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmirx_hdcp" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_hdcp_div.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_aud_pll_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL2 , + .mask =0x3 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_aud_pll_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmirx_aud_pll_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL2 , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_aud_pll_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_aud_pll_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_aud_pll = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL2 , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmirx_aud_pll" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_aud_pll_div.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_acr_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL2 , + .mask =0x3 , + .shift =25 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_acr_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmirx_acr_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL2 , + .shift =16 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_acr_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_acr_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_acr = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL2 , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmirx_acr" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_acr_div.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_meter_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL3 , + .mask =0x3 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_meter_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_hdmitx_sys_parent_data, + .num_parents =ARRAY_SIZE (t7_hdmitx_sys_parent_data), + }, +}; + +static struct clk_regmap t7_hdmirx_meter_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL3 , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hdmirx_meter_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_meter_sel.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_hdmirx_meter = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_HRX_CLK_CTRL3 , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hdmirx_meter" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_hdmirx_meter_div.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_vid_lock_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VID_LOCK_CLK_CTRL , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="vid_lock_div" , + .ops = &clk_regmap_divider_ops, + .parent_data = &(const struct clk_parent_data ) { + .fw_name ="xtal" , + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_vid_lock_clk = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VID_LOCK_CLK_CTRL , + .bit_idx =7 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vid_lock_clk" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &t7_vid_lock_div.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +static struct clk_regmap t7_ts_clk_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_TS_CLK_CTRL , + .shift =0 , + .width =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="ts_clk_div" , + .ops = &clk_regmap_divider_ops, + .parent_data = &(const struct clk_parent_data ) { + .fw_name ="xtal" , + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap t7_ts_clk_gate = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_TS_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="ts_clk_gate" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_ts_clk_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT + }, +}; + +/*mali_clk*/ +/* +* The MALI IP is clocked by two identical clocks (mali_0 and mali_1) +* muxed by a glitch-free switch on Meson8b and Meson8m2 and later. +* +* CLK_SET_RATE_PARENT is added for mali_0_sel clock +* 1.gp0 pll only support the 846M, avoid other rate 500/400M from it +* 2.hifi pll is used for other module, skip it, avoid some rate from it +*/ +static u32 mux_table_mali[] = {0 ,3 ,4 ,5 ,6 }; + +static const struct clk_parent_data t7_mali_0_1_parent_data[] = { + { .fw_name ="xtal" , }, + { .fw_name ="fclk_div2p5" , }, + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div4" , }, + { .fw_name ="fclk_div5" , }, +}; + +static struct clk_regmap t7_mali_0_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_MALI_CLK_CTRL , + .mask =0x7 , + .shift =9 , + .table = mux_table_mali, + }, + .hw.init = &(struct clk_init_data ){ + .name ="mali_0_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_mali_0_1_parent_data, + .num_parents =ARRAY_SIZE (t7_mali_0_1_parent_data), + .flags =CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_mali_0_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_MALI_CLK_CTRL , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mali_0_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mali_0_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_mali_0 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_MALI_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mali_0" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mali_0_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_GATE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_mali_1_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_MALI_CLK_CTRL , + .mask =0x7 , + .shift =25 , + .table = mux_table_mali, + }, + .hw.init = &(struct clk_init_data ){ + .name ="mali_1_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_mali_0_1_parent_data, + .num_parents =ARRAY_SIZE (t7_mali_0_1_parent_data), + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_mali_1_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_MALI_CLK_CTRL , + .shift =16 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mali_1_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mali_1_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_mali_1 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_MALI_CLK_CTRL , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mali_1" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mali_1_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_GATE |CLK_SET_RATE_PARENT , + }, +}; + +static const struct clk_hw *t7_mali_parent_hws[] = { + &t7_mali_0.hw, + &t7_mali_1.hw +}; + +static struct clk_regmap t7_mali_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_MALI_CLK_CTRL , + .mask =1 , + .shift =31 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mali" , + .ops = &clk_regmap_mux_ops, + .parent_hws = t7_mali_parent_hws, + .num_parents =2 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +/* cts_vdec_clk */ +static const struct clk_parent_data t7_dec_parent_hws[] = { + { .fw_name ="fclk_div2p5" , }, + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div4" , }, + { .fw_name ="fclk_div5" , }, + { .fw_name ="fclk_div7" , }, + { .fw_name ="hifi_pll" , }, + { .fw_name ="gp0_pll" , }, + { .fw_name ="xtal" , } +}; + +static struct clk_regmap t7_vdec_p0_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC_CLK_CTRL , + .mask =0x7 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vdec_p0_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_dec_parent_hws, + .num_parents =ARRAY_SIZE (t7_dec_parent_hws), + .flags =CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_vdec_p0_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VDEC_CLK_CTRL , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vdec_p0_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vdec_p0_mux.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_vdec_p0 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VDEC_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="vdec_p0" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vdec_p0_div.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_vdec_p1_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC3_CLK_CTRL , + .mask =0x7 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vdec_p1_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_dec_parent_hws, + .num_parents =ARRAY_SIZE (t7_dec_parent_hws), + .flags =CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_vdec_p1_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VDEC3_CLK_CTRL , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vdec_p1_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vdec_p1_mux.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_vdec_p1 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VDEC3_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="vdec_p1" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vdec_p1_div.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_vdec_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC3_CLK_CTRL , + .mask =0x1 , + .shift =15 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="vdec_mux" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_vdec_p0.hw, + &t7_vdec_p1.hw + }, + .num_parents =2 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hcodec_p0_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC_CLK_CTRL , + .mask =0x7 , + .shift =25 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hcodec_p0_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_dec_parent_hws, + .num_parents =ARRAY_SIZE (t7_dec_parent_hws), + .flags =CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_hcodec_p0_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VDEC_CLK_CTRL , + .shift =16 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hcodec_p0_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hcodec_p0_mux.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hcodec_p0 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VDEC_CLK_CTRL , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hcodec_p0" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hcodec_p0_div.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hcodec_p1_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC3_CLK_CTRL , + .mask =0x7 , + .shift =25 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hcodec_p1_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_dec_parent_hws, + .num_parents =ARRAY_SIZE (t7_dec_parent_hws), + .flags =CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_hcodec_p1_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VDEC3_CLK_CTRL , + .shift =16 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hcodec_p1_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hcodec_p1_mux.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hcodec_p1 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VDEC3_CLK_CTRL , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hcodec_p1" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hcodec_p1_div.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hcodec_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC3_CLK_CTRL , + .mask =0x1 , + .shift =31 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hcodec_mux" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hcodec_p0.hw, + &t7_hcodec_p1.hw + }, + .num_parents =2 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static u32 mux_table_vdec[] = {0 ,1 ,2 ,3 ,4 }; + +static const struct clk_parent_data t7_vdec_parent_data[] = { + { .fw_name ="fclk_div2p5" , }, + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div4" , }, + { .fw_name ="fclk_div5" , }, + { .fw_name ="fclk_div7" , }, +}; + +static struct clk_regmap t7_hevcb_p0_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC2_CLK_CTRL , + .mask =0x7 , + .shift =25 , + .flags =CLK_MUX_ROUND_CLOSEST , + .table = mux_table_vdec, + }, + .hw.init = &(struct clk_init_data ){ + .name ="hevcb_p0_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_vdec_parent_data, + .num_parents =ARRAY_SIZE (t7_vdec_parent_data), + }, +}; + +static struct clk_regmap t7_hevcb_p0_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VDEC2_CLK_CTRL , + .shift =16 , + .width =7 , + .flags =CLK_DIVIDER_ROUND_CLOSEST , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hevcb_p0_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hevcb_p0_mux.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hevcb_p0 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VDEC2_CLK_CTRL , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hevcb_p0_gate" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hevcb_p0_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hevcb_p1_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC4_CLK_CTRL , + .mask =0x7 , + .shift =25 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hevcb_p1_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_vdec_parent_data, + .num_parents =ARRAY_SIZE (t7_vdec_parent_data), + }, +}; + +static struct clk_regmap t7_hevcb_p1_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VDEC4_CLK_CTRL , + .shift =16 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hevc_p1_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hevcb_p1_mux.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hevcb_p1 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VDEC4_CLK_CTRL , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hevcb_p1_gate" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hevcb_p1_div.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hevcb_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC4_CLK_CTRL , + .mask =0x1 , + .shift =31 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hevcb_mux" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hevcb_p0.hw, + &t7_hevcb_p1.hw + }, + .num_parents =2 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hevcf_p0_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC2_CLK_CTRL , + .mask =0x7 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hevcf_p0_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_dec_parent_hws, + .num_parents =ARRAY_SIZE (t7_dec_parent_hws), + .flags =CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_hevcf_p0_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VDEC2_CLK_CTRL , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hevcf_p0_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hevcf_p0_mux.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hevcf_p0 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VDEC2_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hevcf_p0_gate" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hevcf_p0_div.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hevcf_p1_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC4_CLK_CTRL , + .mask =0x7 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hevcf_p1_mux" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_dec_parent_hws, + .num_parents =ARRAY_SIZE (t7_dec_parent_hws), + .flags =CLK_GET_RATE_NOCACHE , + }, +}; + +static struct clk_regmap t7_hevcf_p1_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_VDEC4_CLK_CTRL , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hevcf_p1_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hevcf_p1_mux.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hevcf_p1 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_VDEC4_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="hevcf_p1" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hevcf_p1_div.hw + }, + .num_parents =1 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_hevcf_mux = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_VDEC4_CLK_CTRL , + .mask =0x1 , + .shift =15 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="hevcf_mux" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_hevcf_p0.hw, + &t7_hevcf_p1.hw + }, + .num_parents =2 , + .flags =CLK_GET_RATE_NOCACHE |CLK_SET_RATE_PARENT , + }, +}; + +/*cts_wave420l_a/b/c_clk*/ +static const struct clk_parent_data t7_wave_parent_data[] = { + { .fw_name ="xtal" , }, + { .fw_name ="fclk_div4" , }, + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div5" , }, + { .fw_name ="fclk_div7" , }, + { .fw_name ="mpll2" , }, + { .fw_name ="mpll3" , }, + { .fw_name ="gp1_pll" , } +}; + +static struct clk_regmap t7_wave_a_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_WAVE521_CLK_CTRL2 , + .mask =0x7 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="wave_a_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_wave_parent_data, + .num_parents =ARRAY_SIZE (t7_wave_parent_data), + }, +}; + +static struct clk_regmap t7_wave_a_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_WAVE521_CLK_CTRL2 , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="wave_a_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_wave_a_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_wave_aclk = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_WAVE521_CLK_CTRL2 , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="wave_aclk" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_wave_a_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_wave_b_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_WAVE521_CLK_CTRL , + .mask =0x7 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="wave_b_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_wave_parent_data, + .num_parents =ARRAY_SIZE (t7_wave_parent_data), + }, +}; + +static struct clk_regmap t7_wave_b_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_WAVE521_CLK_CTRL , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="wave_b_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_wave_b_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_wave_bclk = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_WAVE521_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="wave_bclk" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_wave_b_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_wave_c_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_WAVE521_CLK_CTRL , + .mask =0x7 , + .shift =25 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="wave_c_sel" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_wave_parent_data, + .num_parents =ARRAY_SIZE (t7_wave_parent_data), + }, +}; + +static struct clk_regmap t7_wave_c_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_WAVE521_CLK_CTRL , + .shift =16 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="wave_c_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_wave_c_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_wave_cclk = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_WAVE521_CLK_CTRL , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="wave_cclk" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_wave_c_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_mipi_isp_sel = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_MIPI_ISP_CLK_CTRL , + .mask =0x7 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mipi_isp_sel" , + .ops = &clk_regmap_mux_ops, +/* Share parent with wave clk */ + .parent_data = t7_wave_parent_data, + .num_parents =ARRAY_SIZE (t7_wave_parent_data), + }, +}; + +static struct clk_regmap t7_mipi_isp_div = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_MIPI_ISP_CLK_CTRL , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mipi_isp_div" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mipi_isp_sel.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_mipi_isp = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_MIPI_ISP_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="mipi_isp" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mipi_isp_div.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static const struct clk_parent_data t7_mipi_csi_parent_data[] = { + { .fw_name ="xtal" , }, + { .fw_name ="hifi_pll" , }, + { .fw_name ="mpll1" , }, + { .fw_name ="mpll2" , }, + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div4" , }, + { .fw_name ="fclk_div5" , }, + { .fw_name ="fclk_div7" , } +}; + +static struct clk_regmap t7_mipi_csi_phy_sel0 = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_MIPI_CSI_PHY_CLK_CTRL , + .mask =0x7 , + .shift =9 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mipi_csi_phy_sel0" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_mipi_csi_parent_data, + .num_parents =ARRAY_SIZE (t7_mipi_csi_parent_data), + }, +}; + +static struct clk_regmap t7_mipi_csi_phy_div0 = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_MIPI_CSI_PHY_CLK_CTRL , + .shift =0 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mipi_csi_phy_div0" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mipi_csi_phy_sel0.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_mipi_csi_phy0 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_MIPI_CSI_PHY_CLK_CTRL , + .bit_idx =8 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="mipi_csi_phy0" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mipi_csi_phy_div0.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_mipi_csi_phy_sel1 = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_MIPI_CSI_PHY_CLK_CTRL , + .mask =0x7 , + .shift =25 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mipi_csi_phy_sel1" , + .ops = &clk_regmap_mux_ops, + .parent_data = t7_mipi_csi_parent_data, + .num_parents =ARRAY_SIZE (t7_mipi_csi_parent_data), + }, +}; + +static struct clk_regmap t7_mipi_csi_phy_div1 = { + .data = &(struct clk_regmap_div_data ){ + .offset =CLKCTRL_MIPI_CSI_PHY_CLK_CTRL , + .shift =16 , + .width =7 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mipi_csi_phy_div1" , + .ops = &clk_regmap_divider_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mipi_csi_phy_sel1.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_mipi_csi_phy1 = { + .data = &(struct clk_regmap_gate_data ){ + .offset =CLKCTRL_MIPI_CSI_PHY_CLK_CTRL , + .bit_idx =24 , + }, + .hw.init = &(struct clk_init_data ) { + .name ="mipi_csi_phy1" , + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mipi_csi_phy_div1.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static struct clk_regmap t7_mipi_csi_phy_clk = { + .data = &(struct clk_regmap_mux_data ){ + .offset =CLKCTRL_MIPI_CSI_PHY_CLK_CTRL , + .mask =0x1 , + .shift =31 , + }, + .hw.init = &(struct clk_init_data ){ + .name ="mipi_csi_phy_clk" , + .ops = &clk_regmap_mux_ops, + .parent_hws = (const struct clk_hw *[]) { + &t7_mipi_csi_phy0.hw, + &t7_mipi_csi_phy1.hw + }, + .num_parents =2 , + .flags =CLK_SET_RATE_PARENT , + }, +}; + +static const struct clk_parent_data t7_vpu_parent_data[] = { + { .fw_name ="fclk_div3" , }, + { .fw_name ="fclk_div4" , },Lines of this file are not shown. View the raw message.
drivers/clk/meson/t7-peripherals.h new file +131
-0Lines of this file are not shown. View the raw message.
include/dt-bindings/clock/amlogic,t7-peripherals-clkc.h new file +410
-0Lines of this file are not shown. View the raw message.
include/dt-bindings/clock/amlogic,t7-pll-clkc.h new file +64
-0Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Quoted 8 lines
Quoted 8 lines
include/dt-bindings/clock/amlogic,t7-pll-clkc.h new file +5
-1Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
2.44.0
Hi,
I have been trying to port the MMC driver to the mainline, but this kernel panic is occurring frequently.
It doesn't seem to be from my driver. Can anybody help?
0.355428] meson-gx-mmc fe08a000.sd: host probe success! [ 0.355850] clk: Disabling unused clocks [ 0.356032] PM: genpd: Disabling unused power domains [ 0.356554] ALSA device list: [ 0.356894] No soundcards found. [ 0.359563] SError Interrupt on CPU1, code 0x00000000bf000002 -- SError [ 0.359575] CPU: 1 PID: 76 Comm: kworker/1:1 Not tainted 6.8.0-09794-g261238a64e1f-dirty #38 [ 0.359585] Hardware name: Khadas vim4 (DT) [ 0.359590] Workqueue: events_freezable mmc_rescan [ 0.359611] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.359620] pc : meson_mmc_request+0x1d0/0x624 [ 0.359630] lr : __mmc_start_request+0x68/0x13c [ 0.359641] sp : ffff800082ff3b70 [ 0.359644] x29: ffff800082ff3b70 x28: 0000000000000000 x27: ffff800082327000 [ 0.359655] x26: ffff0001011d3040 x25: 0000000000000000 x24: ffff000100030405 [ 0.359666] x23: ffff800082ff3d20 x22: ffff0001031b8000 x21: 000000008840a800 [ 0.359677] x20: 0000000000000000 x19: ffff0001031b8580 x18: 0000000000000020 [ 0.359688] x17: 0000000000000080 x16: fffffdffc378e008 x15: 0000000000000000 [ 0.359698] x14: ffff0001003ca280 x13: 0000000000000000 x12: ffff800082329dc8 [ 0.359709] x11: ffff000100cc3500 x10: 0000000000000a70 x9 : ffff800082ff3b70 [ 0.359719] x8 : ffff0001003cacd0 x7 : ffff00021ef51d40 x6 : ffff80019d3c6000 [ 0.359730] x5 : 0000000000000008 x4 : 0000000000500000 x3 : 0000000088400000 [ 0.359741] x2 : 0000000000000008 x1 : ffff80008287d000 x0 : ffff80008287d000 [ 0.359753] Kernel panic - not syncing: Asynchronous SError Interrupt [ 0.359757] CPU: 1 PID: 76 Comm: kworker/1:1 Not tainted 6.8.0-09794-g261238a64e1f-dirty #38 [ 0.359765] Hardware name: Khadas vim4 (DT) [ 0.359769] Workqueue: events_freezable mmc_rescan [ 0.359780] Call trace: [ 0.359784] dump_backtrace+0x94/0xec [ 0.359798] show_stack+0x18/0x24 [ 0.359809] dump_stack_lvl+0x38/0x90 [ 0.359818] dump_stack+0x18/0x24 [ 0.359824] panic+0x388/0x3c8 [ 0.359834] nmi_panic+0x48/0x94 [ 0.359846] arm64_serror_panic+0x6c/0x78 [ 0.359853] do_serror+0x3c/0x78 [ 0.359860] el1h_64_error_handler+0x30/0x48 [ 0.359870] el1h_64_error+0x64/0x68 [ 0.359878] meson_mmc_request+0x1d0/0x624 [ 0.359886] __mmc_start_request+0x68/0x13c [ 0.359897] mmc_start_request+0x84/0xac [ 0.359906] mmc_wait_for_req+0x70/0x100 [ 0.359916] mmc_wait_for_cmd+0x64/0x9c [ 0.359925] mmc_send_if_cond_pcie+0x88/0x120 [ 0.359936] mmc_rescan+0x22c/0x31c [ 0.359946] process_one_work+0x150/0x294 [ 0.359957] worker_thread+0x304/0x408 [ 0.359968] kthread+0x118/0x11c [ 0.359977] ret_from_fork+0x10/0x20 [ 0.359987] SMP: stopping secondary CPUs [ 0.360066] Kernel Offset: disabled [ 0.360068] CPU features: 0x0,00000060,d0080000,0200421b [ 0.360074] Memory Limit: none [ 0.388534] ---[ end Kernel panic - not syncing: Asynchronous
SError Interrupt ]---
Part of the diff is not shown here. View the raw message.
Hi Lucas,
As we are preparing the T7 clock patchset, we would like to your
purpose and plan of this RFC patches. Are you going to submit these patches at last?
Quoted 371 lines · Lucas Tanure
[ EXTERNAL EMAIL ]
I am trying to port the T7 clock driver from Khadas 5.4 kernel for Vim4 to mainline, but I am encountering some issues in the path.
The kernel panics at
clk_mux_val_to_index, but I believe that all the needed clocks are registered.If anyone from Amlogic or the community could help me understand what my driver is missing, that would be great.
I will continue to try to figure out, but it has been some weeks without progress =/.Lucas Tanure (2):
clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
arm64: dts: amlogic: t7: SDCard, Ethernet and Clocking.../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 66 + arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 189 + drivers/clk/meson/Kconfig | 25 + drivers/clk/meson/Makefile | 2 + drivers/clk/meson/t7-peripherals.c | 6368 +++++++++++++++++ drivers/clk/meson/t7-peripherals.h | 131 + drivers/clk/meson/t7-pll.c | 1543 ++++ drivers/clk/meson/t7-pll.h | 83 + .../clock/amlogic,t7-peripherals-clkc.h | 410 ++ .../dt-bindings/clock/amlogic,t7-pll-clkc.h | 69 + 10 files changed, 8886 insertions(+)create mode 100644
drivers/clk/meson/t7-peripherals.c
create mode 100644drivers/clk/meson/t7-peripherals.h
create mode 100644drivers/clk/meson/t7-pll.c
create mode 100644drivers/clk/meson/t7-pll.h
create mode 100644include/dt-bindings/clock/amlogic,t7-peripherals-clkc.hcreate mode 100644include/dt-bindings/clock/amlogic,t7-pll-clkc.hStarting kernel ...
uboot time: 14277917 us
boot 64bit kernel[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd092] [ 0.000000] Linux version 6.8.0-09793-gda876e5b54b3-dirty (tanureal@ryzen) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621, GNU ld (GNU Toolchain for the A-pr4 [ 0.000000] KASLR disabled due to lack of seed [ 0.000000] Machine model: Khadas vim4 [ 0.000000] efi: UEFI not found. [ 0.000000] OF: reserved mem: 0x0000000005000000..0x00000000052fffff (3072 KiB) nomap non-reusable secmon@5000000 [ 0.000000] OF: reserved mem: 0x0000000005300000..0x00000000072fffff (32768 KiB) nomap non-reusable secmon@5300000 [ 0.000000] NUMA: No NUMA configuration found [ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] NUMA: NODE_DATA [mem 0xdf10c9c0-0xdf10efff] [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000004ffffff] [ 0.000000] node 0: [mem 0x0000000005000000-0x00000000072fffff] [ 0.000000] node 0: [mem 0x0000000007300000-0x00000000df7fffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] On node 0, zone DMA: 2048 pages in unavailable ranges [ 0.000000] cma: Reserved 32 MiB at 0x00000000d9800000 on node -1 [ 0.000000] psci: probing for conduit method from DT. [ 0.000000] psci: PSCIv1.0 detected in firmware. [ 0.000000] psci: Using standard PSCI v0.2 function IDs [ 0.000000] psci: Trusted OS migration not required [ 0.000000] psci: SMC Calling Convention v1.1 [ 0.000000] percpu: Embedded 24 pages/cpu s58152 r8192 d31960 u98304 [ 0.000000] Detected VIPT I-cache on CPU0 [ 0.000000] CPU features: detected: Spectre-v2 [ 0.000000] CPU features: detected: Spectre-v4 [ 0.000000] CPU features: detected: Spectre-BHB [ 0.000000] CPU features: detected: ARM erratum 858921 [ 0.000000] alternatives: applying boot alternatives [ 0.000000] Kernel command line: root=UUID=a91e7bfe-4263-4e53-867d-7824e7c6a992 rw rootfstype=ext4 console=ttyS0,921600 no_console_suspend earlycon=ttyS0,0xfe078000 khadas_board=VIM4 androidboot.selinux=permissive androidboot.0 [ 0.000000] Unknown kernel command line parameters "khadas_board=VIM4", will be passed to user space. [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear) [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Fallback order for Node 0: 0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 901152 [ 0.000000] Policy zone: DMA [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] software IO TLB: SWIOTLB bounce buffer size adjusted to 3MB [ 0.000000] software IO TLB: area num 8. [ 0.000000] software IO TLB: SWIOTLB bounce buffer size roundup to 4MB [ 0.000000] software IO TLB: mapped [mem 0x00000000d8e00000-0x00000000d9200000] (4MB) [ 0.000000] Memory: 3445944K/3661824K available (16896K kernel code, 4426K rwdata, 9184K rodata, 9728K init, 611K bss, 183112K reserved, 32768K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=8. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] Tracing variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8 [ 0.000000] RCU Tasks: Setting shift to 3 and lim to 1 rcu_task_cb_adjust=1. [ 0.000000] RCU Tasks Trace: Setting shift to 3 and lim to 1 rcu_task_cb_adjust=1. [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set [ 0.000000] Root IRQ handler: gic_handle_irq [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. [ 0.000000] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.000000] arch_timer: CPU0: Trapping CNTVCT access [ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns [ 0.000000] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns [ 0.000210] Console: colour dummy device 80x25 [ 0.000253] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000) [ 0.000261] pid_max: default: 32768 minimum: 301 [ 0.000300] LSM: initializing lsm=capability [ 0.000358] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000371] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000920] cacheinfo: Unable to detect cache hierarchy for CPU 0 [ 0.001389] rcu: Hierarchical SRCU implementation. [ 0.001391] rcu: Max phase no-delay instances is 1000. [ 0.001834] EFI services will not be available. [ 0.001999] smp: Bringing up secondary CPUs ... [ 0.002408] CPU features: detected: ARM erratum 845719 [ 0.002426] Detected VIPT I-cache on CPU1 [ 0.002516] CPU1: Booted secondary processor 0x0000000100 [0x410fd034] [ 0.003007] Detected VIPT I-cache on CPU2 [ 0.003054] CPU2: Booted secondary processor 0x0000000101 [0x410fd034] [ 0.003497] Detected VIPT I-cache on CPU3 [ 0.003546] CPU3: Booted secondary processor 0x0000000102 [0x410fd034] [ 0.003988] Detected VIPT I-cache on CPU4 [ 0.004038] CPU4: Booted secondary processor 0x0000000103 [0x410fd034] [ 0.004472] Detected VIPT I-cache on CPU5 [ 0.004509] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.004519] arch_timer: CPU5: Trapping CNTVCT access [ 0.004527] CPU5: Booted secondary processor 0x0000000001 [0x410fd092] [ 0.004915] Detected VIPT I-cache on CPU6 [ 0.004940] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.004946] arch_timer: CPU6: Trapping CNTVCT access [ 0.004951] CPU6: Booted secondary processor 0x0000000002 [0x410fd092] [ 0.005333] Detected VIPT I-cache on CPU7 [ 0.005358] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.005364] arch_timer: CPU7: Trapping CNTVCT access [ 0.005369] CPU7: Booted secondary processor 0x0000000003 [0x410fd092] [ 0.005414] smp: Brought up 1 node, 8 CPUs [ 0.005419] SMP: Total of 8 processors activated. [ 0.005421] CPU: All CPU(s) started at EL2 [ 0.005434] CPU features: detected: 32-bit EL0 Support [ 0.005437] CPU features: detected: 32-bit EL1 Support [ 0.005440] CPU features: detected: CRC32 instructions [ 0.005485] alternatives: applying system-wide alternatives [ 0.006730] devtmpfs: initialized [ 0.008534] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.008545] futex hash table entries: 2048 (order: 5, 131072 bytes, linear) [ 0.008989] pinctrl core: initialized pinctrl subsystem [ 0.009581] DMI not present or invalid. [ 0.011290] NET: Registered PF_NETLINK/PF_ROUTE protocol family [ 0.011944] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations [ 0.012293] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.012711] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.012832] audit: initializing netlink subsys (disabled) [ 0.013075] audit: type=2000 audit(0.012:1): state=initialized audit_enabled=0 res=1 [ 0.013508] thermal_sys: Registered thermal governor 'step_wise' [ 0.013512] thermal_sys: Registered thermal governor 'power_allocator' [ 0.013557] cpuidle: using governor menu [ 0.013675] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. [ 0.013784] ASID allocator initialised with 65536 entries [ 0.014630] Serial: AMBA PL011 UART driver [ 0.017553] Modules: 22496 pages in range for non-PLT usage [ 0.017556] Modules: 514016 pages in range for PLT usage [ 0.017980] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages [ 0.017984] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page [ 0.017988] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages [ 0.017990] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page [ 0.017993] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages [ 0.017995] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page [ 0.017997] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages [ 0.018000] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page [ 0.018247] Demotion targets for Node 0: null [ 0.018884] ACPI: Interpreter disabled. [ 0.019584] iommu: Default domain type: Translated [ 0.019587] iommu: DMA domain TLB invalidation policy: strict mode [ 0.019979] SCSI subsystem initialized [ 0.020174] usbcore: registered new interface driver usbfs [ 0.020187] usbcore: registered new interface driver hub [ 0.020200] usbcore: registered new device driver usb [ 0.020434] pps_core: LinuxPPS API ver. 1 registered [ 0.020437] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]> [ 0.020443] PTP clock support registered [ 0.020487] EDAC MC: Ver: 3.0.0 [ 0.020717] scmi_core: SCMI protocol bus registered [ 0.021039] FPGA manager framework [ 0.021076] Advanced Linux Sound Architecture Driver Initialized. [ 0.021612] vgaarb: loaded [ 0.021857] clocksource: Switched to clocksource arch_sys_counter [ 0.021967] VFS: Disk quotas dquot_6.6.0 [ 0.021984] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) [ 0.022062] pnp: PnP ACPI: disabled [ 0.026651] NET: Registered PF_INET protocol family [ 0.026781] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear) [ 0.028598] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear) [ 0.028615] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) [ 0.028622] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 0.028750] TCP bind hash table entries: 32768 (order: 8, 1048576 bytes, linear) [ 0.029019] TCP: Hash tables configured (established 32768 bind 32768) [ 0.029096] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.029124] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.029225] NET: Registered PF_UNIX/PF_LOCAL protocol family [ 0.029506] RPC: Registered named UNIX socket transport module. [ 0.029510] RPC: Registered udp transport module. [ 0.029512] RPC: Registered tcp transport module. [ 0.029513] RPC: Registered tcp-with-tls transport module. [ 0.029515] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.029524] PCI: CLS 0 bytes, default 64 [ 0.029649] Unpacking initramfs... [ 0.033933] kvm [1]: IPA Size Limit: 40 bits [ 0.034713] kvm [1]: Hyp mode initialized successfully [ 0.035476] Initialise system trusted keyrings [ 0.035582] workingset: timestamp_bits=42 max_order=20 bucket_order=0 [ 0.035747] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.035906] NFS: Registering the id_resolver key type [ 0.035919] Key type id_resolver registered [ 0.035922] Key type id_legacy registered [ 0.035933] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 0.035935] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering... [ 0.036031] 9p: Installing v9fs 9p2000 file system support [ 0.062587] Key type asymmetric registered [ 0.062596] Asymmetric key parser 'x509' registered [ 0.062657] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245) [ 0.062661] io scheduler mq-deadline registered [ 0.062664] io scheduler kyber registered [ 0.062688] io scheduler bfq registered [ 0.063318] irq_meson_gpio: 157 to 12 gpio interrupt mux initialized [ 0.068061] EINJ: ACPI disabled. [ 0.072570] amlogic_t7_pll_probe [ 0.072855] amlogic_t7_pll_probe ret 0 [ 0.072943] amlogic_a1_periphs_probe [ 0.078155] amlogic_a1_periphs_probe ret 0 [ 0.084876] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 0.086691] fe078000.serial: ttyS0 at MMIO 0xfe078000 (irq = 14, base_baud = 1500000) is a meson_uart [ 0.086710] printk: legacy console [ttyS0] enabled [ 0.229167] sysfs: cannot create duplicate filename '/class/tty/ttyS0' [ 0.229669] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.230684] Hardware name: Khadas vim4 (DT) [ 0.231205] Call trace: [ 0.231509] dump_backtrace+0x94/0xec [ 0.231963] show_stack+0x18/0x24 [ 0.232374] dump_stack_lvl+0x78/0x90 [ 0.232829] dump_stack+0x18/0x24 [ 0.233241] sysfs_warn_dup+0x64/0x80 [ 0.233696] sysfs_do_create_link_sd+0xf0/0xf8 [ 0.234248] sysfs_create_link+0x20/0x40 [ 0.234736] device_add+0x27c/0x77c [ 0.235169] device_register+0x20/0x30 [ 0.235635] tty_register_device_attr+0xfc/0x240 [ 0.236209] tty_port_register_device_attr_serdev+0x8c/0xac [ 0.236902] serial_core_register_port+0x318/0x658 [ 0.237498] serial_ctrl_register_port+0x10/0x1c [ 0.238072] uart_add_one_port+0x10/0x1c [ 0.238560] meson_uart_probe+0x2c0/0x3b4 [ 0.239058] platform_probe+0x68/0xd8 [ 0.239513] really_probe+0x148/0x2b4 [ 0.239968] __driver_probe_device+0x78/0x12c [ 0.240510] driver_probe_device+0xdc/0x160 [ 0.241030] __driver_attach+0x94/0x19c [ 0.241507] bus_for_each_dev+0x74/0xd4 [ 0.241983] driver_attach+0x24/0x30 [ 0.242428] bus_add_driver+0xe4/0x1e8 [ 0.242893] driver_register+0x60/0x128 [ 0.243370] __platform_driver_register+0x28/0x34 [ 0.243955] meson_uart_platform_driver_init+0x1c/0x28 [ 0.244594] do_one_initcall+0x6c/0x1b0 [ 0.245071] kernel_init_freeable+0x1cc/0x294 [ 0.245613] kernel_init+0x20/0x1dc [ 0.246046] ret_from_fork+0x10/0x20 [ 0.246555] meson_uart fe078000.serial: Cannot register tty device on line 0 [ 0.247729] msm_serial: driver initialized [ 0.248150] SuperH (H)SCI(F) driver initialized [ 0.248544] STM32 USART driver initialized [ 0.263927] loop: module loaded [ 0.264952] megasas: 07.727.03.00-rc1 [ 0.271065] tun: Universal TUN/TAP device driver, 1.6 [ 0.271824] thunder_xcv, ver 1.0 [ 0.271878] thunder_bgx, ver 1.0 [ 0.271956] nicpf, ver 1.0 [ 0.273230] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version [ 0.273437] hns3: Copyright (c) 2017 Huawei Corporation. [ 0.274148] hclge is initializing [ 0.274541] e1000: Intel(R) PRO/1000 Network Driver [ 0.275116] e1000: Copyright (c) 1999-2006 Intel Corporation. [ 0.275860] e1000e: Intel(R) PRO/1000 Network Driver [ 0.276449] e1000e: Copyright(c) 1999 - 2015 Intel Corporation. [ 0.277209] igb: Intel(R) Gigabit Ethernet Network Driver [ 0.277867] igb: Copyright (c) 2007-2014 Intel Corporation. [ 0.278576] igbvf: Intel(R) Gigabit Virtual Function Network Driver [ 0.279330] igbvf: Copyright (c) 2009 - 2012 Intel Corporation. [ 0.280319] sky2: driver version 1.30 [ 0.281597] VFIO - User Level meta-driver version: 0.3 [ 0.283859] usbcore: registered new interface driver usb-storage [ 0.286328] i2c_dev: i2c /dev entries driver [ 0.292404] sdhci: Secure Digital Host Controller Interface driver [ 0.292481] sdhci: Copyright(c) Pierre Ossman [ 0.293577] Synopsys Designware Multimedia Card Interface Driver [ 0.294572] sdhci-pltfm: SDHCI platform and OF driver helper [ 0.296259] ledtrig-cpu: registered to indicate activity on CPUs [ 0.298966] meson-sm: secure-monitor enabled [ 0.299963] usbcore: registered new interface driver usbhid [ 0.299997] usbhid: USB HID core driver [ 0.306803] NET: Registered PF_PACKET protocol family [ 0.306919] 9pnet: Installing 9P2000 support [ 0.307331] Key type dns_resolver registered [ 0.318926] Timer migration: 1 hierarchy levels; 8 children per group; 1 crossnode level [ 0.319462] registered taskstats version 1 [ 0.319968] Loading compiled-in X.509 certificates [ 0.362771] clk: Disabling unused clocks [ 0.363100] PM: genpd: Disabling unused power domains [ 0.363383] ALSA device list: [ 0.363580] No soundcards found. [ 0.368194] meson-gx-mmc fe08a000.sd: Got CD GPIO [ 0.368524] SError Interrupt on CPU6, code 0x00000000bf000002 -- SError [ 0.368531] CPU: 6 PID: 87 Comm: kworker/u32:3 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.368537] Hardware name: Khadas vim4 (DT) [ 0.368540] Workqueue: async async_run_entry_fn [ 0.368552] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.368556] pc : clk_mux_val_to_index+0x0/0xc0 [ 0.368565] lr : clk_mux_get_parent+0x4c/0x84 [ 0.368571] sp : ffff800082efba10 [ 0.368572] x29: ffff800082efba10 x28: ffff8000823279c0 x27: ffff800082327000 [ 0.368578] x26: ffff000004c361c0 x25: 0000000000000000 x24: 0000000000000002 [ 0.368584] x23: ffff000003f1d300 x22: ffff000003f1d2a0 x21: ffff000004c37280 [ 0.368589] x20: ffff000004c36ec0 x19: ffff000004bba800 x18: 0000000000000020 [ 0.368594] x17: ffff000000022000 x16: 0000000000000003 x15: ffffffffffffffff [ 0.368599] x14: ffffffffffffffff x13: 0078756d2364732e x12: 3030306138306566 [ 0.368604] x11: 7f7f7f7f7f7f7f7f x10: ffff7fff83438910 x9 : 0000000000000005 [ 0.368609] x8 : 0101010101010101 x7 : 0000000000000000 x6 : 05114367045e5359 [ 0.368613] x5 : 0000000000000006 x4 : 0000000000000000 x3 : 0000000000000000 [ 0.368618] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000004c36ec0 [ 0.368624] Kernel panic - not syncing: Asynchronous SError Interrupt [ 0.368626] CPU: 6 PID: 87 Comm: kworker/u32:3 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.368630] Hardware name: Khadas vim4 (DT) [ 0.368631] Workqueue: async async_run_entry_fn [ 0.368635] Call trace: [ 0.368637] dump_backtrace+0x94/0xec [ 0.368644] show_stack+0x18/0x24 [ 0.368649] dump_stack_lvl+0x38/0x90 [ 0.368656] dump_stack+0x18/0x24 [ 0.368661] panic+0x388/0x3c8 [ 0.368666] nmi_panic+0x48/0x94 [ 0.368670] arm64_serror_panic+0x6c/0x78 [ 0.368674] do_serror+0x3c/0x78 [ 0.368677] el1h_64_error_handler+0x30/0x48 [ 0.368681] el1h_64_error+0x64/0x68 [ 0.368684] clk_mux_val_to_index+0x0/0xc0 [ 0.368689] __clk_register+0x440/0x82c [ 0.368693] devm_clk_register+0x5c/0xbc [ 0.368697] meson_mmc_clk_init+0x11c/0x2a8 [ 0.368702] meson_mmc_probe+0x18c/0x3c0 [ 0.368705] platform_probe+0x68/0xd8 [ 0.368711] really_probe+0x148/0x2b4 [ 0.368714] __driver_probe_device+0x78/0x12c [ 0.368718] driver_probe_device+0xdc/0x160 [ 0.368721] __device_attach_driver+0xb8/0x134 [ 0.368724] bus_for_each_drv+0x84/0xe0 [ 0.368727] __device_attach_async_helper+0xac/0xd0 [ 0.368730] async_run_entry_fn+0x34/0xe0 [ 0.368734] process_one_work+0x150/0x294 [ 0.368740] worker_thread+0x304/0x408 [ 0.368744] kthread+0x118/0x11c [ 0.368748] ret_from_fork+0x10/0x20 [ 0.368753] SMP: stopping secondary CPUs [ 0.368760] Kernel Offset: disabled [ 0.368761] CPU features: 0x0,00000060,d0080000,0200421b [ 0.368765] Memory Limit: none [ 0.400328] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]-----
2.44.0
Quoted 5 lines · Xianwei Zhao
Hi Lucas,
As we are preparing the T7 clock patchset, we would like to your
purpose and plan of this RFC patches. Are you going to submit these patches at last?
Hi Xianwei,
I made some progress, and now the SD card controller probes but fails to read blocks from the SD card. I do think my port of the clock driver is okay, but I will not send my clock driver until the SD card fully works, so I am sure the clocking driver is tested. But if you have something already done, please send it, and I will test and review it from my side.
Any help with the sdcard controller is also much appreciated.
Thanks
Lucas
Quoted 372 lines · Lucas Tanure
Quoted 371 lines
[ EXTERNAL EMAIL ]
I am trying to port the T7 clock driver from Khadas 5.4 kernel for Vim4 to mainline, but I am encountering some issues in the path.
The kernel panics at
clk_mux_val_to_index, but I believe that all the needed clocks are registered.If anyone from Amlogic or the community could help me understand what my driver is missing, that would be great.
I will continue to try to figure out, but it has been some weeks without progress =/.Lucas Tanure (2):
clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
arm64: dts: amlogic: t7: SDCard, Ethernet and Clocking.../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 66 + arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 189 + drivers/clk/meson/Kconfig | 25 + drivers/clk/meson/Makefile | 2 + drivers/clk/meson/t7-peripherals.c | 6368 +++++++++++++++++ drivers/clk/meson/t7-peripherals.h | 131 + drivers/clk/meson/t7-pll.c | 1543 ++++ drivers/clk/meson/t7-pll.h | 83 + .../clock/amlogic,t7-peripherals-clkc.h | 410 ++ .../dt-bindings/clock/amlogic,t7-pll-clkc.h | 69 + 10 files changed, 8886 insertions(+)create mode 100644
drivers/clk/meson/t7-peripherals.c
create mode 100644drivers/clk/meson/t7-peripherals.h
create mode 100644drivers/clk/meson/t7-pll.c
create mode 100644drivers/clk/meson/t7-pll.h
create mode 100644include/dt-bindings/clock/amlogic,t7-peripherals-clkc.hcreate mode 100644include/dt-bindings/clock/amlogic,t7-pll-clkc.hStarting kernel ...
uboot time: 14277917 us
boot 64bit kernel[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd092] [ 0.000000] Linux version 6.8.0-09793-gda876e5b54b3-dirty (tanureal@ryzen) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621, GNU ld (GNU Toolchain for the A-pr4 [ 0.000000] KASLR disabled due to lack of seed [ 0.000000] Machine model: Khadas vim4 [ 0.000000] efi: UEFI not found. [ 0.000000] OF: reserved mem: 0x0000000005000000..0x00000000052fffff (3072 KiB) nomap non-reusable secmon@5000000 [ 0.000000] OF: reserved mem: 0x0000000005300000..0x00000000072fffff (32768 KiB) nomap non-reusable secmon@5300000 [ 0.000000] NUMA: No NUMA configuration found [ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] NUMA: NODE_DATA [mem 0xdf10c9c0-0xdf10efff] [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000004ffffff] [ 0.000000] node 0: [mem 0x0000000005000000-0x00000000072fffff] [ 0.000000] node 0: [mem 0x0000000007300000-0x00000000df7fffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] On node 0, zone DMA: 2048 pages in unavailable ranges [ 0.000000] cma: Reserved 32 MiB at 0x00000000d9800000 on node -1 [ 0.000000] psci: probing for conduit method from DT. [ 0.000000] psci: PSCIv1.0 detected in firmware. [ 0.000000] psci: Using standard PSCI v0.2 function IDs [ 0.000000] psci: Trusted OS migration not required [ 0.000000] psci: SMC Calling Convention v1.1 [ 0.000000] percpu: Embedded 24 pages/cpu s58152 r8192 d31960 u98304 [ 0.000000] Detected VIPT I-cache on CPU0 [ 0.000000] CPU features: detected: Spectre-v2 [ 0.000000] CPU features: detected: Spectre-v4 [ 0.000000] CPU features: detected: Spectre-BHB [ 0.000000] CPU features: detected: ARM erratum 858921 [ 0.000000] alternatives: applying boot alternatives [ 0.000000] Kernel command line: root=UUID=a91e7bfe-4263-4e53-867d-7824e7c6a992 rw rootfstype=ext4 console=ttyS0,921600 no_console_suspend earlycon=ttyS0,0xfe078000 khadas_board=VIM4 androidboot.selinux=permissive androidboot.0 [ 0.000000] Unknown kernel command line parameters "khadas_board=VIM4", will be passed to user space. [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear) [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Fallback order for Node 0: 0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 901152 [ 0.000000] Policy zone: DMA [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] software IO TLB: SWIOTLB bounce buffer size adjusted to 3MB [ 0.000000] software IO TLB: area num 8. [ 0.000000] software IO TLB: SWIOTLB bounce buffer size roundup to 4MB [ 0.000000] software IO TLB: mapped [mem 0x00000000d8e00000-0x00000000d9200000] (4MB) [ 0.000000] Memory: 3445944K/3661824K available (16896K kernel code, 4426K rwdata, 9184K rodata, 9728K init, 611K bss, 183112K reserved, 32768K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=8. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] Tracing variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8 [ 0.000000] RCU Tasks: Setting shift to 3 and lim to 1 rcu_task_cb_adjust=1. [ 0.000000] RCU Tasks Trace: Setting shift to 3 and lim to 1 rcu_task_cb_adjust=1. [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set [ 0.000000] Root IRQ handler: gic_handle_irq [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. [ 0.000000] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.000000] arch_timer: CPU0: Trapping CNTVCT access [ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns [ 0.000000] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns [ 0.000210] Console: colour dummy device 80x25 [ 0.000253] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000) [ 0.000261] pid_max: default: 32768 minimum: 301 [ 0.000300] LSM: initializing lsm=capability [ 0.000358] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000371] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000920] cacheinfo: Unable to detect cache hierarchy for CPU 0 [ 0.001389] rcu: Hierarchical SRCU implementation. [ 0.001391] rcu: Max phase no-delay instances is 1000. [ 0.001834] EFI services will not be available. [ 0.001999] smp: Bringing up secondary CPUs ... [ 0.002408] CPU features: detected: ARM erratum 845719 [ 0.002426] Detected VIPT I-cache on CPU1 [ 0.002516] CPU1: Booted secondary processor 0x0000000100 [0x410fd034] [ 0.003007] Detected VIPT I-cache on CPU2 [ 0.003054] CPU2: Booted secondary processor 0x0000000101 [0x410fd034] [ 0.003497] Detected VIPT I-cache on CPU3 [ 0.003546] CPU3: Booted secondary processor 0x0000000102 [0x410fd034] [ 0.003988] Detected VIPT I-cache on CPU4 [ 0.004038] CPU4: Booted secondary processor 0x0000000103 [0x410fd034] [ 0.004472] Detected VIPT I-cache on CPU5 [ 0.004509] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.004519] arch_timer: CPU5: Trapping CNTVCT access [ 0.004527] CPU5: Booted secondary processor 0x0000000001 [0x410fd092] [ 0.004915] Detected VIPT I-cache on CPU6 [ 0.004940] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.004946] arch_timer: CPU6: Trapping CNTVCT access [ 0.004951] CPU6: Booted secondary processor 0x0000000002 [0x410fd092] [ 0.005333] Detected VIPT I-cache on CPU7 [ 0.005358] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.005364] arch_timer: CPU7: Trapping CNTVCT access [ 0.005369] CPU7: Booted secondary processor 0x0000000003 [0x410fd092] [ 0.005414] smp: Brought up 1 node, 8 CPUs [ 0.005419] SMP: Total of 8 processors activated. [ 0.005421] CPU: All CPU(s) started at EL2 [ 0.005434] CPU features: detected: 32-bit EL0 Support [ 0.005437] CPU features: detected: 32-bit EL1 Support [ 0.005440] CPU features: detected: CRC32 instructions [ 0.005485] alternatives: applying system-wide alternatives [ 0.006730] devtmpfs: initialized [ 0.008534] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.008545] futex hash table entries: 2048 (order: 5, 131072 bytes, linear) [ 0.008989] pinctrl core: initialized pinctrl subsystem [ 0.009581] DMI not present or invalid. [ 0.011290] NET: Registered PF_NETLINK/PF_ROUTE protocol family [ 0.011944] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations [ 0.012293] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.012711] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.012832] audit: initializing netlink subsys (disabled) [ 0.013075] audit: type=2000 audit(0.012:1): state=initialized audit_enabled=0 res=1 [ 0.013508] thermal_sys: Registered thermal governor 'step_wise' [ 0.013512] thermal_sys: Registered thermal governor 'power_allocator' [ 0.013557] cpuidle: using governor menu [ 0.013675] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. [ 0.013784] ASID allocator initialised with 65536 entries [ 0.014630] Serial: AMBA PL011 UART driver [ 0.017553] Modules: 22496 pages in range for non-PLT usage [ 0.017556] Modules: 514016 pages in range for PLT usage [ 0.017980] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages [ 0.017984] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page [ 0.017988] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages [ 0.017990] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page [ 0.017993] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages [ 0.017995] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page [ 0.017997] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages [ 0.018000] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page [ 0.018247] Demotion targets for Node 0: null [ 0.018884] ACPI: Interpreter disabled. [ 0.019584] iommu: Default domain type: Translated [ 0.019587] iommu: DMA domain TLB invalidation policy: strict mode [ 0.019979] SCSI subsystem initialized [ 0.020174] usbcore: registered new interface driver usbfs [ 0.020187] usbcore: registered new interface driver hub [ 0.020200] usbcore: registered new device driver usb [ 0.020434] pps_core: LinuxPPS API ver. 1 registered [ 0.020437] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]> [ 0.020443] PTP clock support registered [ 0.020487] EDAC MC: Ver: 3.0.0 [ 0.020717] scmi_core: SCMI protocol bus registered [ 0.021039] FPGA manager framework [ 0.021076] Advanced Linux Sound Architecture Driver Initialized. [ 0.021612] vgaarb: loaded [ 0.021857] clocksource: Switched to clocksource arch_sys_counter [ 0.021967] VFS: Disk quotas dquot_6.6.0 [ 0.021984] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) [ 0.022062] pnp: PnP ACPI: disabled [ 0.026651] NET: Registered PF_INET protocol family [ 0.026781] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear) [ 0.028598] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear) [ 0.028615] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) [ 0.028622] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 0.028750] TCP bind hash table entries: 32768 (order: 8, 1048576 bytes, linear) [ 0.029019] TCP: Hash tables configured (established 32768 bind 32768) [ 0.029096] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.029124] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.029225] NET: Registered PF_UNIX/PF_LOCAL protocol family [ 0.029506] RPC: Registered named UNIX socket transport module. [ 0.029510] RPC: Registered udp transport module. [ 0.029512] RPC: Registered tcp transport module. [ 0.029513] RPC: Registered tcp-with-tls transport module. [ 0.029515] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.029524] PCI: CLS 0 bytes, default 64 [ 0.029649] Unpacking initramfs... [ 0.033933] kvm [1]: IPA Size Limit: 40 bits [ 0.034713] kvm [1]: Hyp mode initialized successfully [ 0.035476] Initialise system trusted keyrings [ 0.035582] workingset: timestamp_bits=42 max_order=20 bucket_order=0 [ 0.035747] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.035906] NFS: Registering the id_resolver key type [ 0.035919] Key type id_resolver registered [ 0.035922] Key type id_legacy registered [ 0.035933] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 0.035935] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering... [ 0.036031] 9p: Installing v9fs 9p2000 file system support [ 0.062587] Key type asymmetric registered [ 0.062596] Asymmetric key parser 'x509' registered [ 0.062657] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245) [ 0.062661] io scheduler mq-deadline registered [ 0.062664] io scheduler kyber registered [ 0.062688] io scheduler bfq registered [ 0.063318] irq_meson_gpio: 157 to 12 gpio interrupt mux initialized [ 0.068061] EINJ: ACPI disabled. [ 0.072570] amlogic_t7_pll_probe [ 0.072855] amlogic_t7_pll_probe ret 0 [ 0.072943] amlogic_a1_periphs_probe [ 0.078155] amlogic_a1_periphs_probe ret 0 [ 0.084876] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 0.086691] fe078000.serial: ttyS0 at MMIO 0xfe078000 (irq = 14, base_baud = 1500000) is a meson_uart [ 0.086710] printk: legacy console [ttyS0] enabled [ 0.229167] sysfs: cannot create duplicate filename '/class/tty/ttyS0' [ 0.229669] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.230684] Hardware name: Khadas vim4 (DT) [ 0.231205] Call trace: [ 0.231509] dump_backtrace+0x94/0xec [ 0.231963] show_stack+0x18/0x24 [ 0.232374] dump_stack_lvl+0x78/0x90 [ 0.232829] dump_stack+0x18/0x24 [ 0.233241] sysfs_warn_dup+0x64/0x80 [ 0.233696] sysfs_do_create_link_sd+0xf0/0xf8 [ 0.234248] sysfs_create_link+0x20/0x40 [ 0.234736] device_add+0x27c/0x77c [ 0.235169] device_register+0x20/0x30 [ 0.235635] tty_register_device_attr+0xfc/0x240 [ 0.236209] tty_port_register_device_attr_serdev+0x8c/0xac [ 0.236902] serial_core_register_port+0x318/0x658 [ 0.237498] serial_ctrl_register_port+0x10/0x1c [ 0.238072] uart_add_one_port+0x10/0x1c [ 0.238560] meson_uart_probe+0x2c0/0x3b4 [ 0.239058] platform_probe+0x68/0xd8 [ 0.239513] really_probe+0x148/0x2b4 [ 0.239968] __driver_probe_device+0x78/0x12c [ 0.240510] driver_probe_device+0xdc/0x160 [ 0.241030] __driver_attach+0x94/0x19c [ 0.241507] bus_for_each_dev+0x74/0xd4 [ 0.241983] driver_attach+0x24/0x30 [ 0.242428] bus_add_driver+0xe4/0x1e8 [ 0.242893] driver_register+0x60/0x128 [ 0.243370] __platform_driver_register+0x28/0x34 [ 0.243955] meson_uart_platform_driver_init+0x1c/0x28 [ 0.244594] do_one_initcall+0x6c/0x1b0 [ 0.245071] kernel_init_freeable+0x1cc/0x294 [ 0.245613] kernel_init+0x20/0x1dc [ 0.246046] ret_from_fork+0x10/0x20 [ 0.246555] meson_uart fe078000.serial: Cannot register tty device on line 0 [ 0.247729] msm_serial: driver initialized [ 0.248150] SuperH (H)SCI(F) driver initialized [ 0.248544] STM32 USART driver initialized [ 0.263927] loop: module loaded [ 0.264952] megasas: 07.727.03.00-rc1 [ 0.271065] tun: Universal TUN/TAP device driver, 1.6 [ 0.271824] thunder_xcv, ver 1.0 [ 0.271878] thunder_bgx, ver 1.0 [ 0.271956] nicpf, ver 1.0 [ 0.273230] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version [ 0.273437] hns3: Copyright (c) 2017 Huawei Corporation. [ 0.274148] hclge is initializing [ 0.274541] e1000: Intel(R) PRO/1000 Network Driver [ 0.275116] e1000: Copyright (c) 1999-2006 Intel Corporation. [ 0.275860] e1000e: Intel(R) PRO/1000 Network Driver [ 0.276449] e1000e: Copyright(c) 1999 - 2015 Intel Corporation. [ 0.277209] igb: Intel(R) Gigabit Ethernet Network Driver [ 0.277867] igb: Copyright (c) 2007-2014 Intel Corporation. [ 0.278576] igbvf: Intel(R) Gigabit Virtual Function Network Driver [ 0.279330] igbvf: Copyright (c) 2009 - 2012 Intel Corporation. [ 0.280319] sky2: driver version 1.30 [ 0.281597] VFIO - User Level meta-driver version: 0.3 [ 0.283859] usbcore: registered new interface driver usb-storage [ 0.286328] i2c_dev: i2c /dev entries driver [ 0.292404] sdhci: Secure Digital Host Controller Interface driver [ 0.292481] sdhci: Copyright(c) Pierre Ossman [ 0.293577] Synopsys Designware Multimedia Card Interface Driver [ 0.294572] sdhci-pltfm: SDHCI platform and OF driver helper [ 0.296259] ledtrig-cpu: registered to indicate activity on CPUs [ 0.298966] meson-sm: secure-monitor enabled [ 0.299963] usbcore: registered new interface driver usbhid [ 0.299997] usbhid: USB HID core driver [ 0.306803] NET: Registered PF_PACKET protocol family [ 0.306919] 9pnet: Installing 9P2000 support [ 0.307331] Key type dns_resolver registered [ 0.318926] Timer migration: 1 hierarchy levels; 8 children per group; 1 crossnode level [ 0.319462] registered taskstats version 1 [ 0.319968] Loading compiled-in X.509 certificates [ 0.362771] clk: Disabling unused clocks [ 0.363100] PM: genpd: Disabling unused power domains [ 0.363383] ALSA device list: [ 0.363580] No soundcards found. [ 0.368194] meson-gx-mmc fe08a000.sd: Got CD GPIO [ 0.368524] SError Interrupt on CPU6, code 0x00000000bf000002 -- SError [ 0.368531] CPU: 6 PID: 87 Comm: kworker/u32:3 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.368537] Hardware name: Khadas vim4 (DT) [ 0.368540] Workqueue: async async_run_entry_fn [ 0.368552] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.368556] pc : clk_mux_val_to_index+0x0/0xc0 [ 0.368565] lr : clk_mux_get_parent+0x4c/0x84 [ 0.368571] sp : ffff800082efba10 [ 0.368572] x29: ffff800082efba10 x28: ffff8000823279c0 x27: ffff800082327000 [ 0.368578] x26: ffff000004c361c0 x25: 0000000000000000 x24: 0000000000000002 [ 0.368584] x23: ffff000003f1d300 x22: ffff000003f1d2a0 x21: ffff000004c37280 [ 0.368589] x20: ffff000004c36ec0 x19: ffff000004bba800 x18: 0000000000000020 [ 0.368594] x17: ffff000000022000 x16: 0000000000000003 x15: ffffffffffffffff [ 0.368599] x14: ffffffffffffffff x13: 0078756d2364732e x12: 3030306138306566 [ 0.368604] x11: 7f7f7f7f7f7f7f7f x10: ffff7fff83438910 x9 : 0000000000000005 [ 0.368609] x8 : 0101010101010101 x7 : 0000000000000000 x6 : 05114367045e5359 [ 0.368613] x5 : 0000000000000006 x4 : 0000000000000000 x3 : 0000000000000000 [ 0.368618] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000004c36ec0 [ 0.368624] Kernel panic - not syncing: Asynchronous SError Interrupt [ 0.368626] CPU: 6 PID: 87 Comm: kworker/u32:3 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.368630] Hardware name: Khadas vim4 (DT) [ 0.368631] Workqueue: async async_run_entry_fn [ 0.368635] Call trace: [ 0.368637] dump_backtrace+0x94/0xec [ 0.368644] show_stack+0x18/0x24 [ 0.368649] dump_stack_lvl+0x38/0x90 [ 0.368656] dump_stack+0x18/0x24 [ 0.368661] panic+0x388/0x3c8 [ 0.368666] nmi_panic+0x48/0x94 [ 0.368670] arm64_serror_panic+0x6c/0x78 [ 0.368674] do_serror+0x3c/0x78 [ 0.368677] el1h_64_error_handler+0x30/0x48 [ 0.368681] el1h_64_error+0x64/0x68 [ 0.368684] clk_mux_val_to_index+0x0/0xc0 [ 0.368689] __clk_register+0x440/0x82c [ 0.368693] devm_clk_register+0x5c/0xbc [ 0.368697] meson_mmc_clk_init+0x11c/0x2a8 [ 0.368702] meson_mmc_probe+0x18c/0x3c0 [ 0.368705] platform_probe+0x68/0xd8 [ 0.368711] really_probe+0x148/0x2b4 [ 0.368714] __driver_probe_device+0x78/0x12c [ 0.368718] driver_probe_device+0xdc/0x160 [ 0.368721] __device_attach_driver+0xb8/0x134 [ 0.368724] bus_for_each_drv+0x84/0xe0 [ 0.368727] __device_attach_async_helper+0xac/0xd0 [ 0.368730] async_run_entry_fn+0x34/0xe0 [ 0.368734] process_one_work+0x150/0x294 [ 0.368740] worker_thread+0x304/0x408 [ 0.368744] kthread+0x118/0x11c [ 0.368748] ret_from_fork+0x10/0x20 [ 0.368753] SMP: stopping secondary CPUs [ 0.368760] Kernel Offset: disabled [ 0.368761] CPU features: 0x0,00000060,d0080000,0200421b [ 0.368765] Memory Limit: none [ 0.400328] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]-----
2.44.0
Hi Lucas,
Thanks for your reply.
Quoted 18 lines · Lucas Tanure
[ EXTERNAL EMAIL ]
Quoted 5 lines · Xianwei Zhao
Hi Lucas,
As we are preparing the T7 clock patchset, we would like to your
purpose and plan of this RFC patches. Are you going to submit these patches at last?Hi Xianwei,
I made some progress, and now the SD card controller probes but fails to read blocks from the SD card. I do think my port of the clock driver is okay, but I will not send my clock driver until the SD card fully works, so I am sure the clocking driver is tested. But if you have something already done, please send it, and I will test and review it from my side.
Quoted 2 lines
Any help with the sdcard controller is also much appreciated. The SDCard part works well on our clock patchset. Then we will send the
formal clock submission later. What do you think?
Quoted 375 lines
Thanks
LucasQuoted 372 lines · Lucas Tanure
Quoted 371 lines
[ EXTERNAL EMAIL ]
I am trying to port the T7 clock driver from Khadas 5.4 kernel for Vim4 to mainline, but I am encountering some issues in the path.
The kernel panics at
clk_mux_val_to_index, but I believe that all the needed clocks are registered.If anyone from Amlogic or the community could help me understand what my driver is missing, that would be great.
I will continue to try to figure out, but it has been some weeks without progress =/.Lucas Tanure (2):
clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
arm64: dts: amlogic: t7: SDCard, Ethernet and Clocking.../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 66 + arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 189 + drivers/clk/meson/Kconfig | 25 + drivers/clk/meson/Makefile | 2 + drivers/clk/meson/t7-peripherals.c | 6368 +++++++++++++++++ drivers/clk/meson/t7-peripherals.h | 131 + drivers/clk/meson/t7-pll.c | 1543 ++++ drivers/clk/meson/t7-pll.h | 83 + .../clock/amlogic,t7-peripherals-clkc.h | 410 ++ .../dt-bindings/clock/amlogic,t7-pll-clkc.h | 69 + 10 files changed, 8886 insertions(+)create mode 100644
drivers/clk/meson/t7-peripherals.c
create mode 100644drivers/clk/meson/t7-peripherals.h
create mode 100644drivers/clk/meson/t7-pll.c
create mode 100644drivers/clk/meson/t7-pll.h
create mode 100644include/dt-bindings/clock/amlogic,t7-peripherals-clkc.hcreate mode 100644include/dt-bindings/clock/amlogic,t7-pll-clkc.hStarting kernel ...
uboot time: 14277917 us
boot 64bit kernel[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd092] [ 0.000000] Linux version 6.8.0-09793-gda876e5b54b3-dirty (tanureal@ryzen) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621, GNU ld (GNU Toolchain for the A-pr4 [ 0.000000] KASLR disabled due to lack of seed [ 0.000000] Machine model: Khadas vim4 [ 0.000000] efi: UEFI not found. [ 0.000000] OF: reserved mem: 0x0000000005000000..0x00000000052fffff (3072 KiB) nomap non-reusable secmon@5000000 [ 0.000000] OF: reserved mem: 0x0000000005300000..0x00000000072fffff (32768 KiB) nomap non-reusable secmon@5300000 [ 0.000000] NUMA: No NUMA configuration found [ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] NUMA: NODE_DATA [mem 0xdf10c9c0-0xdf10efff] [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000004ffffff] [ 0.000000] node 0: [mem 0x0000000005000000-0x00000000072fffff] [ 0.000000] node 0: [mem 0x0000000007300000-0x00000000df7fffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] On node 0, zone DMA: 2048 pages in unavailable ranges [ 0.000000] cma: Reserved 32 MiB at 0x00000000d9800000 on node -1 [ 0.000000] psci: probing for conduit method from DT. [ 0.000000] psci: PSCIv1.0 detected in firmware. [ 0.000000] psci: Using standard PSCI v0.2 function IDs [ 0.000000] psci: Trusted OS migration not required [ 0.000000] psci: SMC Calling Convention v1.1 [ 0.000000] percpu: Embedded 24 pages/cpu s58152 r8192 d31960 u98304 [ 0.000000] Detected VIPT I-cache on CPU0 [ 0.000000] CPU features: detected: Spectre-v2 [ 0.000000] CPU features: detected: Spectre-v4 [ 0.000000] CPU features: detected: Spectre-BHB [ 0.000000] CPU features: detected: ARM erratum 858921 [ 0.000000] alternatives: applying boot alternatives [ 0.000000] Kernel command line: root=UUID=a91e7bfe-4263-4e53-867d-7824e7c6a992 rw rootfstype=ext4 console=ttyS0,921600 no_console_suspend earlycon=ttyS0,0xfe078000 khadas_board=VIM4 androidboot.selinux=permissive androidboot.0 [ 0.000000] Unknown kernel command line parameters "khadas_board=VIM4", will be passed to user space. [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear) [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Fallback order for Node 0: 0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 901152 [ 0.000000] Policy zone: DMA [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] software IO TLB: SWIOTLB bounce buffer size adjusted to 3MB [ 0.000000] software IO TLB: area num 8. [ 0.000000] software IO TLB: SWIOTLB bounce buffer size roundup to 4MB [ 0.000000] software IO TLB: mapped [mem 0x00000000d8e00000-0x00000000d9200000] (4MB) [ 0.000000] Memory: 3445944K/3661824K available (16896K kernel code, 4426K rwdata, 9184K rodata, 9728K init, 611K bss, 183112K reserved, 32768K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=8. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] Tracing variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8 [ 0.000000] RCU Tasks: Setting shift to 3 and lim to 1 rcu_task_cb_adjust=1. [ 0.000000] RCU Tasks Trace: Setting shift to 3 and lim to 1 rcu_task_cb_adjust=1. [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set [ 0.000000] Root IRQ handler: gic_handle_irq [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. [ 0.000000] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.000000] arch_timer: CPU0: Trapping CNTVCT access [ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns [ 0.000000] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns [ 0.000210] Console: colour dummy device 80x25 [ 0.000253] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000) [ 0.000261] pid_max: default: 32768 minimum: 301 [ 0.000300] LSM: initializing lsm=capability [ 0.000358] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000371] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000920] cacheinfo: Unable to detect cache hierarchy for CPU 0 [ 0.001389] rcu: Hierarchical SRCU implementation. [ 0.001391] rcu: Max phase no-delay instances is 1000. [ 0.001834] EFI services will not be available. [ 0.001999] smp: Bringing up secondary CPUs ... [ 0.002408] CPU features: detected: ARM erratum 845719 [ 0.002426] Detected VIPT I-cache on CPU1 [ 0.002516] CPU1: Booted secondary processor 0x0000000100 [0x410fd034] [ 0.003007] Detected VIPT I-cache on CPU2 [ 0.003054] CPU2: Booted secondary processor 0x0000000101 [0x410fd034] [ 0.003497] Detected VIPT I-cache on CPU3 [ 0.003546] CPU3: Booted secondary processor 0x0000000102 [0x410fd034] [ 0.003988] Detected VIPT I-cache on CPU4 [ 0.004038] CPU4: Booted secondary processor 0x0000000103 [0x410fd034] [ 0.004472] Detected VIPT I-cache on CPU5 [ 0.004509] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.004519] arch_timer: CPU5: Trapping CNTVCT access [ 0.004527] CPU5: Booted secondary processor 0x0000000001 [0x410fd092] [ 0.004915] Detected VIPT I-cache on CPU6 [ 0.004940] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.004946] arch_timer: CPU6: Trapping CNTVCT access [ 0.004951] CPU6: Booted secondary processor 0x0000000002 [0x410fd092] [ 0.005333] Detected VIPT I-cache on CPU7 [ 0.005358] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.005364] arch_timer: CPU7: Trapping CNTVCT access [ 0.005369] CPU7: Booted secondary processor 0x0000000003 [0x410fd092] [ 0.005414] smp: Brought up 1 node, 8 CPUs [ 0.005419] SMP: Total of 8 processors activated. [ 0.005421] CPU: All CPU(s) started at EL2 [ 0.005434] CPU features: detected: 32-bit EL0 Support [ 0.005437] CPU features: detected: 32-bit EL1 Support [ 0.005440] CPU features: detected: CRC32 instructions [ 0.005485] alternatives: applying system-wide alternatives [ 0.006730] devtmpfs: initialized [ 0.008534] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.008545] futex hash table entries: 2048 (order: 5, 131072 bytes, linear) [ 0.008989] pinctrl core: initialized pinctrl subsystem [ 0.009581] DMI not present or invalid. [ 0.011290] NET: Registered PF_NETLINK/PF_ROUTE protocol family [ 0.011944] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations [ 0.012293] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.012711] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.012832] audit: initializing netlink subsys (disabled) [ 0.013075] audit: type=2000 audit(0.012:1): state=initialized audit_enabled=0 res=1 [ 0.013508] thermal_sys: Registered thermal governor 'step_wise' [ 0.013512] thermal_sys: Registered thermal governor 'power_allocator' [ 0.013557] cpuidle: using governor menu [ 0.013675] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. [ 0.013784] ASID allocator initialised with 65536 entries [ 0.014630] Serial: AMBA PL011 UART driver [ 0.017553] Modules: 22496 pages in range for non-PLT usage [ 0.017556] Modules: 514016 pages in range for PLT usage [ 0.017980] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages [ 0.017984] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page [ 0.017988] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages [ 0.017990] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page [ 0.017993] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages [ 0.017995] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page [ 0.017997] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages [ 0.018000] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page [ 0.018247] Demotion targets for Node 0: null [ 0.018884] ACPI: Interpreter disabled. [ 0.019584] iommu: Default domain type: Translated [ 0.019587] iommu: DMA domain TLB invalidation policy: strict mode [ 0.019979] SCSI subsystem initialized [ 0.020174] usbcore: registered new interface driver usbfs [ 0.020187] usbcore: registered new interface driver hub [ 0.020200] usbcore: registered new device driver usb [ 0.020434] pps_core: LinuxPPS API ver. 1 registered [ 0.020437] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]> [ 0.020443] PTP clock support registered [ 0.020487] EDAC MC: Ver: 3.0.0 [ 0.020717] scmi_core: SCMI protocol bus registered [ 0.021039] FPGA manager framework [ 0.021076] Advanced Linux Sound Architecture Driver Initialized. [ 0.021612] vgaarb: loaded [ 0.021857] clocksource: Switched to clocksource arch_sys_counter [ 0.021967] VFS: Disk quotas dquot_6.6.0 [ 0.021984] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) [ 0.022062] pnp: PnP ACPI: disabled [ 0.026651] NET: Registered PF_INET protocol family [ 0.026781] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear) [ 0.028598] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear) [ 0.028615] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) [ 0.028622] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 0.028750] TCP bind hash table entries: 32768 (order: 8, 1048576 bytes, linear) [ 0.029019] TCP: Hash tables configured (established 32768 bind 32768) [ 0.029096] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.029124] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.029225] NET: Registered PF_UNIX/PF_LOCAL protocol family [ 0.029506] RPC: Registered named UNIX socket transport module. [ 0.029510] RPC: Registered udp transport module. [ 0.029512] RPC: Registered tcp transport module. [ 0.029513] RPC: Registered tcp-with-tls transport module. [ 0.029515] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.029524] PCI: CLS 0 bytes, default 64 [ 0.029649] Unpacking initramfs... [ 0.033933] kvm [1]: IPA Size Limit: 40 bits [ 0.034713] kvm [1]: Hyp mode initialized successfully [ 0.035476] Initialise system trusted keyrings [ 0.035582] workingset: timestamp_bits=42 max_order=20 bucket_order=0 [ 0.035747] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.035906] NFS: Registering the id_resolver key type [ 0.035919] Key type id_resolver registered [ 0.035922] Key type id_legacy registered [ 0.035933] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 0.035935] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering... [ 0.036031] 9p: Installing v9fs 9p2000 file system support [ 0.062587] Key type asymmetric registered [ 0.062596] Asymmetric key parser 'x509' registered [ 0.062657] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245) [ 0.062661] io scheduler mq-deadline registered [ 0.062664] io scheduler kyber registered [ 0.062688] io scheduler bfq registered [ 0.063318] irq_meson_gpio: 157 to 12 gpio interrupt mux initialized [ 0.068061] EINJ: ACPI disabled. [ 0.072570] amlogic_t7_pll_probe [ 0.072855] amlogic_t7_pll_probe ret 0 [ 0.072943] amlogic_a1_periphs_probe [ 0.078155] amlogic_a1_periphs_probe ret 0 [ 0.084876] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 0.086691] fe078000.serial: ttyS0 at MMIO 0xfe078000 (irq = 14, base_baud = 1500000) is a meson_uart [ 0.086710] printk: legacy console [ttyS0] enabled [ 0.229167] sysfs: cannot create duplicate filename '/class/tty/ttyS0' [ 0.229669] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.230684] Hardware name: Khadas vim4 (DT) [ 0.231205] Call trace: [ 0.231509] dump_backtrace+0x94/0xec [ 0.231963] show_stack+0x18/0x24 [ 0.232374] dump_stack_lvl+0x78/0x90 [ 0.232829] dump_stack+0x18/0x24 [ 0.233241] sysfs_warn_dup+0x64/0x80 [ 0.233696] sysfs_do_create_link_sd+0xf0/0xf8 [ 0.234248] sysfs_create_link+0x20/0x40 [ 0.234736] device_add+0x27c/0x77c [ 0.235169] device_register+0x20/0x30 [ 0.235635] tty_register_device_attr+0xfc/0x240 [ 0.236209] tty_port_register_device_attr_serdev+0x8c/0xac [ 0.236902] serial_core_register_port+0x318/0x658 [ 0.237498] serial_ctrl_register_port+0x10/0x1c [ 0.238072] uart_add_one_port+0x10/0x1c [ 0.238560] meson_uart_probe+0x2c0/0x3b4 [ 0.239058] platform_probe+0x68/0xd8 [ 0.239513] really_probe+0x148/0x2b4 [ 0.239968] __driver_probe_device+0x78/0x12c [ 0.240510] driver_probe_device+0xdc/0x160 [ 0.241030] __driver_attach+0x94/0x19c [ 0.241507] bus_for_each_dev+0x74/0xd4 [ 0.241983] driver_attach+0x24/0x30 [ 0.242428] bus_add_driver+0xe4/0x1e8 [ 0.242893] driver_register+0x60/0x128 [ 0.243370] __platform_driver_register+0x28/0x34 [ 0.243955] meson_uart_platform_driver_init+0x1c/0x28 [ 0.244594] do_one_initcall+0x6c/0x1b0 [ 0.245071] kernel_init_freeable+0x1cc/0x294 [ 0.245613] kernel_init+0x20/0x1dc [ 0.246046] ret_from_fork+0x10/0x20 [ 0.246555] meson_uart fe078000.serial: Cannot register tty device on line 0 [ 0.247729] msm_serial: driver initialized [ 0.248150] SuperH (H)SCI(F) driver initialized [ 0.248544] STM32 USART driver initialized [ 0.263927] loop: module loaded [ 0.264952] megasas: 07.727.03.00-rc1 [ 0.271065] tun: Universal TUN/TAP device driver, 1.6 [ 0.271824] thunder_xcv, ver 1.0 [ 0.271878] thunder_bgx, ver 1.0 [ 0.271956] nicpf, ver 1.0 [ 0.273230] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version [ 0.273437] hns3: Copyright (c) 2017 Huawei Corporation. [ 0.274148] hclge is initializing [ 0.274541] e1000: Intel(R) PRO/1000 Network Driver [ 0.275116] e1000: Copyright (c) 1999-2006 Intel Corporation. [ 0.275860] e1000e: Intel(R) PRO/1000 Network Driver [ 0.276449] e1000e: Copyright(c) 1999 - 2015 Intel Corporation. [ 0.277209] igb: Intel(R) Gigabit Ethernet Network Driver [ 0.277867] igb: Copyright (c) 2007-2014 Intel Corporation. [ 0.278576] igbvf: Intel(R) Gigabit Virtual Function Network Driver [ 0.279330] igbvf: Copyright (c) 2009 - 2012 Intel Corporation. [ 0.280319] sky2: driver version 1.30 [ 0.281597] VFIO - User Level meta-driver version: 0.3 [ 0.283859] usbcore: registered new interface driver usb-storage [ 0.286328] i2c_dev: i2c /dev entries driver [ 0.292404] sdhci: Secure Digital Host Controller Interface driver [ 0.292481] sdhci: Copyright(c) Pierre Ossman [ 0.293577] Synopsys Designware Multimedia Card Interface Driver [ 0.294572] sdhci-pltfm: SDHCI platform and OF driver helper [ 0.296259] ledtrig-cpu: registered to indicate activity on CPUs [ 0.298966] meson-sm: secure-monitor enabled [ 0.299963] usbcore: registered new interface driver usbhid [ 0.299997] usbhid: USB HID core driver [ 0.306803] NET: Registered PF_PACKET protocol family [ 0.306919] 9pnet: Installing 9P2000 support [ 0.307331] Key type dns_resolver registered [ 0.318926] Timer migration: 1 hierarchy levels; 8 children per group; 1 crossnode level [ 0.319462] registered taskstats version 1 [ 0.319968] Loading compiled-in X.509 certificates [ 0.362771] clk: Disabling unused clocks [ 0.363100] PM: genpd: Disabling unused power domains [ 0.363383] ALSA device list: [ 0.363580] No soundcards found. [ 0.368194] meson-gx-mmc fe08a000.sd: Got CD GPIO [ 0.368524] SError Interrupt on CPU6, code 0x00000000bf000002 -- SError [ 0.368531] CPU: 6 PID: 87 Comm: kworker/u32:3 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.368537] Hardware name: Khadas vim4 (DT) [ 0.368540] Workqueue: async async_run_entry_fn [ 0.368552] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.368556] pc : clk_mux_val_to_index+0x0/0xc0 [ 0.368565] lr : clk_mux_get_parent+0x4c/0x84 [ 0.368571] sp : ffff800082efba10 [ 0.368572] x29: ffff800082efba10 x28: ffff8000823279c0 x27: ffff800082327000 [ 0.368578] x26: ffff000004c361c0 x25: 0000000000000000 x24: 0000000000000002 [ 0.368584] x23: ffff000003f1d300 x22: ffff000003f1d2a0 x21: ffff000004c37280 [ 0.368589] x20: ffff000004c36ec0 x19: ffff000004bba800 x18: 0000000000000020 [ 0.368594] x17: ffff000000022000 x16: 0000000000000003 x15: ffffffffffffffff [ 0.368599] x14: ffffffffffffffff x13: 0078756d2364732e x12: 3030306138306566 [ 0.368604] x11: 7f7f7f7f7f7f7f7f x10: ffff7fff83438910 x9 : 0000000000000005 [ 0.368609] x8 : 0101010101010101 x7 : 0000000000000000 x6 : 05114367045e5359 [ 0.368613] x5 : 0000000000000006 x4 : 0000000000000000 x3 : 0000000000000000 [ 0.368618] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000004c36ec0 [ 0.368624] Kernel panic - not syncing: Asynchronous SError Interrupt [ 0.368626] CPU: 6 PID: 87 Comm: kworker/u32:3 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.368630] Hardware name: Khadas vim4 (DT) [ 0.368631] Workqueue: async async_run_entry_fn [ 0.368635] Call trace: [ 0.368637] dump_backtrace+0x94/0xec [ 0.368644] show_stack+0x18/0x24 [ 0.368649] dump_stack_lvl+0x38/0x90 [ 0.368656] dump_stack+0x18/0x24 [ 0.368661] panic+0x388/0x3c8 [ 0.368666] nmi_panic+0x48/0x94 [ 0.368670] arm64_serror_panic+0x6c/0x78 [ 0.368674] do_serror+0x3c/0x78 [ 0.368677] el1h_64_error_handler+0x30/0x48 [ 0.368681] el1h_64_error+0x64/0x68 [ 0.368684] clk_mux_val_to_index+0x0/0xc0 [ 0.368689] __clk_register+0x440/0x82c [ 0.368693] devm_clk_register+0x5c/0xbc [ 0.368697] meson_mmc_clk_init+0x11c/0x2a8 [ 0.368702] meson_mmc_probe+0x18c/0x3c0 [ 0.368705] platform_probe+0x68/0xd8 [ 0.368711] really_probe+0x148/0x2b4 [ 0.368714] __driver_probe_device+0x78/0x12c [ 0.368718] driver_probe_device+0xdc/0x160 [ 0.368721] __device_attach_driver+0xb8/0x134 [ 0.368724] bus_for_each_drv+0x84/0xe0 [ 0.368727] __device_attach_async_helper+0xac/0xd0 [ 0.368730] async_run_entry_fn+0x34/0xe0 [ 0.368734] process_one_work+0x150/0x294 [ 0.368740] worker_thread+0x304/0x408 [ 0.368744] kthread+0x118/0x11c [ 0.368748] ret_from_fork+0x10/0x20 [ 0.368753] SMP: stopping secondary CPUs [ 0.368760] Kernel Offset: disabled [ 0.368761] CPU features: 0x0,00000060,d0080000,0200421b [ 0.368765] Memory Limit: none [ 0.400328] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]-----
2.44.0
Hi Lucas,
Thanks for your reply.
Quoted 11 lines · Lucas Tanure
[ EXTERNAL EMAIL ]
Quoted 5 lines · Xianwei Zhao
Hi Lucas,
As we are preparing the T7 clock patchset, we would like to your
purpose and plan of this RFC patches. Are you going to submit these patches at last?Hi Xianwei,
Quoted 9 lines
I made some progress, and now the SD card controller probes but fails to read blocks from the SD card. I do think my port of the clock driver is okay, but I will not send my clock driver until the SD card fully works, so I am sure the clocking driver is tested. But if you have something already done, please send it, and I will test and review it from my side.
Any help with the sdcard controller is also much appreciated.
The SDCard part works well on our clock patchset. Then we will send the formal clock submission later. What do you think?
Quoted 375 lines
Thanks
LucasQuoted 372 lines · Lucas Tanure
Quoted 371 lines
[ EXTERNAL EMAIL ]
I am trying to port the T7 clock driver from Khadas 5.4 kernel for Vim4 to mainline, but I am encountering some issues in the path.
The kernel panics at
clk_mux_val_to_index, but I believe that all the needed clocks are registered.If anyone from Amlogic or the community could help me understand what my driver is missing, that would be great.
I will continue to try to figure out, but it has been some weeks without progress =/.Lucas Tanure (2):
clk: meson: T7: add support for Amlogic T7 SoC PLL clock driver
arm64: dts: amlogic: t7: SDCard, Ethernet and Clocking.../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 66 + arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 189 + drivers/clk/meson/Kconfig | 25 + drivers/clk/meson/Makefile | 2 + drivers/clk/meson/t7-peripherals.c | 6368 +++++++++++++++++ drivers/clk/meson/t7-peripherals.h | 131 + drivers/clk/meson/t7-pll.c | 1543 ++++ drivers/clk/meson/t7-pll.h | 83 + .../clock/amlogic,t7-peripherals-clkc.h | 410 ++ .../dt-bindings/clock/amlogic,t7-pll-clkc.h | 69 + 10 files changed, 8886 insertions(+)create mode 100644
drivers/clk/meson/t7-peripherals.c
create mode 100644drivers/clk/meson/t7-peripherals.h
create mode 100644drivers/clk/meson/t7-pll.c
create mode 100644drivers/clk/meson/t7-pll.h
create mode 100644include/dt-bindings/clock/amlogic,t7-peripherals-clkc.hcreate mode 100644include/dt-bindings/clock/amlogic,t7-pll-clkc.hStarting kernel ...
uboot time: 14277917 us
boot 64bit kernel[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd092] [ 0.000000] Linux version 6.8.0-09793-gda876e5b54b3-dirty (tanureal@ryzen) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621, GNU ld (GNU Toolchain for the A-pr4 [ 0.000000] KASLR disabled due to lack of seed [ 0.000000] Machine model: Khadas vim4 [ 0.000000] efi: UEFI not found. [ 0.000000] OF: reserved mem: 0x0000000005000000..0x00000000052fffff (3072 KiB) nomap non-reusable secmon@5000000 [ 0.000000] OF: reserved mem: 0x0000000005300000..0x00000000072fffff (32768 KiB) nomap non-reusable secmon@5300000 [ 0.000000] NUMA: No NUMA configuration found [ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] NUMA: NODE_DATA [mem 0xdf10c9c0-0xdf10efff] [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000004ffffff] [ 0.000000] node 0: [mem 0x0000000005000000-0x00000000072fffff] [ 0.000000] node 0: [mem 0x0000000007300000-0x00000000df7fffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000000df7fffff] [ 0.000000] On node 0, zone DMA: 2048 pages in unavailable ranges [ 0.000000] cma: Reserved 32 MiB at 0x00000000d9800000 on node -1 [ 0.000000] psci: probing for conduit method from DT. [ 0.000000] psci: PSCIv1.0 detected in firmware. [ 0.000000] psci: Using standard PSCI v0.2 function IDs [ 0.000000] psci: Trusted OS migration not required [ 0.000000] psci: SMC Calling Convention v1.1 [ 0.000000] percpu: Embedded 24 pages/cpu s58152 r8192 d31960 u98304 [ 0.000000] Detected VIPT I-cache on CPU0 [ 0.000000] CPU features: detected: Spectre-v2 [ 0.000000] CPU features: detected: Spectre-v4 [ 0.000000] CPU features: detected: Spectre-BHB [ 0.000000] CPU features: detected: ARM erratum 858921 [ 0.000000] alternatives: applying boot alternatives [ 0.000000] Kernel command line: root=UUID=a91e7bfe-4263-4e53-867d-7824e7c6a992 rw rootfstype=ext4 console=ttyS0,921600 no_console_suspend earlycon=ttyS0,0xfe078000 khadas_board=VIM4 androidboot.selinux=permissive androidboot.0 [ 0.000000] Unknown kernel command line parameters "khadas_board=VIM4", will be passed to user space. [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear) [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Fallback order for Node 0: 0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 901152 [ 0.000000] Policy zone: DMA [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] software IO TLB: SWIOTLB bounce buffer size adjusted to 3MB [ 0.000000] software IO TLB: area num 8. [ 0.000000] software IO TLB: SWIOTLB bounce buffer size roundup to 4MB [ 0.000000] software IO TLB: mapped [mem 0x00000000d8e00000-0x00000000d9200000] (4MB) [ 0.000000] Memory: 3445944K/3661824K available (16896K kernel code, 4426K rwdata, 9184K rodata, 9728K init, 611K bss, 183112K reserved, 32768K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=8. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] Tracing variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8 [ 0.000000] RCU Tasks: Setting shift to 3 and lim to 1 rcu_task_cb_adjust=1. [ 0.000000] RCU Tasks Trace: Setting shift to 3 and lim to 1 rcu_task_cb_adjust=1. [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set [ 0.000000] Root IRQ handler: gic_handle_irq [ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention. [ 0.000000] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.000000] arch_timer: CPU0: Trapping CNTVCT access [ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns [ 0.000000] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns [ 0.000210] Console: colour dummy device 80x25 [ 0.000253] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000) [ 0.000261] pid_max: default: 32768 minimum: 301 [ 0.000300] LSM: initializing lsm=capability [ 0.000358] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000371] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000920] cacheinfo: Unable to detect cache hierarchy for CPU 0 [ 0.001389] rcu: Hierarchical SRCU implementation. [ 0.001391] rcu: Max phase no-delay instances is 1000. [ 0.001834] EFI services will not be available. [ 0.001999] smp: Bringing up secondary CPUs ... [ 0.002408] CPU features: detected: ARM erratum 845719 [ 0.002426] Detected VIPT I-cache on CPU1 [ 0.002516] CPU1: Booted secondary processor 0x0000000100 [0x410fd034] [ 0.003007] Detected VIPT I-cache on CPU2 [ 0.003054] CPU2: Booted secondary processor 0x0000000101 [0x410fd034] [ 0.003497] Detected VIPT I-cache on CPU3 [ 0.003546] CPU3: Booted secondary processor 0x0000000102 [0x410fd034] [ 0.003988] Detected VIPT I-cache on CPU4 [ 0.004038] CPU4: Booted secondary processor 0x0000000103 [0x410fd034] [ 0.004472] Detected VIPT I-cache on CPU5 [ 0.004509] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.004519] arch_timer: CPU5: Trapping CNTVCT access [ 0.004527] CPU5: Booted secondary processor 0x0000000001 [0x410fd092] [ 0.004915] Detected VIPT I-cache on CPU6 [ 0.004940] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.004946] arch_timer: CPU6: Trapping CNTVCT access [ 0.004951] CPU6: Booted secondary processor 0x0000000002 [0x410fd092] [ 0.005333] Detected VIPT I-cache on CPU7 [ 0.005358] arch_timer: Enabling local workaround for ARM erratum 858921 [ 0.005364] arch_timer: CPU7: Trapping CNTVCT access [ 0.005369] CPU7: Booted secondary processor 0x0000000003 [0x410fd092] [ 0.005414] smp: Brought up 1 node, 8 CPUs [ 0.005419] SMP: Total of 8 processors activated. [ 0.005421] CPU: All CPU(s) started at EL2 [ 0.005434] CPU features: detected: 32-bit EL0 Support [ 0.005437] CPU features: detected: 32-bit EL1 Support [ 0.005440] CPU features: detected: CRC32 instructions [ 0.005485] alternatives: applying system-wide alternatives [ 0.006730] devtmpfs: initialized [ 0.008534] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.008545] futex hash table entries: 2048 (order: 5, 131072 bytes, linear) [ 0.008989] pinctrl core: initialized pinctrl subsystem [ 0.009581] DMI not present or invalid. [ 0.011290] NET: Registered PF_NETLINK/PF_ROUTE protocol family [ 0.011944] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations [ 0.012293] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.012711] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.012832] audit: initializing netlink subsys (disabled) [ 0.013075] audit: type=2000 audit(0.012:1): state=initialized audit_enabled=0 res=1 [ 0.013508] thermal_sys: Registered thermal governor 'step_wise' [ 0.013512] thermal_sys: Registered thermal governor 'power_allocator' [ 0.013557] cpuidle: using governor menu [ 0.013675] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. [ 0.013784] ASID allocator initialised with 65536 entries [ 0.014630] Serial: AMBA PL011 UART driver [ 0.017553] Modules: 22496 pages in range for non-PLT usage [ 0.017556] Modules: 514016 pages in range for PLT usage [ 0.017980] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages [ 0.017984] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page [ 0.017988] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages [ 0.017990] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page [ 0.017993] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages [ 0.017995] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page [ 0.017997] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages [ 0.018000] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page [ 0.018247] Demotion targets for Node 0: null [ 0.018884] ACPI: Interpreter disabled. [ 0.019584] iommu: Default domain type: Translated [ 0.019587] iommu: DMA domain TLB invalidation policy: strict mode [ 0.019979] SCSI subsystem initialized [ 0.020174] usbcore: registered new interface driver usbfs [ 0.020187] usbcore: registered new interface driver hub [ 0.020200] usbcore: registered new device driver usb [ 0.020434] pps_core: LinuxPPS API ver. 1 registered [ 0.020437] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]> [ 0.020443] PTP clock support registered [ 0.020487] EDAC MC: Ver: 3.0.0 [ 0.020717] scmi_core: SCMI protocol bus registered [ 0.021039] FPGA manager framework [ 0.021076] Advanced Linux Sound Architecture Driver Initialized. [ 0.021612] vgaarb: loaded [ 0.021857] clocksource: Switched to clocksource arch_sys_counter [ 0.021967] VFS: Disk quotas dquot_6.6.0 [ 0.021984] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) [ 0.022062] pnp: PnP ACPI: disabled [ 0.026651] NET: Registered PF_INET protocol family [ 0.026781] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear) [ 0.028598] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear) [ 0.028615] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) [ 0.028622] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 0.028750] TCP bind hash table entries: 32768 (order: 8, 1048576 bytes, linear) [ 0.029019] TCP: Hash tables configured (established 32768 bind 32768) [ 0.029096] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.029124] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.029225] NET: Registered PF_UNIX/PF_LOCAL protocol family [ 0.029506] RPC: Registered named UNIX socket transport module. [ 0.029510] RPC: Registered udp transport module. [ 0.029512] RPC: Registered tcp transport module. [ 0.029513] RPC: Registered tcp-with-tls transport module. [ 0.029515] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.029524] PCI: CLS 0 bytes, default 64 [ 0.029649] Unpacking initramfs... [ 0.033933] kvm [1]: IPA Size Limit: 40 bits [ 0.034713] kvm [1]: Hyp mode initialized successfully [ 0.035476] Initialise system trusted keyrings [ 0.035582] workingset: timestamp_bits=42 max_order=20 bucket_order=0 [ 0.035747] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.035906] NFS: Registering the id_resolver key type [ 0.035919] Key type id_resolver registered [ 0.035922] Key type id_legacy registered [ 0.035933] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 0.035935] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering... [ 0.036031] 9p: Installing v9fs 9p2000 file system support [ 0.062587] Key type asymmetric registered [ 0.062596] Asymmetric key parser 'x509' registered [ 0.062657] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245) [ 0.062661] io scheduler mq-deadline registered [ 0.062664] io scheduler kyber registered [ 0.062688] io scheduler bfq registered [ 0.063318] irq_meson_gpio: 157 to 12 gpio interrupt mux initialized [ 0.068061] EINJ: ACPI disabled. [ 0.072570] amlogic_t7_pll_probe [ 0.072855] amlogic_t7_pll_probe ret 0 [ 0.072943] amlogic_a1_periphs_probe [ 0.078155] amlogic_a1_periphs_probe ret 0 [ 0.084876] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 0.086691] fe078000.serial: ttyS0 at MMIO 0xfe078000 (irq = 14, base_baud = 1500000) is a meson_uart [ 0.086710] printk: legacy console [ttyS0] enabled [ 0.229167] sysfs: cannot create duplicate filename '/class/tty/ttyS0' [ 0.229669] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.230684] Hardware name: Khadas vim4 (DT) [ 0.231205] Call trace: [ 0.231509] dump_backtrace+0x94/0xec [ 0.231963] show_stack+0x18/0x24 [ 0.232374] dump_stack_lvl+0x78/0x90 [ 0.232829] dump_stack+0x18/0x24 [ 0.233241] sysfs_warn_dup+0x64/0x80 [ 0.233696] sysfs_do_create_link_sd+0xf0/0xf8 [ 0.234248] sysfs_create_link+0x20/0x40 [ 0.234736] device_add+0x27c/0x77c [ 0.235169] device_register+0x20/0x30 [ 0.235635] tty_register_device_attr+0xfc/0x240 [ 0.236209] tty_port_register_device_attr_serdev+0x8c/0xac [ 0.236902] serial_core_register_port+0x318/0x658 [ 0.237498] serial_ctrl_register_port+0x10/0x1c [ 0.238072] uart_add_one_port+0x10/0x1c [ 0.238560] meson_uart_probe+0x2c0/0x3b4 [ 0.239058] platform_probe+0x68/0xd8 [ 0.239513] really_probe+0x148/0x2b4 [ 0.239968] __driver_probe_device+0x78/0x12c [ 0.240510] driver_probe_device+0xdc/0x160 [ 0.241030] __driver_attach+0x94/0x19c [ 0.241507] bus_for_each_dev+0x74/0xd4 [ 0.241983] driver_attach+0x24/0x30 [ 0.242428] bus_add_driver+0xe4/0x1e8 [ 0.242893] driver_register+0x60/0x128 [ 0.243370] __platform_driver_register+0x28/0x34 [ 0.243955] meson_uart_platform_driver_init+0x1c/0x28 [ 0.244594] do_one_initcall+0x6c/0x1b0 [ 0.245071] kernel_init_freeable+0x1cc/0x294 [ 0.245613] kernel_init+0x20/0x1dc [ 0.246046] ret_from_fork+0x10/0x20 [ 0.246555] meson_uart fe078000.serial: Cannot register tty device on line 0 [ 0.247729] msm_serial: driver initialized [ 0.248150] SuperH (H)SCI(F) driver initialized [ 0.248544] STM32 USART driver initialized [ 0.263927] loop: module loaded [ 0.264952] megasas: 07.727.03.00-rc1 [ 0.271065] tun: Universal TUN/TAP device driver, 1.6 [ 0.271824] thunder_xcv, ver 1.0 [ 0.271878] thunder_bgx, ver 1.0 [ 0.271956] nicpf, ver 1.0 [ 0.273230] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version [ 0.273437] hns3: Copyright (c) 2017 Huawei Corporation. [ 0.274148] hclge is initializing [ 0.274541] e1000: Intel(R) PRO/1000 Network Driver [ 0.275116] e1000: Copyright (c) 1999-2006 Intel Corporation. [ 0.275860] e1000e: Intel(R) PRO/1000 Network Driver [ 0.276449] e1000e: Copyright(c) 1999 - 2015 Intel Corporation. [ 0.277209] igb: Intel(R) Gigabit Ethernet Network Driver [ 0.277867] igb: Copyright (c) 2007-2014 Intel Corporation. [ 0.278576] igbvf: Intel(R) Gigabit Virtual Function Network Driver [ 0.279330] igbvf: Copyright (c) 2009 - 2012 Intel Corporation. [ 0.280319] sky2: driver version 1.30 [ 0.281597] VFIO - User Level meta-driver version: 0.3 [ 0.283859] usbcore: registered new interface driver usb-storage [ 0.286328] i2c_dev: i2c /dev entries driver [ 0.292404] sdhci: Secure Digital Host Controller Interface driver [ 0.292481] sdhci: Copyright(c) Pierre Ossman [ 0.293577] Synopsys Designware Multimedia Card Interface Driver [ 0.294572] sdhci-pltfm: SDHCI platform and OF driver helper [ 0.296259] ledtrig-cpu: registered to indicate activity on CPUs [ 0.298966] meson-sm: secure-monitor enabled [ 0.299963] usbcore: registered new interface driver usbhid [ 0.299997] usbhid: USB HID core driver [ 0.306803] NET: Registered PF_PACKET protocol family [ 0.306919] 9pnet: Installing 9P2000 support [ 0.307331] Key type dns_resolver registered [ 0.318926] Timer migration: 1 hierarchy levels; 8 children per group; 1 crossnode level [ 0.319462] registered taskstats version 1 [ 0.319968] Loading compiled-in X.509 certificates [ 0.362771] clk: Disabling unused clocks [ 0.363100] PM: genpd: Disabling unused power domains [ 0.363383] ALSA device list: [ 0.363580] No soundcards found. [ 0.368194] meson-gx-mmc fe08a000.sd: Got CD GPIO [ 0.368524] SError Interrupt on CPU6, code 0x00000000bf000002 -- SError [ 0.368531] CPU: 6 PID: 87 Comm: kworker/u32:3 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.368537] Hardware name: Khadas vim4 (DT) [ 0.368540] Workqueue: async async_run_entry_fn [ 0.368552] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.368556] pc : clk_mux_val_to_index+0x0/0xc0 [ 0.368565] lr : clk_mux_get_parent+0x4c/0x84 [ 0.368571] sp : ffff800082efba10 [ 0.368572] x29: ffff800082efba10 x28: ffff8000823279c0 x27: ffff800082327000 [ 0.368578] x26: ffff000004c361c0 x25: 0000000000000000 x24: 0000000000000002 [ 0.368584] x23: ffff000003f1d300 x22: ffff000003f1d2a0 x21: ffff000004c37280 [ 0.368589] x20: ffff000004c36ec0 x19: ffff000004bba800 x18: 0000000000000020 [ 0.368594] x17: ffff000000022000 x16: 0000000000000003 x15: ffffffffffffffff [ 0.368599] x14: ffffffffffffffff x13: 0078756d2364732e x12: 3030306138306566 [ 0.368604] x11: 7f7f7f7f7f7f7f7f x10: ffff7fff83438910 x9 : 0000000000000005 [ 0.368609] x8 : 0101010101010101 x7 : 0000000000000000 x6 : 05114367045e5359 [ 0.368613] x5 : 0000000000000006 x4 : 0000000000000000 x3 : 0000000000000000 [ 0.368618] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000004c36ec0 [ 0.368624] Kernel panic - not syncing: Asynchronous SError Interrupt [ 0.368626] CPU: 6 PID: 87 Comm: kworker/u32:3 Not tainted 6.8.0-09793-gda876e5b54b3-dirty #15 [ 0.368630] Hardware name: Khadas vim4 (DT) [ 0.368631] Workqueue: async async_run_entry_fn [ 0.368635] Call trace: [ 0.368637] dump_backtrace+0x94/0xec [ 0.368644] show_stack+0x18/0x24 [ 0.368649] dump_stack_lvl+0x38/0x90 [ 0.368656] dump_stack+0x18/0x24 [ 0.368661] panic+0x388/0x3c8 [ 0.368666] nmi_panic+0x48/0x94 [ 0.368670] arm64_serror_panic+0x6c/0x78 [ 0.368674] do_serror+0x3c/0x78 [ 0.368677] el1h_64_error_handler+0x30/0x48 [ 0.368681] el1h_64_error+0x64/0x68 [ 0.368684] clk_mux_val_to_index+0x0/0xc0 [ 0.368689] __clk_register+0x440/0x82c [ 0.368693] devm_clk_register+0x5c/0xbc [ 0.368697] meson_mmc_clk_init+0x11c/0x2a8 [ 0.368702] meson_mmc_probe+0x18c/0x3c0 [ 0.368705] platform_probe+0x68/0xd8 [ 0.368711] really_probe+0x148/0x2b4 [ 0.368714] __driver_probe_device+0x78/0x12c [ 0.368718] driver_probe_device+0xdc/0x160 [ 0.368721] __device_attach_driver+0xb8/0x134 [ 0.368724] bus_for_each_drv+0x84/0xe0 [ 0.368727] __device_attach_async_helper+0xac/0xd0 [ 0.368730] async_run_entry_fn+0x34/0xe0 [ 0.368734] process_one_work+0x150/0x294 [ 0.368740] worker_thread+0x304/0x408 [ 0.368744] kthread+0x118/0x11c [ 0.368748] ret_from_fork+0x10/0x20 [ 0.368753] SMP: stopping secondary CPUs [ 0.368760] Kernel Offset: disabled [ 0.368761] CPU features: 0x0,00000060,d0080000,0200421b [ 0.368765] Memory Limit: none [ 0.400328] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]-----
2.44.0