Page MenuHomeFreeBSD

[dev/cfi] add support for flashes with different bus-vs-device address width
AcceptedPublic

Authored by mizhka on Mar 18 2016, 4:40 PM.

Details

Reviewers
ray
imp
adrian
Summary

The target of this fix is CFI-compatible Macronix MX29GL @ Asus RT-N16 wifi router. This board has 16bit parallel flash and 8bit bus. To enable query mode, we need to use bus_space_write_1 (8bit) to write to location 55x2 (16bit).

This patch adds bus width parameter and way to auto-identify it. It uses this parameter for query mode requests.

It works for me, but I don't have any other CFI devices to test it. I'll appreciate if somebody can test it.

Test Plan
  1. Apply patch, build cfi driver
  2. Try to probe&attach.

Expected result: driver has been attached.

Tested on Macronix MX29GL chip / ASUS RT-N16.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

mizhka updated this revision to Diff 14423.Mar 18 2016, 4:40 PM
mizhka retitled this revision from to [dev/cfi] only one byte should be written to enable/disable query mode.
mizhka updated this object.
mizhka edited the test plan for this revision. (Show Details)
mizhka set the repository for this revision to rS FreeBSD src repository.
ray edited edge metadata.May 27 2016, 6:55 AM

I'm afraid JEDEC CFI standard do not allow simple omit of upper byte(s), you have to try bus and chip data width and get temporary configuration, til required data read from chip.

mizhka updated this revision to Diff 17007.May 27 2016, 6:21 PM
mizhka retitled this revision from [dev/cfi] only one byte should be written to enable/disable query mode to [dev/cfi] add support for flashes with different bus-vs-device address width.
mizhka updated this object.
mizhka edited the test plan for this revision. (Show Details)
mizhka edited edge metadata.
mizhka added a subscriber: landon_landonf.org.
  • new sc_buswidth parameter to softc
  • scan of configuration for new sc_buswidth parameter

It works for me, but I don't have any other CFI devices to test it. I'll appreciate if somebody can test it.

It's still another Broadcom SoC, but I tested against a previously working WGT634U (BCM4716) and saw no regressions.

It'd be nice to get this committed so we can support RT-N16's CFI out of the box.

adrian accepted this revision.Feb 15 2017, 4:05 AM
adrian edited edge metadata.

i'm okay with this, but let's get imp's feedback.

This revision is now accepted and ready to land.Feb 15 2017, 4:05 AM

i'm okay with this, but let's get imp's feedback.

adrian added a reviewer: imp.Feb 15 2017, 4:06 AM