Page MenuHomeFreeBSD

FDT support for RTL8366 on etherswitch framework
AbandonedPublic

Authored by yamori813_yahoo.co.jp on Oct 13 2017, 12:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 23, 11:47 PM
Unknown Object (File)
Sat, Mar 23, 10:30 PM
Unknown Object (File)
Sat, Mar 23, 8:19 PM
Unknown Object (File)
Thu, Mar 21, 12:25 PM
Unknown Object (File)
Thu, Mar 21, 10:32 AM
Unknown Object (File)
Tue, Mar 19, 6:23 AM
Unknown Object (File)
Sun, Mar 17, 6:23 AM
Unknown Object (File)
Feb 15 2024, 11:26 PM
Subscribers
None

Details

Summary

FDT away for RTL8366. Also fixed FDT support gpioiic.c.

Boot log is this.

https://gist.github.com/yamori813/bd6ccdbd73dd02eebfdd0bd6d92411d8

Test Plan

on MZK-W300NAG(RT2880 + RTL8366SR)

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 12194
Build 12492: arc lint + arc unit

Event Timeline

All is fine, one improvement is possible (gpio_pins for non-fdt case).

sys/dev/gpio/gpioiic.c
61–67 ↗(On Diff #33929)

Is it possible to make support of SCL/SDA as "struct gpio_pin" for non-FDT case as well?

This revision is now accepted and ready to land.Oct 16 2017, 12:05 PM

as far as if_rt changes and dts additions go, I am ok with this.

loos requested changes to this revision.Oct 18 2017, 5:58 PM

I don't like all the duplicate code in gpioiic.c.

Can you explain which bugs are you trying to fix ?

gpioiic seems to works fine with FDT, but if you want to use the new API, maybe you should consider something like what was done with gpioled (and its FDT counterpart).

This revision now requires changes to proceed.Oct 18 2017, 5:58 PM
In D12649#263981, @loos wrote:

I don't like all the duplicate code in gpioiic.c.

Can you explain which bugs are you trying to fix ?

gpioiic seems to works fine with FDT, but if you want to use the new API, maybe you should consider something like what was done with gpioled (and its FDT counterpart).

I think IVAR can't use on FDT. Current gpioiic.c is use IVAR. Tell me dts file on work current gpioiic.c.

Current code is crash in gpioiic_attach() at devi->pins[] access in at FDT build.

Other FDT base gpio code use simplebus or ofwbus by DRIVER_MODULE. But gpioiic not use this.

Custom dts files shouldn't be put to sys/gnu/dts. This directory is periodically synced with upstream tree, so custom changes may be hard to maintain. The right way to new .dts is to put it to boot/fdt/dts/mips. All include operators should just work

Custom dts files shouldn't be put to sys/gnu/dts. This directory is periodically synced with upstream tree, so custom changes may be hard to maintain. The right way to new .dts is to put it to boot/fdt/dts/mips. All include operators should just work

my dts file move to sys/boot/fdt/dts/mips

loos Please show me complete dts file use gpioiic.c.

sys/dev/gpio/gpioiic.c
61–67 ↗(On Diff #33929)

I seem other non-FDT gpio code use directly value. I think good that is not change this implement.

I will put separate this revision.