Go to file
Koen Vandeputte 202c3ceb13 cns3xxx: fix writing to wrong PCI registers
Originally, cns3xxx used it's own functions for mapping, reading and writing registers.

Upstream commit 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors")
removed the internal PCI config write function in favor of the generic one:

cns3xxx_pci_write_config() --> pci_generic_config_write()

cns3xxx_pci_write_config() expected aligned addresses, being produced by cns3xxx_pci_map_bus()
while the generic one pci_generic_config_write() actually expects the real address
as both the function and hardware are capable of byte-aligned writes.

This currently leads to pci_generic_config_write() writing
to the wrong registers on some ocasions.

First issue seen due to this:

- driver ath9k gets loaded
- The driver wants to write value 0xA8 to register PCI_LATENCY_TIMER, located at 0x0D
- cns3xxx_pci_map_bus() aligns the address to 0x0C
- pci_generic_config_write() effectively writes 0xA8 into register 0x0C (CACHE_LINE_SIZE)

This seems to cause some slight instability when certain PCI devices are used.

Another issue example caused by this this is the PCI bus numbering,
where the primary bus is higher than the secondary, which is impossible.

Before:

00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0, IRQ 255
    Bus: primary=02, secondary=01, subordinate=ff, sec-latency=0

After fix:

00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0, IRQ 255
    Bus: primary=00, secondary=01, subordinate=02, sec-latency=0

And very likely some more ..

Fix all by omitting the alignment being done in the mapping function.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-12-18 15:14:39 +01:00
.github Add Issue submission template (redirect to bugs.lede-project.org) 2016-09-01 09:01:04 -04:00
config config: make CONFIG_ALL_* select other CONIFG_ALL_* options 2017-12-13 16:29:22 +01:00
include kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
package rpcd: update to latest Git head 2018-12-12 16:53:18 +01:00
scripts scripts: bundle-libraries: fix logic flaw 2018-08-30 13:11:42 +02:00
target cns3xxx: fix writing to wrong PCI registers 2018-12-18 15:14:39 +01:00
toolchain gcc: gcc 6.3.0 fix comparison between pointer and integer 2018-04-27 08:54:15 +02:00
tools tools/e2fsprogs: update to 1.44.1 2018-08-21 20:42:54 +02:00
.gitattributes add .gitattributes to prevent the git autocrlf option from messing with CRLF/LF in files 2012-05-08 13:30:49 +00:00
.gitignore gitignore: add /overlay 2017-01-15 18:16:29 +01:00
BSDmakefile add missing copyright header 2007-02-26 01:05:09 +00:00
Config.in branding: add LEDE branding 2016-03-24 22:40:13 +01:00
LICENSE finally move buildroot-ng to trunk 2016-03-20 17:29:15 +01:00
Makefile Makefile: ensure that BIN_DIR exists for diffconfig 2017-01-08 18:50:00 +01:00
README README: Update project README 2016-05-12 03:29:36 +02:00
feeds.conf.default LEDE v17.01.6: revert to branch defaults 2018-09-02 15:16:13 +02:00
rules.mk rules.mk: fix syntax error 2018-11-29 12:35:16 +01:00

README

This is the buildsystem for the LEDE Linux distribution.

Please use "make menuconfig" to choose your preferred
configuration for the toolchain and firmware.

You need to have installed gcc, binutils, bzip2, flex, python, perl, make,
find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers.

Run "./scripts/feeds update -a" to get all the latest package definitions
defined in feeds.conf / feeds.conf.default respectively
and "./scripts/feeds install -a" to install symlinks of all of them into
package/feeds/.

Use "make menuconfig" to configure your image.

Simply running "make" will build your firmware.
It will download all sources, build the cross-compile toolchain, 
the kernel and all choosen applications.

To build your own firmware you need to have access to a Linux, BSD or MacOSX system
(case-sensitive filesystem required). Cygwin will not be supported because of
the lack of case sensitiveness in the file system.


Sunshine!
	Your LEDE Community
	http://www.lede-project.org