Skip to content

mips: bmips: improve handling of RAC and CBR addr

Christian Marangi linux-devicetree linux-mips lkml 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest4 patches 1 replyIn review
  2. v75 patches 6 repliesApplied
  3. v65 patches 0 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v54 patches7 repliesSuperseded
v44 patches3 repliesSuperseded
v34 patches3 repliesSuperseded
v25 patches7 repliesSuperseded
v16 patches18 repliesSuperseded

Changes in v8 from the cover letter

- Drop fix patch (applied to mips-fixes)
- Rework CBR cache patch to handle bcm47xx not compiling smp-bmips.c Changes v7:
- Add ACK and Reviewed-by tag for dt patch from v5 Changes v6:
- Add missing patch that got lost in v5
- Fix missing header for legacy bcm47xx
- Fix compilation error with gcc 10.2.1

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mips: bmips: rework and cache CBR addr handlingarch/mips/bcm47xx/prom.c arch/mips/bcm47xx/setup.c arch/mips/bcm63xx/prom.c +5 more+24 -40 replies
2/4dt-bindings: mips: brcm: Document brcm,bmips-cbr-reg propertyDocumentation/devicetree/bindings/mips/brcm/soc.yaml+24 -00 replies
3/4mips: bmips: setup: make CBR address configurablearch/mips/bcm47xx/setup.c arch/mips/bcm63xx/setup.c arch/mips/bmips/setup.c+38 -40 replies
4/4mips: bmips: enable RAC on BMIPS4350arch/mips/kernel/smp-bmips.c+18 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchFlorian FainelliConor DooleyRob Herring (Arm)
1/4A-b
2/4A-b A-b R-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v8 thread

Cover letter [PATCH v8 0/4] mips: bmips: improve handling of RAC and CBR addr

Hi,

this simple series improve handling of RAC and CBR address and try to upstream these simple patch we have in OpenWrt for a while.

The first patch fix a straight kernel panic where some Bootloader might enable RAC but misconfigure the CBR address. The current logic only check if RAC is enabled but doesn't verify if the CBR address is usable.

The DMA sync function cause a kernel panic for invalid write. (as CBR is 0 or something like 0xa)

The second is preparation for making the CBR address configurable in DT. Since this address doesn't change, we can cache it and reference it with a local variable instead of calling the register to access the value.

The 4th patch make it configurable with 2 DT property, one to actually set the reg and the other to force set it.

The first property is used when CBR is set to 0. The second property is to force it if the Bootloader sets it to something wrong.

If the CBR value is not 0 and is not forced with the second property a WARN is printed and the DT value is ignored.

The 4th patch enable RAC on BMIPS4350.

These has been tested on BCM6358 (HG556a) and BCM6368 (VH4032N) and reported correct functionality.

Changes v8:
- Drop fix patch (applied to mips-fixes)
- Rework CBR cache patch to handle bcm47xx not compiling smp-bmips.c Changes v7:
- Add ACK and Reviewed-by tag for dt patch from v5 Changes v6:
- Add missing patch that got lost in v5
- Fix missing header for legacy bcm47xx
- Fix compilation error with gcc 10.2.1
Changes v5:
- Add Ack tags
- Improve DT descriptions as suggested by Conor
Changes v4:
- Fix compilation error with legacy brcm target
- Improve property description in DT commit (give
CBR meaning and drop reference to linux functions)
- Use only __read_mostly as we can't add variable to multiple data sections
- In patch 4 use local cbr variable instead of global one.
Changes v3:
- Drop broken-cbr-reg property
- Fix anyOf+const with enum
Changes v2:
- Prefix brcm vendor in the added property
- Drop last patch (cpu switch from DMA sync)
- Validate CBR addr from DT to be outside DRAM
- Reduce indentation in DT CBR check
- Reduce delta and use local variable for CBR where possible
- Fix and improve typo and spelling mistake
- Use 0xf instead of 0xa for BCM6358 RAC enable

Christian Marangi (3):
mips: bmips: rework and cache CBR addr handling
dt-bindings: mips: brcm: Document brcm,bmips-cbr-reg property
mips: bmips: setup: make CBR address configurable

Daniel González Cabanelas (1):
mips: bmips: enable RAC on BMIPS4350

 .../devicetree/bindings/mips/brcm/soc.yaml    | 24 +++++++++++++
 arch/mips/bcm47xx/prom.c                      |  3 ++
 arch/mips/bcm47xx/setup.c                     |  8 +++++
 arch/mips/bcm63xx/prom.c                      |  3 ++
 arch/mips/bcm63xx/setup.c                     |  8 +++++
 arch/mips/bmips/dma.c                         |  2 +-
 arch/mips/bmips/setup.c                       | 35 +++++++++++++++++--
 arch/mips/include/asm/bmips.h                 |  1 +
 arch/mips/kernel/smp-bmips.c                  | 22 ++++++++++--
 9 files changed, 101 insertions(+), 5 deletions(-)
Signature · 1 line
2.45.1