Page MenuHomeFreeBSD

FDT support for RTL8366 on etherswitch framework
Needs ReviewPublic

Authored by yamori813_yahoo.co.jp on Oct 13 2017, 12:48 AM.

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 OK
Unit
No Unit 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
sgalabov accepted this revision.Oct 17 2017, 9:51 AM

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

  • gpioiic is sepalate like gpioled

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.