mail.coreboot.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
List overview
Download
coreboot-gerrit
May 2017
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
coreboot-gerrit@coreboot.org
1 participants
3888 discussions
Start a n
N
ew thread
Change in coreboot[master]: pcengines/apu2: Add IVRS table generation
by Philipp Deppenwiese (Code Review)
05 May '17
05 May '17
Philipp Deppenwiese has posted comments on this change. (
https://review.coreboot.org/15165
) Change subject: pcengines/apu2: Add IVRS table generation ...................................................................... Patch Set 14: [ 0.086061] BUG: unable to handle kernel paging request at ffffa08ee9be3fff [ 0.093117] IP: [<ffffffffbb64f39d>] __iommu_queue_command_sync+0x10d/0x140 [ 0.100113] PGD 8092b067 [ 0.102567] PUD 0 [ 0.104593] [ 0.106096] Oops: 0002 [#1] SMP [ 0.109249] Modules linked in: [ 0.112389] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.0-2-amd64 #1 Debian 4.9.18-1 [ 0.120307] Hardware name: PC Engines apu2/apu2, BIOS 4.6-34-g6d164cd674 05/05/2017 [ 0.127985] task: ffffa08de9b20040 task.stack: ffffbedf00638000 [ 0.133922] RIP: 0010:[<ffffffffbb64f39d>] [<ffffffffbb64f39d>] __iommu_queue_command_sync+0x10d/0x140 [ 0.143378] RSP: 0018:ffffbedf0063bd30 EFLAGS: 00010002 [ 0.148724] RAX: ffffa08de9be4000 RBX: 00000000ffffffff RCX: 000000000000000f [ 0.155856] RDX: ffffbedf00648000 RSI: 2000000000000000 RDI: 0000000000000000 [ 0.162989] RBP: ffffbedf0063bd88 R08: 0000000000000010 R09: 0000000000000011 [ 0.170126] R10: 0000000000000170 R11: ffffa08deeff9000 R12: 0000000000000046 [ 0.177265] R13: 000000000000000f R14: ffffbedf0063bdc0 R15: ffffa08de9b28800 [ 0.184416] FS: 0000000000000000(0000) GS:ffffa08deec00000(0000) knlGS:0000000000000000 [ 0.192500] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.198268] CR2: ffffa08ee9be3fff CR3: 0000000080607000 CR4: 00000000000406f0 [ 0.205404] Stack: [ 0.207443] ffffa08deeff9cc8 00000001fffffffe 0000000000000148 00ffa08d00000012 [ 0.214955] ffffa08deeffa010 000000004c4e2dcb ffffa08de9b28814 0000000000000046 [ 0.222467] ffffbedf0063bdc0 ffffffffbbec3940 0000000000000000 ffffa08de9b28800 [ 0.229992] Call Trace: [ 0.232454] [<ffffffffbb650140>] ? iommu_queue_command_sync.constprop.32+0x30/0x50 [ 0.240134] [<ffffffffbb650660>] ? iommu_flush_dte+0x40/0x60 [ 0.245883] [<ffffffffbb654e68>] ? iommu_flush_all_caches+0x98/0x150 [ 0.252356] [<ffffffffbb3d5b57>] ? alloc_page_interleave+0x77/0x80 [ 0.258628] [<ffffffffbb3d612c>] ? alloc_pages_current+0xec/0x140 [ 0.264811] [<ffffffffbb6556c9>] ? early_enable_iommus+0x229/0x2f0 [ 0.271084] [<ffffffffbbf7de78>] ? iommu_go_to_state+0x13a/0x1187 [ 0.277291] [<ffffffffbb24c629>] ? ioapic_read_entry+0x39/0x50 [ 0.283226] [<ffffffffbbf7f143>] ? amd_iommu_enable+0xa/0x19 [ 0.289001] [<ffffffffbbf8116a>] ? irq_remapping_enable+0x17/0x2c [ 0.295185] [<ffffffffbbf4cafb>] ? enable_IR_x2apic+0x8b/0x1af [ 0.301113] [<ffffffffbbf4e7c0>] ? default_setup_apic_routing+0xd/0x63 [ 0.307758] [<ffffffffbbf4a9dc>] ? native_smp_prepare_cpus+0x258/0x2d6 [ 0.314374] [<ffffffffbbf37017>] ? kernel_init_freeable+0xa0/0x1ed [ 0.320663] [<ffffffffbb7edba0>] ? rest_init+0x80/0x80 [ 0.325897] [<ffffffffbb7edbaa>] ? kernel_init+0xa/0x100 [ 0.331301] [<ffffffffbb7fb2f5>] ? ret_from_fork+0x25/0x30 [ 0.336884] Code: 8b 7c 24 28 65 48 33 3c 25 28 00 00 00 75 40 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 49 8b 47 68 49 8b 36 89 db 49 8b 7e 08 <48> 89 34 18 48 89 7c 18 08 49 8b 47 38 44 89 a8 08 20 00 00 0f [ 0.357674] RIP [<ffffffffbb64f39d>] __iommu_queue_command_sync+0x10d/0x140 [ 0.364747] RSP <ffffbedf0063bd30> [ 0.368258] CR2: ffffa08ee9be3fff [ 0.371587] ---[ end trace f68728a0d3053b52 ]--- [ 0.376292] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 [ 0.376292] [ 0.385455] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 [ 0.385455] -- To view, visit
https://review.coreboot.org/15165
To unsubscribe, visit
https://review.coreboot.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I81b5b421098f29163d6ae98527de152c8046b1d9 Gerrit-PatchSet: 14 Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Owner: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net> Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com> Gerrit-Reviewer: Piotr Król <piotr.krol(a)3mdeb.com> Gerrit-Reviewer: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-HasComments: No
1
0
0
0
Change in coreboot[master]: nb/amd/pi/00730F01: Add initial native IVRS support
by build bot (Jenkins) (Code Review)
05 May '17
05 May '17
build bot (Jenkins) has posted comments on this change. (
https://review.coreboot.org/15164
) Change subject: nb/amd/pi/00730F01: Add initial native IVRS support ...................................................................... Patch Set 13: Build Unstable
https://qa.coreboot.org/job/coreboot-gerrit/53388/
: UNSTABLE
https://qa.coreboot.org/job/coreboot-checkpatch/9193/
: SUCCESS -- To view, visit
https://review.coreboot.org/15164
To unsubscribe, visit
https://review.coreboot.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1ae789f75363435accd14a1b556e1570f43f94c4 Gerrit-PatchSet: 13 Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Owner: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com> Gerrit-Reviewer: Martin Roth <martinroth(a)google.com> Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net> Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com> Gerrit-Reviewer: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-HasComments: No
1
0
0
0
Change in coreboot[master]: pcengines/apu2: Add IVRS table generation
by Philipp Deppenwiese (Code Review)
05 May '17
05 May '17
Philipp Deppenwiese has posted comments on this change. (
https://review.coreboot.org/15165
) Change subject: pcengines/apu2: Add IVRS table generation ...................................................................... Patch Set 14: Kernel explodes... -- To view, visit
https://review.coreboot.org/15165
To unsubscribe, visit
https://review.coreboot.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I81b5b421098f29163d6ae98527de152c8046b1d9 Gerrit-PatchSet: 14 Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Owner: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net> Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com> Gerrit-Reviewer: Piotr Król <piotr.krol(a)3mdeb.com> Gerrit-Reviewer: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-HasComments: No
1
0
0
0
Change in coreboot[master]: nb/amd/pi/00730F01: Initialize IOMMU device
by build bot (Jenkins) (Code Review)
05 May '17
05 May '17
build bot (Jenkins) has posted comments on this change. (
https://review.coreboot.org/15186
) Change subject: nb/amd/pi/00730F01: Initialize IOMMU device ...................................................................... Patch Set 7: Build Unstable
https://qa.coreboot.org/job/coreboot-gerrit/53387/
: UNSTABLE -- To view, visit
https://review.coreboot.org/15186
To unsubscribe, visit
https://review.coreboot.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I12d3ed35770ee06626f884db23004652084c88c0 Gerrit-PatchSet: 7 Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Owner: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: Dave Frodin <dave.frodin(a)se-eng.com> Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com> Gerrit-Reviewer: Martin Roth <martinroth(a)google.com> Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net> Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-HasComments: No
1
0
0
0
Change in coreboot[master]: soc/intel/apollolake: remove southbridge_clear_smi_status()
by Furquan Shaikh (Code Review)
05 May '17
05 May '17
Furquan Shaikh has posted comments on this change. (
https://review.coreboot.org/19599
) Change subject: soc/intel/apollolake: remove southbridge_clear_smi_status() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit
https://review.coreboot.org/19599
To unsubscribe, visit
https://review.coreboot.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia358c6aca93630753ac4b59b6fc86b1ea1eb9ca6 Gerrit-PatchSet: 1 Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Owner: Aaron Durbin <adurbin(a)chromium.org> Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-HasComments: No
1
0
0
0
Change in coreboot[master]: soc/intel/skylake: remove unused SMI functions
by Furquan Shaikh (Code Review)
05 May '17
05 May '17
Furquan Shaikh has posted comments on this change. (
https://review.coreboot.org/19598
) Change subject: soc/intel/skylake: remove unused SMI functions ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit
https://review.coreboot.org/19598
To unsubscribe, visit
https://review.coreboot.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I86994191a63cbf515bc330433ef7c3f79a39936e Gerrit-PatchSet: 1 Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Owner: Aaron Durbin <adurbin(a)chromium.org> Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-HasComments: No
1
0
0
0
Change in coreboot[master]: pcengines/apu2: Add IVRS table generation
by build bot (Jenkins) (Code Review)
05 May '17
05 May '17
build bot (Jenkins) has posted comments on this change. (
https://review.coreboot.org/15165
) Change subject: pcengines/apu2: Add IVRS table generation ...................................................................... Patch Set 13: Verified-1 Build Failed
https://qa.coreboot.org/job/coreboot-gerrit/53386/
: ABORTED
https://qa.coreboot.org/job/coreboot-checkpatch/9192/
: ABORTED -- To view, visit
https://review.coreboot.org/15165
To unsubscribe, visit
https://review.coreboot.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I81b5b421098f29163d6ae98527de152c8046b1d9 Gerrit-PatchSet: 13 Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Owner: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net> Gerrit-Reviewer: Piotr Król <piotr.krol(a)3mdeb.com> Gerrit-Reviewer: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-HasComments: No
1
0
0
0
Change in coreboot[master]: nb/amd/pi/00730F01: Add initial native IVRS support
by build bot (Jenkins) (Code Review)
05 May '17
05 May '17
build bot (Jenkins) has posted comments on this change. (
https://review.coreboot.org/15164
) Change subject: nb/amd/pi/00730F01: Add initial native IVRS support ...................................................................... Patch Set 12: Verified-1 Build Failed
https://qa.coreboot.org/job/coreboot-gerrit/53384/
: ABORTED
https://qa.coreboot.org/job/coreboot-checkpatch/9190/
: SUCCESS -- To view, visit
https://review.coreboot.org/15164
To unsubscribe, visit
https://review.coreboot.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1ae789f75363435accd14a1b556e1570f43f94c4 Gerrit-PatchSet: 12 Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Owner: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com> Gerrit-Reviewer: Martin Roth <martinroth(a)google.com> Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net> Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com> Gerrit-Reviewer: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-HasComments: No
1
0
0
0
Change in coreboot[master]: nb/amd/pi/00730F01: Initialize IOMMU device
by Philipp Deppenwiese (Code Review)
05 May '17
05 May '17
Hello build bot (Jenkins), I'd like you to reexamine a change. Please visit
https://review.coreboot.org/15186
to look at the new patch set (#7). Change subject: nb/amd/pi/00730F01: Initialize IOMMU device ...................................................................... nb/amd/pi/00730F01: Initialize IOMMU device Change-Id: I12d3ed35770ee06626f884db23004652084c88c0 Signed-off-by: Philipp Deppenwiese <zaolin(a)das-labor.org> --- M src/cpu/amd/pi/heapmanager.c M src/include/device/pci_ids.h M src/northbridge/amd/pi/00730F01/Makefile.inc A src/northbridge/amd/pi/00730F01/iommu.c M src/northbridge/amd/pi/agesawrapper.c 5 files changed, 66 insertions(+), 2 deletions(-) git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/15186/7 -- To view, visit
https://review.coreboot.org/15186
To unsubscribe, visit
https://review.coreboot.org/settings
Gerrit-MessageType: newpatchset Gerrit-Change-Id: I12d3ed35770ee06626f884db23004652084c88c0 Gerrit-PatchSet: 7 Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Owner: Timothy Pearson <tpearson(a)raptorengineering.com> Gerrit-Reviewer: Dave Frodin <dave.frodin(a)se-eng.com> Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com> Gerrit-Reviewer: Martin Roth <martinroth(a)google.com> Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net> Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
1
0
0
0
Change in coreboot[master]: drivers/spi: Re-factor spi_crop_chunk
by Martin Roth (Code Review)
05 May '17
05 May '17
Martin Roth has submitted this change and it was merged. (
https://review.coreboot.org/19386
) Change subject: drivers/spi: Re-factor spi_crop_chunk ...................................................................... drivers/spi: Re-factor spi_crop_chunk spi_crop_chunk is a property of the SPI controller since it depends upon the maximum transfer size that is supported by the controller. Also, it is possible to implement this within spi-generic layer by obtaining following parameters from the controller: 1. max_xfer_size: Maximum transfer size supported by the controller (Size of 0 indicates invalid size, and unlimited transfer size is indicated by UINT32_MAX.) 2. deduct_cmd_len: Whether cmd_len needs to be deducted from the max_xfer_size to determine max data size that can be transferred. (This is used by the amd boards.) Change-Id: I81c199413f879c664682088e93bfa3f91c6a46e5 Signed-off-by: Furquan Shaikh <furquan(a)chromium.org> Reviewed-on:
https://review.coreboot.org/19386
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org> Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org> Tested-by: coreboot org <coreboot.org(a)gmail.com> --- M src/drivers/spi/adesto.c M src/drivers/spi/amic.c M src/drivers/spi/atmel.c M src/drivers/spi/eon.c M src/drivers/spi/gigadevice.c M src/drivers/spi/macronix.c M src/drivers/spi/spansion.c M src/drivers/spi/spi-generic.c M src/drivers/spi/spiconsole.c M src/drivers/spi/sst.c M src/drivers/spi/stmicro.c M src/drivers/spi/winbond.c M src/include/spi-generic.h M src/soc/broadcom/cygnus/spi.c M src/soc/imgtec/pistachio/spi.c M src/soc/intel/baytrail/spi.c M src/soc/intel/braswell/spi.c M src/soc/intel/broadwell/spi.c M src/soc/intel/common/block/fast_spi/fast_spi_flash.c M src/soc/intel/common/block/gspi/gspi.c M src/soc/intel/fsp_baytrail/spi.c M src/soc/intel/fsp_broadwell_de/spi.c M src/soc/marvell/armada38x/spi.c M src/soc/marvell/bg4cd/spi.c M src/soc/mediatek/mt8173/flash_controller.c M src/soc/mediatek/mt8173/spi.c M src/soc/nvidia/tegra124/spi.c M src/soc/nvidia/tegra210/spi.c M src/soc/qualcomm/ipq40xx/spi.c M src/soc/qualcomm/ipq806x/spi.c M src/soc/rockchip/common/spi.c M src/soc/samsung/exynos5420/spi.c M src/southbridge/amd/agesa/hudson/spi.c M src/southbridge/amd/cimx/sb800/spi.c M src/southbridge/amd/sb700/spi.c M src/southbridge/intel/common/spi.c M src/southbridge/intel/fsp_rangeley/spi.c 37 files changed, 92 insertions(+), 119 deletions(-) Approvals: Aaron Durbin: Looks good to me, approved build bot (Jenkins): Verified coreboot org: Verified diff --git a/src/drivers/spi/adesto.c b/src/drivers/spi/adesto.c index d286bd6..1091d9a 100644 --- a/src/drivers/spi/adesto.c +++ b/src/drivers/spi/adesto.c @@ -97,7 +97,7 @@ for (actual = 0; actual < len; actual += chunk_len) { byte_addr = offset % page_size; chunk_len = min(len - actual, page_size - byte_addr); - chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len); + chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len); cmd[0] = CMD_AT25DF_PP; cmd[1] = (offset >> 16) & 0xff; diff --git a/src/drivers/spi/amic.c b/src/drivers/spi/amic.c index 42f7cfa..2ee5d69 100644 --- a/src/drivers/spi/amic.c +++ b/src/drivers/spi/amic.c @@ -79,7 +79,7 @@ for (actual = 0; actual < len; actual += chunk_len) { chunk_len = min(len - actual, page_size - byte_addr); - chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len); + chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len); cmd[0] = CMD_A25_PP; cmd[1] = (offset >> 16) & 0xff; diff --git a/src/drivers/spi/atmel.c b/src/drivers/spi/atmel.c index 39cc95e..4fe679d 100644 --- a/src/drivers/spi/atmel.c +++ b/src/drivers/spi/atmel.c @@ -125,7 +125,7 @@ for (actual = 0; actual < len; actual += chunk_len) { byte_addr = offset % page_size; chunk_len = min(len - actual, page_size - byte_addr); - chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len); + chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len); cmd[0] = CMD_AT25_PP; cmd[1] = (offset >> 16) & 0xff; diff --git a/src/drivers/spi/eon.c b/src/drivers/spi/eon.c index eb71c62..9c1665d 100644 --- a/src/drivers/spi/eon.c +++ b/src/drivers/spi/eon.c @@ -95,7 +95,7 @@ for (actual = 0; actual < len; actual += chunk_len) { byte_addr = offset % page_size; chunk_len = min(len - actual, page_size - byte_addr); - chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len); + chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len); ret = spi_flash_cmd(&flash->spi, CMD_EN25_WREN, NULL, 0); if (ret < 0) { diff --git a/src/drivers/spi/gigadevice.c b/src/drivers/spi/gigadevice.c index ed3d8bf..cbc9744 100644 --- a/src/drivers/spi/gigadevice.c +++ b/src/drivers/spi/gigadevice.c @@ -136,7 +136,7 @@ for (actual = 0; actual < len; actual += chunk_len) { byte_addr = offset % page_size; chunk_len = min(len - actual, page_size - byte_addr); - chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len); + chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len); ret = spi_flash_cmd(&flash->spi, CMD_GD25_WREN, NULL, 0); if (ret < 0) { diff --git a/src/drivers/spi/macronix.c b/src/drivers/spi/macronix.c index 6d143ef..07d1e56 100644 --- a/src/drivers/spi/macronix.c +++ b/src/drivers/spi/macronix.c @@ -164,7 +164,7 @@ for (actual = 0; actual < len; actual += chunk_len) { byte_addr = offset % page_size; chunk_len = min(len - actual, page_size - byte_addr); - chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len); + chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len); cmd[0] = CMD_MX25XX_PP; cmd[1] = (offset >> 16) & 0xff; diff --git a/src/drivers/spi/spansion.c b/src/drivers/spi/spansion.c index 7f57d21..139e823 100644 --- a/src/drivers/spi/spansion.c +++ b/src/drivers/spi/spansion.c @@ -217,7 +217,7 @@ for (actual = 0; actual < len; actual += chunk_len) { byte_addr = offset % page_size; chunk_len = min(len - actual, page_size - byte_addr); - chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len); + chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len); cmd[0] = CMD_S25FLXX_PP; cmd[1] = (offset >> 16) & 0xff; diff --git a/src/drivers/spi/spi-generic.c b/src/drivers/spi/spi-generic.c index 805e17a..579ceb1 100644 --- a/src/drivers/spi/spi-generic.c +++ b/src/drivers/spi/spi-generic.c @@ -88,6 +88,25 @@ return -1; } +unsigned int spi_crop_chunk(const struct spi_slave *slave, unsigned int cmd_len, + unsigned int buf_len) +{ + const struct spi_ctrlr *ctrlr = slave->ctrlr; + unsigned int ctrlr_max; + + if (!ctrlr) + return 0; + + ctrlr_max = ctrlr->max_xfer_size; + + assert (ctrlr_max != 0); + + if (ctrlr->deduct_cmd_len && (ctrlr_max > cmd_len)) + ctrlr_max -= cmd_len; + + return min(ctrlr_max, buf_len); +} + void __attribute__((weak)) spi_init(void) { /* Default weak implementation - do nothing. */ diff --git a/src/drivers/spi/spiconsole.c b/src/drivers/spi/spiconsole.c index 41846b7..ef99024 100644 --- a/src/drivers/spi/spiconsole.c +++ b/src/drivers/spi/spiconsole.c @@ -46,7 +46,7 @@ }; /* Verify the spi buffer is big enough to send even a single byte */ - if (spi_crop_chunk(0,MAX_MSG_LENGTH) < + if (spi_crop_chunk(&slave, 0, MAX_MSG_LENGTH) < sizeof(struct em100_msg_header) + 1) return; @@ -55,7 +55,7 @@ /* Send the data on newline or when the max spi length is reached */ if (c == '\n' || (sizeof(struct em100_msg_header) + - msg.header.msg_length == spi_crop_chunk(0, + msg.header.msg_length == spi_crop_chunk(&slave, 0, MAX_MSG_LENGTH))) { spi_xfer(&slave, &msg, sizeof(struct em100_msg_header) + msg.header.msg_length, NULL, 0); diff --git a/src/drivers/spi/sst.c b/src/drivers/spi/sst.c index e571454..c9762ac 100644 --- a/src/drivers/spi/sst.c +++ b/src/drivers/spi/sst.c @@ -194,7 +194,7 @@ for (actual = 0; actual < len; actual += chunk_len) { byte_addr = offset % page_size; chunk_len = min(len - actual, page_size - byte_addr); - chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len); + chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len); cmd[0] = CMD_SST_BP; cmd[1] = (offset >> 16) & 0xff; diff --git a/src/drivers/spi/stmicro.c b/src/drivers/spi/stmicro.c index 79782e4..06004f1 100644 --- a/src/drivers/spi/stmicro.c +++ b/src/drivers/spi/stmicro.c @@ -193,7 +193,7 @@ for (actual = 0; actual < len; actual += chunk_len) { byte_addr = offset % page_size; chunk_len = min(len - actual, page_size - byte_addr); - chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len); + chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len); cmd[0] = CMD_M25PXX_PP; cmd[1] = (offset >> 16) & 0xff; diff --git a/src/drivers/spi/winbond.c b/src/drivers/spi/winbond.c index d071b9f..25a7b5b 100644 --- a/src/drivers/spi/winbond.c +++ b/src/drivers/spi/winbond.c @@ -155,7 +155,7 @@ for (actual = 0; actual < len; actual += chunk_len) { byte_addr = offset % page_size; chunk_len = min(len - actual, page_size - byte_addr); - chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len); + chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len); cmd[0] = CMD_W25_PP; cmd[1] = (offset >> 16) & 0xff; diff --git a/src/include/spi-generic.h b/src/include/spi-generic.h index 7d957a0..56353bb 100644 --- a/src/include/spi-generic.h +++ b/src/include/spi-generic.h @@ -87,14 +87,27 @@ unsigned int data_bit_length; }; +/* + * If there is no limit on the maximum transfer size for the controller, + * max_xfer_size can be set to SPI_CTRLR_DEFAULT_MAX_XFER_SIZE which is equal to + * UINT32_MAX. + */ +#define SPI_CTRLR_DEFAULT_MAX_XFER_SIZE (UINT32_MAX) + /*----------------------------------------------------------------------- - * Representation of a SPI contoller. + * Representation of a SPI controller. * - * claim_bus: Claim SPI bus and prepare for communication. - * release_bus: Release SPI bus. - * setup: Setup given SPI device bus. - * xfer: Perform one SPI transfer operation. - * xfer_vector: Vector of SPI transfer operations. + * claim_bus: Claim SPI bus and prepare for communication. + * release_bus: Release SPI bus. + * setup: Setup given SPI device bus. + * xfer: Perform one SPI transfer operation. + * xfer_vector: Vector of SPI transfer operations. + * max_xfer_size: Maximum transfer size supported by the controller + * (0 = invalid, + * SPI_CTRLR_DEFAULT_MAX_XFER_SIZE = unlimited) + * deduct_cmd_len: Whether cmd_len should be deducted from max_xfer_size + * when calculating max_data_size + * */ struct spi_ctrlr { int (*claim_bus)(const struct spi_slave *slave); @@ -104,6 +117,8 @@ size_t bytesout, void *din, size_t bytesin); int (*xfer_vector)(const struct spi_slave *slave, struct spi_op vectors[], size_t count); + uint32_t max_xfer_size; + bool deduct_cmd_len; }; /*----------------------------------------------------------------------- @@ -212,7 +227,14 @@ int spi_xfer_vector(const struct spi_slave *slave, struct spi_op vectors[], size_t count); -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len); +/*----------------------------------------------------------------------- + * Given command length and length of remaining data, return the maximum data + * that can be transferred in next spi_xfer. + * + * Returns: 0 on error, non-zero data size that can be xfered on success. + */ +unsigned int spi_crop_chunk(const struct spi_slave *slave, unsigned int cmd_len, + unsigned int buf_len); /*----------------------------------------------------------------------- * Write 8 bits, then read 8 bits. diff --git a/src/soc/broadcom/cygnus/spi.c b/src/soc/broadcom/cygnus/spi.c index f03d453..fde21ba 100644 --- a/src/soc/broadcom/cygnus/spi.c +++ b/src/soc/broadcom/cygnus/spi.c @@ -280,6 +280,7 @@ .release_bus = spi_ctrlr_release_bus, .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = 65535, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) @@ -317,9 +318,4 @@ (priv->spi_mode & 3)); /* mode: CPOL / CPHA */ return 0; -} - -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(65535, buf_len); } diff --git a/src/soc/imgtec/pistachio/spi.c b/src/soc/imgtec/pistachio/spi.c index 2b706f0..30e14fa 100644 --- a/src/soc/imgtec/pistachio/spi.c +++ b/src/soc/imgtec/pistachio/spi.c @@ -538,6 +538,7 @@ .release_bus = spi_ctrlr_release_bus, .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = IMGTEC_SPI_MAX_TRANSFER_SIZE, }; /* Set up communications parameters for a SPI slave. */ @@ -584,9 +585,4 @@ img_slave->initialised = IMG_FALSE; return 0; -} - -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(IMGTEC_SPI_MAX_TRANSFER_SIZE, buf_len); } diff --git a/src/soc/intel/baytrail/spi.c b/src/soc/intel/baytrail/spi.c index 639954b..36b542f 100644 --- a/src/soc/intel/baytrail/spi.c +++ b/src/soc/intel/baytrail/spi.c @@ -19,6 +19,7 @@ #include <bootstate.h> #include <delay.h> #include <arch/io.h> +#include <commonlib/helpers.h> #include <console/console.h> #include <device/pci_ids.h> #include <spi_flash.h> @@ -457,11 +458,6 @@ return -1; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(cntlr.databytes, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin) { @@ -613,6 +609,7 @@ static const struct spi_ctrlr spi_ctrlr = { .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = member_size(ich9_spi_regs, fdata), }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/intel/braswell/spi.c b/src/soc/intel/braswell/spi.c index 5121be0..12bf7d5 100644 --- a/src/soc/intel/braswell/spi.c +++ b/src/soc/intel/braswell/spi.c @@ -16,6 +16,7 @@ /* This file is derived from the flashrom project. */ #include <arch/io.h> #include <bootstate.h> +#include <commonlib/helpers.h> #include <console/console.h> #include <delay.h> #include <device/pci_ids.h> @@ -438,11 +439,6 @@ return -1; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(cntlr.databytes, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin) { @@ -597,6 +593,7 @@ static const struct spi_ctrlr spi_ctrlr = { .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = member_size(ich9_spi_regs, fdata), }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/intel/broadwell/spi.c b/src/soc/intel/broadwell/spi.c index aaf3b85..40969bc 100644 --- a/src/soc/intel/broadwell/spi.c +++ b/src/soc/intel/broadwell/spi.c @@ -16,6 +16,7 @@ #include <stdlib.h> #include <string.h> #include <bootstate.h> +#include <commonlib/helpers.h> #include <delay.h> #include <arch/io.h> #include <console/console.h> @@ -454,11 +455,6 @@ return -1; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(cntlr.databytes, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin) { @@ -654,6 +650,7 @@ static const struct spi_ctrlr spi_ctrlr = { .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = member_size(ich9_spi_regs, fdata), }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c index 27a4bb7..d56b33f 100644 --- a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c +++ b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c @@ -364,4 +364,5 @@ const struct spi_ctrlr fast_spi_flash_ctrlr = { .setup = fast_spi_flash_ctrlr_setup, + .max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE, }; diff --git a/src/soc/intel/common/block/gspi/gspi.c b/src/soc/intel/common/block/gspi/gspi.c index 51e8ef5..8e527ed 100644 --- a/src/soc/intel/common/block/gspi/gspi.c +++ b/src/soc/intel/common/block/gspi/gspi.c @@ -611,4 +611,5 @@ .release_bus = gspi_cs_deassert, .setup = gspi_ctrlr_setup, .xfer = gspi_ctrlr_xfer, + .max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE, }; diff --git a/src/soc/intel/fsp_baytrail/spi.c b/src/soc/intel/fsp_baytrail/spi.c index 409e796..236ff74 100644 --- a/src/soc/intel/fsp_baytrail/spi.c +++ b/src/soc/intel/fsp_baytrail/spi.c @@ -18,6 +18,7 @@ #include <stdint.h> #include <stdlib.h> #include <string.h> +#include <commonlib/helpers.h> #include <delay.h> #include <arch/io.h> #include <console/console.h> @@ -438,11 +439,6 @@ return -1; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(cntlr.databytes, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin) { @@ -594,6 +590,7 @@ static const struct spi_ctrlr spi_ctrlr = { .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = member_size(ich9_spi_regs, fdata), }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/intel/fsp_broadwell_de/spi.c b/src/soc/intel/fsp_broadwell_de/spi.c index a6b6f35..01cb281 100644 --- a/src/soc/intel/fsp_broadwell_de/spi.c +++ b/src/soc/intel/fsp_broadwell_de/spi.c @@ -19,6 +19,7 @@ #include <stdlib.h> #include <string.h> #include <delay.h> +#include <commonlib/helpers.h> #include <arch/io.h> #include <console/console.h> #include <device/pci_ids.h> @@ -452,11 +453,6 @@ return -1; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(cntlr.databytes, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin) { @@ -610,6 +606,7 @@ static const struct spi_ctrlr spi_ctrlr = { .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = member_size(ich9_spi_regs, fdata), }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/marvell/armada38x/spi.c b/src/soc/marvell/armada38x/spi.c index 25480e4..47631f4 100644 --- a/src/soc/marvell/armada38x/spi.c +++ b/src/soc/marvell/armada38x/spi.c @@ -454,11 +454,6 @@ mv_spi_cs_deassert(slave->bus); } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return buf_len; -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t out_bytes, @@ -480,6 +475,7 @@ .claim_bus = spi_ctrlr_claim_bus, .release_bus = spi_ctrlr_release_bus, .xfer = spi_ctrlr_xfer, + .max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/marvell/bg4cd/spi.c b/src/soc/marvell/bg4cd/spi.c index f9faf95..188a6bd 100644 --- a/src/soc/marvell/bg4cd/spi.c +++ b/src/soc/marvell/bg4cd/spi.c @@ -19,8 +19,3 @@ { return -1; } - -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return buf_len; -} diff --git a/src/soc/mediatek/mt8173/flash_controller.c b/src/soc/mediatek/mt8173/flash_controller.c index f6f6e2a..09df1a4 100644 --- a/src/soc/mediatek/mt8173/flash_controller.c +++ b/src/soc/mediatek/mt8173/flash_controller.c @@ -108,11 +108,6 @@ return 0; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(65535, buf_len); -} - static int dma_read(u32 addr, u8 *buf, u32 len, uintptr_t dma_buf, size_t dma_buf_len) { diff --git a/src/soc/mediatek/mt8173/spi.c b/src/soc/mediatek/mt8173/spi.c index 415764a..188bdc2 100644 --- a/src/soc/mediatek/mt8173/spi.c +++ b/src/soc/mediatek/mt8173/spi.c @@ -294,6 +294,7 @@ .release_bus = spi_ctrlr_release_bus, .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = 65535, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/nvidia/tegra124/spi.c b/src/soc/nvidia/tegra124/spi.c index 5d8084f..4ecd67a 100644 --- a/src/soc/nvidia/tegra124/spi.c +++ b/src/soc/nvidia/tegra124/spi.c @@ -714,11 +714,6 @@ return ret; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return buf_len; -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t out_bytes, void *din, size_t in_bytes) { @@ -802,6 +797,7 @@ .claim_bus = spi_ctrlr_claim_bus, .release_bus = spi_ctrlr_release_bus, .xfer = spi_ctrlr_xfer, + .max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/nvidia/tegra210/spi.c b/src/soc/nvidia/tegra210/spi.c index 2921355..0987ddb 100644 --- a/src/soc/nvidia/tegra210/spi.c +++ b/src/soc/nvidia/tegra210/spi.c @@ -750,11 +750,6 @@ return ret; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return buf_len; -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t out_bytes, void *din, size_t in_bytes) { @@ -838,6 +833,7 @@ .claim_bus = spi_ctrlr_claim_bus, .release_bus = spi_ctrlr_release_bus, .xfer = spi_ctrlr_xfer, + .max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/qualcomm/ipq40xx/spi.c b/src/soc/qualcomm/ipq40xx/spi.c index 68c2dd0..b5c1f66 100644 --- a/src/soc/qualcomm/ipq40xx/spi.c +++ b/src/soc/qualcomm/ipq40xx/spi.c @@ -410,11 +410,6 @@ return; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(MAX_PACKET_COUNT, buf_len); -} - /* * Function to read bytes number of data from the Input FIFO */ @@ -657,6 +652,7 @@ .release_bus = spi_ctrlr_release_bus, .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = MAX_PACKET_COUNT, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/qualcomm/ipq806x/spi.c b/src/soc/qualcomm/ipq806x/spi.c index e907729..9a34f7a 100644 --- a/src/soc/qualcomm/ipq806x/spi.c +++ b/src/soc/qualcomm/ipq806x/spi.c @@ -683,11 +683,6 @@ return config_spi_state(ds, SPI_RESET_STATE); } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(MAX_PACKET_COUNT, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t out_bytes, void *din, size_t in_bytes) { @@ -761,6 +756,7 @@ .claim_bus = spi_ctrlr_claim_bus, .release_bus = spi_ctrlr_release_bus, .xfer = spi_ctrlr_xfer, + .max_xfer_size = MAX_PACKET_COUNT, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/rockchip/common/spi.c b/src/soc/rockchip/common/spi.c index 16143b5..0e73769 100644 --- a/src/soc/rockchip/common/spi.c +++ b/src/soc/rockchip/common/spi.c @@ -251,11 +251,6 @@ return 0; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(65535, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytes_out, void *din, size_t bytes_in) { @@ -332,6 +327,7 @@ .claim_bus = spi_ctrlr_claim_bus, .release_bus = spi_ctrlr_release_bus, .xfer = spi_ctrlr_xfer, + .max_xfer_size = 65535, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/soc/samsung/exynos5420/spi.c b/src/soc/samsung/exynos5420/spi.c index f17566e..c2a5828 100644 --- a/src/soc/samsung/exynos5420/spi.c +++ b/src/soc/samsung/exynos5420/spi.c @@ -212,6 +212,7 @@ .claim_bus = spi_ctrlr_claim_bus, .release_bus = spi_ctrlr_release_bus, .xfer = spi_ctrlr_xfer, + .max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/southbridge/amd/agesa/hudson/spi.c b/src/southbridge/amd/agesa/hudson/spi.c index 00f6b29..1afe3e0 100644 --- a/src/southbridge/amd/agesa/hudson/spi.c +++ b/src/southbridge/amd/agesa/hudson/spi.c @@ -85,11 +85,6 @@ spibar = pci_read_config32(dev, 0xA0) & ~0x1F; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(AMD_SB_SPI_TX_LEN - cmd_len, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin) { @@ -168,6 +163,8 @@ static const struct spi_ctrlr spi_ctrlr = { .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = AMD_SB_SPI_TX_LEN, + .deduct_cmd_len = true, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/southbridge/amd/cimx/sb800/spi.c b/src/southbridge/amd/cimx/sb800/spi.c index 1e84743..a664925 100644 --- a/src/southbridge/amd/cimx/sb800/spi.c +++ b/src/southbridge/amd/cimx/sb800/spi.c @@ -54,11 +54,6 @@ spibar = pci_read_config32(dev, 0xA0) & ~0x1F; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(AMD_SB_SPI_TX_LEN - cmd_len, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin) { @@ -159,6 +154,8 @@ static const struct spi_ctrlr spi_ctrlr = { .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = AMD_SB_SPI_TX_LEN, + .deduct_cmd_len = true, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/southbridge/amd/sb700/spi.c b/src/southbridge/amd/sb700/spi.c index 5d56415..9731896 100644 --- a/src/southbridge/amd/sb700/spi.c +++ b/src/southbridge/amd/sb700/spi.c @@ -40,11 +40,6 @@ /* Not needed */ } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(AMD_SB_SPI_TX_LEN - cmd_len, buf_len); -} - static void reset_internal_fifo_pointer(void) { uint32_t spibar = get_spi_bar(); @@ -121,6 +116,8 @@ static const struct spi_ctrlr spi_ctrlr = { .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = AMD_SB_SPI_TX_LEN, + .deduct_cmd_len = true, }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c index ee94937..11318f7 100644 --- a/src/southbridge/intel/common/spi.c +++ b/src/southbridge/intel/common/spi.c @@ -19,6 +19,7 @@ #include <stdlib.h> #include <string.h> #include <bootstate.h> +#include <commonlib/helpers.h> #include <delay.h> #include <arch/io.h> #include <console/console.h> @@ -504,11 +505,6 @@ return !!((cntlr.flmap0 >> 8) & 3); } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(cntlr.databytes, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin) { @@ -660,6 +656,7 @@ static const struct spi_ctrlr spi_ctrlr = { .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = member_size(ich9_spi_regs, fdata), }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) diff --git a/src/southbridge/intel/fsp_rangeley/spi.c b/src/southbridge/intel/fsp_rangeley/spi.c index 0bffeb5..ee60f75 100644 --- a/src/southbridge/intel/fsp_rangeley/spi.c +++ b/src/southbridge/intel/fsp_rangeley/spi.c @@ -17,6 +17,7 @@ #include <stdint.h> #include <stdlib.h> #include <string.h> +#include <commonlib/helpers.h> #include <delay.h> #include <arch/io.h> #include <console/console.h> @@ -569,11 +570,6 @@ return -1; } -unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len) -{ - return min(cntlr.databytes, buf_len); -} - static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin) { @@ -725,6 +721,7 @@ static const struct spi_ctrlr spi_ctrlr = { .xfer = spi_ctrlr_xfer, .xfer_vector = spi_xfer_two_vectors, + .max_xfer_size = member_size(ich10_spi_regs, fdata), }; int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) -- To view, visit
https://review.coreboot.org/19386
To unsubscribe, visit
https://review.coreboot.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I81c199413f879c664682088e93bfa3f91c6a46e5 Gerrit-PatchSet: 9 Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Owner: Furquan Shaikh <furquan(a)google.com> Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org> Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com> Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com> Gerrit-Reviewer: Martin Roth <martinroth(a)google.com> Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net> Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude(a)gmail.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org> Gerrit-Reviewer: coreboot org <coreboot.org(a)gmail.com>
1
0
0
0
← Newer
1
...
300
301
302
303
304
305
306
...
389
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
Results per page:
10
25
50
100
200