Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] V2021.10 nvec paz00 #1

Closed
wants to merge 21 commits into from

Conversation

kwizart
Copy link

@kwizart kwizart commented Nov 19, 2021

This is a rebase of my tree from 2021.10 nvec paz00 driver.

Known not to work is EFI boot on tegra20 (works for tegra124).
please review.

@@ -410,7 +411,7 @@ static int nvec_probe(struct udevice *dev)
{
struct nvec_t *nvec = dev_get_priv(dev);
const void *blob = gd->fdt_blob;
int node = dev->node.of_offset;
int node = dev->node_.of_offset;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be deleted (can be squashed with the later patch).

@@ -425,7 +421,7 @@ static int nvec_probe(struct udevice *dev)

debug("NVEC initialization...\n");

if (nvec_decode_fdt(blob, node, nvec_data)) {
if (nvec_decode_fdt(nvec_data) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing bracket, will fix...

@kwizart kwizart changed the title V2021.10 nvec paz00 [WIP] V2021.10 nvec paz00 Nov 19, 2021
@kwizart
Copy link
Author

kwizart commented Nov 19, 2021

It fails to build from source, I will revisit in the next days. I need to recover a known good and tested version...

@clamor-s
Copy link
Collaborator

clamor-s commented Dec 9, 2021

It fails to build from source, I will revisit in the next days. I need to recover a known good and tested version...

Sources were updated. May you rebase your PR please?

@kwizart
Copy link
Author

kwizart commented Dec 9, 2021

Sure, I hope to update this over the week-end.

@clamor-s clamor-s force-pushed the master branch 3 times, most recently from ea9b2ac to 6edacb5 Compare January 1, 2022 18:14
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
Lot of PCI and PCIe controllers are using standard Config Address for PCI
Configuration Mechanism #1 or its extended version.

So add PCI_CONF1_ADDRESS() and PCI_CONF1_EXT_ADDRESS() macros into U-Boot's
pci.h header file which can be suitable for most PCI and PCIe controller
drivers. Drivers do not have to invent their own macros and can use these
new U-Boot macros.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
PCI gt64120 driver uses standard format of Config Address for PCI
Configuration Mechanism #1.

So use new U-Boot macro PCI_CONF1_ADDRESS() and remove old custom driver
address macros.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
PCI mpc85xx driver uses extended format of Config Address for PCI
Configuration Mechanism #1.

So use new U-Boot macro PCI_CONF1_EXT_ADDRESS().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
PCI msc01 driver uses standard format of Config Address for PCI
Configuration Mechanism #1 but with cleared Enable bit.

So use new U-Boot macro PCI_CONF1_ADDRESS() with clearing PCI_CONF1_ENABLE
bit and remove old custom driver address macros.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
PCI mvebu driver uses extended format of Config Address for PCI
Configuration Mechanism #1.

So use new U-Boot macro PCI_CONF1_EXT_ADDRESS() and remove old custom
driver address macros.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
PCI tegra driver uses extended format of Config Address for PCI
Configuration Mechanism #1 but with cleared Enable bit.

So use new U-Boot macro PCI_CONF1_EXT_ADDRESS() with clearing
PCI_CONF1_ENABLE bit and remove old custom driver address function.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
PCI fsl driver uses extended format of Config Address for PCI
Configuration Mechanism #1.

So use new U-Boot macro PCI_CONF1_EXT_ADDRESS().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
PCI mediatek driver uses extended format of Config Address for PCI
Configuration Mechanism #1 but with cleared Enable bit.

So use new U-Boot macro PCI_CONF1_EXT_ADDRESS() with clearing
PCI_CONF1_ENABLE bit and remove old custom driver address macros.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
PCI sh7780 driver uses standard format of Config Address for PCI
Configuration Mechanism #1.

So use new U-Boot macro PCI_CONF1_ADDRESS().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
x86 platform uses standard format of Config Address for PCI Configuration
Mechanism #1. So use new U-Boot macro PCI_CONF1_ADDRESS().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
mcf5445x platform uses standard format of Config Address for PCI
Configuration Mechanism #1. So use new U-Boot macro PCI_CONF1_ADDRESS().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
clamor-s pushed a commit that referenced this pull request Jan 18, 2022
sh7751 platform uses standard format of Config Address for PCI
Configuration Mechanism #1.

Commit 72c2f4a ("pci: sh7751: Convert to DM and DT probing") which did
conversion of PCI sh7751 driver to DM, broke access to config space as that
commit somehow swapped device and function bits in config address.

Fix all these issues by using new U-Boot macro PCI_CONF1_ADDRESS() which
calculates Config Address correctly.

Also remove nonsense function sh7751_pci_addr_valid() which was introduced
in commit 72c2f4a ("pci: sh7751: Convert to DM and DT probing")
probably due to workarounded issues with mixing/swapping device and
function bits of config address which probably resulted in non-working
access to some devices. With correct composing of config address there
should not be such issue anymore.

Signed-off-by: Pali Rohár <pali@kernel.org>
Fixes: 72c2f4a ("pci: sh7751: Convert to DM and DT probing")
Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
digetx and others added 7 commits January 21, 2022 17:22
Add device-tree and config for Tegra20 QEMU.

Link: https://github.com/grate-driver/tegra2_qemu
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
On popular request make the display driver from T20 work on T30 as
well. Turned out to be quite straight forward. However a few notes
about some things encountered during porting: Of course the T30 device
tree was completely missing host1x as well as PWM support but it turns
out this can simply be copied from T20. The only trouble compiling the
Tegra video driver for T30 had to do with some hard-coded PWM pin
muxing for T20 which is quite ugly anyway. On T30 this gets handled by
a board specific complete pin muxing table. The older Chromium U-Boot
2011.06 which to my knowledge was the only prior attempt at enabling a
display driver for T30 for whatever reason got some clocking stuff
mixed up. Turns out at least for a single display controller T20 and
T30 can be clocked quite similar. Enjoy.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Jonas Schwöbel <jonasschwoebel@yahoo.de>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
This patch adds support for correct work with backup gpt
without excessive log spam.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Board derives from Ventana board

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Board derives from Cardhu board

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Tested-by: Antoni Aloy Torrens <aaloytorrens@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
@clamor-s
Copy link
Collaborator

Sure, I hope to update this over the week-end.

Rebase your changes please.

marvintwentyfour and others added 4 commits January 23, 2022 18:31
Adopted version of nvec driver from linux kernel with
keyboard support only.

Signed-off-by: Andrey Danin <danindrey@mail.ru>
[squashed, forward ported, and cleaned up]
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Adopted version of nvec keyboard driver from linux kernel.

Signed-off-by: Andrey Danin <danindrey@mail.ru>
[squashed, forward ported, and cleaned up]
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Andrey Danin <danindrey@mail.ru>
[squashed, forward ported, and cleaned up]
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
@kwizart kwizart force-pushed the v2021.10-nvec-paz00 branch from e8ecf7b to 3a63e25 Compare January 23, 2022 17:32
@kwizart
Copy link
Author

kwizart commented Jan 23, 2022

The nvec fork for paz00 is currently maintained at
https://gitlab.com/ac100/u-boot-ac100-exp/-/merge_requests/2
I'm seeking review from @marvintwentyfour in a first step.

I've rebased from grate until then.

@kwizart kwizart force-pushed the v2021.10-nvec-paz00 branch from 3a63e25 to ad0aff9 Compare January 23, 2022 17:35
clamor-s pushed a commit that referenced this pull request Oct 18, 2022
There are three different kinds of EEPROM possibly present on boards.
  1. 1byte address. For those we should avoid 2byte address in order
     not to rewrite the data. Second byte of the address can potentially
     be interpreted as the data to write.
  2. 2byte address with defined behaviour. When we try to use 1byte
     address they just return "FF FF FF FF ... FF"
  3. 2byte address with undefined behaviour (for instance, 24LC32AI).
     When we try to use 1byte address, then their internal read
     pointer is changed to some value. Subsequential reads may be
     broken.

To gracefully handle both case #1 and case u-boot#3 we read all required
data from EEPROM at once (about 80 bytes). So either all the data is
valid or we fallback to 2byte address.

Cc: Nishanth Menon <nm@ti.com>
Fixes: a58147c ("board: ti: common: board_detect: Do 1byte address checks first.")
Reference: https://lore.kernel.org/all/CAJs94Ebdd4foOjhGFu9Bop0v=B1US9neDLxfhgcY23ukgLzFOQ@mail.gmail.com/
Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Acked-by: Nishanth Menon <nm@ti.com>
@kwizart
Copy link
Author

kwizart commented Nov 25, 2022

Closing as I've submitted a new PR with a new base branch
#2

@kwizart kwizart closed this Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants