forked from coolsnowwolf/lede
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bot] AutoMerging: merge all upstream's changes:
* https://github.com/coolsnowwolf/lede: arm-trusted-firmware-mediatek: skip bad blocks on SPI-NAND (SNFI) mac80211: parse the correct set of HE capabilities for AP mode hostapd: fix WPA3 enterprise keys and ciphers vsftpd-alt: fix compilation with glibc r8101: fixes download link/hash (coolsnowwolf#9988) r8101: fix PKG_SOURCE_URL (coolsnowwolf#9986) ipq806x: add missing scaling_available_frequencies for dedicated cpufreq
- Loading branch information
Showing
6 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...oot/arm-trusted-firmware-mediatek/patches/120-mt7622-bl2_boot_snand-skip-bad-blocks.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- a/plat/mediatek/mt7622/bl2_boot_snand.c | ||
+++ b/plat/mediatek/mt7622/bl2_boot_snand.c | ||
@@ -21,6 +21,10 @@ | ||
#define FIP_BASE 0x80000 | ||
#define FIP_SIZE 0x200000 | ||
|
||
+#ifndef NMBM | ||
+#define SNAND_MAX_BAD_BLOCK 3 | ||
+#endif | ||
+ | ||
struct snfi_gpio_mux_info { | ||
const uint32_t *pins; | ||
uint32_t count; | ||
@@ -45,12 +49,26 @@ static size_t snand_read_range(int lba, | ||
size_t sizeremain = size, chunksize; | ||
uint64_t off = lba * cinfo.pagesize; | ||
uint8_t *ptr = (uint8_t *)buf; | ||
+ struct mtk_snand_chip_info info; | ||
+ unsigned int bad_blocks = 0; | ||
int ret = 0; | ||
|
||
if (!snf) | ||
return 0; | ||
|
||
+ ret = mtk_snand_get_chip_info(snf, &info); | ||
+ if (ret) | ||
+ return 0; | ||
+ | ||
while (sizeremain) { | ||
+ while (mtk_snand_block_isbad(snf, off)) { | ||
+ if (bad_blocks > SNAND_MAX_BAD_BLOCK) | ||
+ return size - sizeremain; | ||
+ | ||
+ off += info.blocksize; | ||
+ ++bad_blocks; | ||
+ } | ||
+ | ||
chunksize = cinfo.pagesize; | ||
if (chunksize > sizeremain) | ||
chunksize = sizeremain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters