Skip to content

Conversation

marcone
Copy link

@marcone marcone commented Aug 21, 2022

I noticed a recent network related update to the 4C+ dts in the 5.10.y branch, however with that change I still didn't get working ethernet or wifi. This set of patches remedies that. I've split them into 5 separate changes that:

  • fix ethernet
  • enable wifi
  • add entries for both leds in /sys/class/leds
  • enable NVME
  • enable USB3 OTG

Rock Pi 4C+ is advertised as having one USB3 OTG port, so make it so.

Signed-off-by: Marco Nelissen <[email protected]>
@RadxaNaoki
Copy link

I noticed a recent network related update to the 4C+ dts in the 5.10.y branch, however with that change I still didn't get working ethernet or wifi. This set of patches remedies that. I've split them into 5 separate changes that:

  • fix ethernet
  • enable wifi
  • add entries for both leds in /sys/class/leds
  • enable NVME
  • enable USB3 OTG

thanks for updates.
about LEDs, please refer #20

@jack-ma
Copy link
Member

jack-ma commented Aug 22, 2022

arm64: dts: rockchip: enable Rock Pi 4C+ OTG
Rock Pi 4C+ is advertised as having one USB3 OTG port, so make it so.

4C+ doesn't have hw switch for the USB OTG, we must set the USB OTG as HOST by default, when the user want to use DEVICE function, he should configure it via dtbo from the OS.

@marcone
Copy link
Author

marcone commented Aug 22, 2022

configure it via dtbo from the OS

In the stable 4.4 branch and in the 4.4-based images that Radxa provides, OTG is configured by default in the main dtb, not in an overlay.

@jack-ma
Copy link
Member

jack-ma commented Aug 24, 2022

I believe @RadxaStephen should fix stable 4.4 branch as well. Without hardware switch, the port can not be called OTG, either HOST or DEVICE.

@marcone
Copy link
Author

marcone commented Aug 24, 2022

Either way seems fine, though changing the behavior now might affect upgrading users that rely on the existing behavior. For that reason it seems perhaps better to have "1 OTG + 1 host" be the default, and provide an overlay to make it 2 host ports.

@jack-ma
Copy link
Member

jack-ma commented Aug 25, 2022

This is how stable 4.4 branch do right now, an overlay to make HOST default.

@RadxaNaoki
Copy link

RK3399-T doesn't support PCIe. is NVMe working on your 4C+?

@marcone
Copy link
Author

marcone commented Aug 25, 2022

RK3399-T doesn't support PCIe. is NVMe working on your 4C+?

NVME works for me if I apply the corresponding change from this PR.

@jack-ma
Copy link
Member

jack-ma commented Aug 30, 2022

I think we can just leave the PCIe enabled. Some 4C+ v1.2 there on the market has M.2 because we tested it's working and the later 4C+ v1.4 removed because of no Rockchip official statement.

@marcone
Copy link
Author

marcone commented Aug 30, 2022

I think we can just leave the PCIe enabled. Some 4C+ v1.2 there on the market has M.2 because we tested it's working and the later 4C+ v1.4 removed because of no Rockchip official statement.

Do you mean current 4C+ boards don't have the M.2 slot on the board?

@jack-ma
Copy link
Member

jack-ma commented Aug 31, 2022

4C+ v1.2 has M.2 connector, 4C+ v1.4 and later doesn't have M.2 connector.

@carlfarrington
Copy link

carlfarrington commented Oct 4, 2022

For me, this works perfect with 5.19.10. Thanks @marcone. Without your version, very little worked.

I just had to add

&gpu {
	mali-supply = <&vdd_gpu>;
	status = "okay";
};

..for panfrost, which is working great BTW. sway and phoc (wayland) work fast and smooth.

and

&tsadc {
	status = "okay";
	rockchip,hw-tshut-mode = <1>;
	rockchip,hw-tshut-polarity = <1>;
};

..for temperature sensors

I did change the usbotg back to host though. I just want all 4 USB ports to work for peripherals.

@carlfarrington
Copy link

One last thing

I needed to change <&hdmi> and add in <&i2c3> in order for HDMI DDC to work properly with HDMI to DVI adapter.

&hdmi {
	ddc-i2c-bus = <&i2c3>;
	pinctrl-names = "default";
	pinctrl-0 = <&hdmi_cec>;
	status = "okay";
};

&i2c3 {
	i2c-scl-rising-time-ns = <450>;
	i2c-scl-falling-time-ns = <15>;
	status = "okay";
};

My notes from testing:
Seems like HDMI not working again. Seems to only be a problem on cold boot.
Works ok with direct HDMI cable. Not OK with HDMI to DVI adapter cable
Sometimes there's no framebuffer console
Sometimes there is framebuffer console, but then phoc starts in a weird resolution, doesn't seem to be able to identify monitor DDC data.
Testing <&hdmi> and <&i2c3> from rock-pi-4.dtsi instead:
works properly

@floion
Copy link

floion commented Feb 2, 2023

Hi @jack-ma @RadxaNaoki @RadxaStephen @RadxaYuntian can I ask you what is the state of this PR?

@RadxaYuntian
Copy link
Member

This branch is no longer in use, as we now provide 5.10 kernel based on Rockchip linux-5.10-gen-rkr3.4 release.

@marcone
Copy link
Author

marcone commented Feb 3, 2023

@floion you might want to check out Armbian, which supports the 4C+ now and uses newer kernels.

@RadxaYuntian
Copy link
Member

I'll close this for now, unless @floion has some dependency with our linux-5.10.y branch, and wants this merged.

@marcone , we have a mainline Linux based profile in our bsp tool, and our goal is to have @RadxaNaoki submit them to upstream. You are more than welcome to submit PR over there if some features is still broken.

@floion
Copy link

floion commented Feb 7, 2023

@RadxaYuntian so you have kernel 5.10 for the 4C / 4C+ on which branch of this bsp layer?

@floion
Copy link

floion commented Feb 7, 2023

thanks @marcone , we need to use this yocto bsp layer though

@RadxaYuntian
Copy link
Member

We are currently supporting ROCK 4 series on linux-5.10-gen-rkr3.4 kernel branch. If you are asking about Yocto @RadxaStephen can answer that.

@floion
Copy link

floion commented Feb 14, 2023

Yes, I was asking about Yocto support for it. @RadxaStephen any insight?

RadxaStephen pushed a commit that referenced this pull request Aug 3, 2024
commit 2a4a62a upstream.

syscall_stub_data() expects the data_count parameter to be the number of
longs, not bytes.

 ==================================================================
 BUG: KASAN: stack-out-of-bounds in syscall_stub_data+0x70/0xe0
 Read of size 128 at addr 000000006411f6f0 by task swapper/1

 CPU: 0 PID: 1 Comm: swapper Not tainted 5.18.0+ #18
 Call Trace:
  show_stack.cold+0x166/0x2a7
  __dump_stack+0x3a/0x43
  dump_stack_lvl+0x1f/0x27
  print_report.cold+0xdb/0xf81
  kasan_report+0x119/0x1f0
  kasan_check_range+0x3a3/0x440
  memcpy+0x52/0x140
  syscall_stub_data+0x70/0xe0
  write_ldt_entry+0xac/0x190
  init_new_ldt+0x515/0x960
  init_new_context+0x2c4/0x4d0
  mm_init.constprop.0+0x5ed/0x760
  mm_alloc+0x118/0x170
  0x60033f48
  do_one_initcall+0x1d7/0x860
  0x60003e7b
  kernel_init+0x6e/0x3d4
  new_thread_handler+0x1e7/0x2c0

 The buggy address belongs to stack of task swapper/1
  and is located at offset 64 in frame:
  init_new_ldt+0x0/0x960

 This frame has 2 objects:
  [32, 40) 'addr'
  [64, 80) 'desc'
 ==================================================================

Fixes: 858259c ("uml: maintain own LDT entries")
Signed-off-by: Vincent Whitchurch <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants