diff options
author | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
---|---|---|
committer | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
commit | 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch) | |
tree | cd70a267a5ef105ba32f200aa088e281fbd85747 /external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom | |
parent | 4204309872da5cb401cbb2729d9e2d4869a87f42 (diff) |
basesystem-jjsandbox/ToshikazuOhiwa/master-jj
recipes
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom')
4 files changed, 69 insertions, 274 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch b/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch deleted file mode 100644 index df802862..00000000 --- a/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch +++ /dev/null @@ -1,39 +0,0 @@ -From e5f68189ab3602b1042cc8423fd6a3a23abd5455 Mon Sep 17 00:00:00 2001 -From: Alex James <theracermaster@gmail.com> -Date: Sat, 14 Apr 2018 22:59:57 -0500 -Subject: [PATCH] ch341a_spi: Avoid deprecated libusb functions - -libusb 1.0.22 marked libusb_set_debug as deprecated. For such versions -of libusb, use libusb_set_option instead. - -Change-Id: Ib71ebe812316eaf49136979a942a946ef9e4d487 -Signed-off-by: Alex James <theracermaster@gmail.com> -Reviewed-on: https://review.coreboot.org/25681 -Tested-by: Nico Huber <nico.h@gmx.de> -Reviewed-by: David Hendricks <david.hendricks@gmail.com> ---- -Upstream-Status: Backport - ch341a_spi.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/ch341a_spi.c b/ch341a_spi.c -index 6eb2804..d880510 100644 ---- a/ch341a_spi.c -+++ b/ch341a_spi.c -@@ -444,7 +444,12 @@ int ch341a_spi_init(void) - return -1; - } - -- libusb_set_debug(NULL, 3); // Enable information, warning and error messages (only). -+ /* Enable information, warning, and error messages (only). */ -+#if LIBUSB_API_VERSION < 0x01000106 -+ libusb_set_debug(NULL, 3); -+#else -+ libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_INFO); -+#endif - - uint16_t vid = devs_ch341a_spi[0].vendor_id; - uint16_t pid = devs_ch341a_spi[0].device_id; --- -2.17.0 - diff --git a/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-platform-Add-riscv-to-known-platforms.patch b/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-platform-Add-riscv-to-known-platforms.patch deleted file mode 100644 index 7ba69a91..00000000 --- a/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-platform-Add-riscv-to-known-platforms.patch +++ /dev/null @@ -1,37 +0,0 @@ -From d2a28dcdbd1051d2f48320e2eda3393581fe0519 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Sat, 17 Mar 2018 23:08:29 -0700 -Subject: [PATCH] platform: Add riscv to known platforms - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- -Upstream-Status: Submitted [https://review.coreboot.org/#/c/flashrom/+/25260/] - platform.h | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/platform.h b/platform.h -index b2fdcd0..2cadbb3 100644 ---- a/platform.h -+++ b/platform.h -@@ -69,6 +69,9 @@ - #elif defined (__m68k__) - #define __FLASHROM_ARCH__ "m68k" - #define IS_M68K 1 -+#elif defined (__riscv) -+ #define __FLASHROM_ARCH__ "riscv" -+ #define IS_RISCV 1 - #elif defined (__sh__) - #define __FLASHROM_ARCH__ "sh" - #define IS_SH 1 -@@ -77,7 +80,7 @@ - #define IS_S390 1 - #endif - --#if !(IS_X86 || IS_MIPS || IS_PPC || IS_ARM || IS_SPARC || IS_ALPHA || IS_HPPA || IS_M68K || IS_SH || IS_S390) -+#if !(IS_X86 || IS_MIPS || IS_PPC || IS_ARM || IS_SPARC || IS_ALPHA || IS_HPPA || IS_M68K || IS_RISCV || IS_SH || IS_S390) - #error Unknown architecture - #endif - --- -2.16.2 - diff --git a/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch b/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch new file mode 100644 index 00000000..7ac53650 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch @@ -0,0 +1,69 @@ +From 8a236330f2af56bde21e9f69208ea3e59f529f0c Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 15 Mar 2020 17:02:30 -0700 +Subject: [PATCH] typecast enum conversions explicitly + +clang complains like below + +libflashrom.c:191:43: error: implicit conversion from enumeration type 'const enum test_state' to different enumeration type 'enum flashrom_test_state' [-Werror,-Wenum-conversion] + supported_boards[i].working = binfo[i].working; + ~ ~~~~~~~~~^~~~~~~ +libflashrom.c:229:46: error: implicit conversion from enumeration type 'const enum test_state' to different enumeration type 'enum flashrom_test_state' [-Werror,-Wenum-conversion] + supported_chipsets[i].status = chipset[i].status; + ~ ~~~~~~~~~~~^~~~~~ + +However these enums are exactly same so they can be typecasted + +libflashrom.h + +/** @ingroup flashrom-query */ +enum flashrom_test_state { + FLASHROM_TESTED_OK = 0, + FLASHROM_TESTED_NT = 1, + FLASHROM_TESTED_BAD = 2, + FLASHROM_TESTED_DEP = 3, + FLASHROM_TESTED_NA = 4, +}; + +flash.h + +enum test_state { + OK = 0, + NT = 1, /* Not tested */ + BAD, /* Known to not work */ + DEP, /* Support depends on configuration (e.g. Intel flash descriptor) */ + NA, /* Not applicable (e.g. write support on ROM chips) */ + }; + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + libflashrom.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libflashrom.c b/libflashrom.c +index 0dec22e..7956685 100644 +--- a/libflashrom.c ++++ b/libflashrom.c +@@ -188,7 +188,7 @@ struct flashrom_board_info *flashrom_supported_boards(void) + for (; i < boards_known_size; ++i) { + supported_boards[i].vendor = binfo[i].vendor; + supported_boards[i].name = binfo[i].name; +- supported_boards[i].working = binfo[i].working; ++ supported_boards[i].working = (enum flashrom_test_state)binfo[i].working; + } + } else { + msg_gerr("Memory allocation error!\n"); +@@ -226,7 +226,7 @@ struct flashrom_chipset_info *flashrom_supported_chipsets(void) + supported_chipsets[i].chipset = chipset[i].device_name; + supported_chipsets[i].vendor_id = chipset[i].vendor_id; + supported_chipsets[i].chipset_id = chipset[i].device_id; +- supported_chipsets[i].status = chipset[i].status; ++ supported_chipsets[i].status = (enum flashrom_test_state)chipset[i].status; + } + } else { + msg_gerr("Memory allocation error!\n"); +-- +2.25.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/sst26.patch b/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/sst26.patch deleted file mode 100644 index 46a01529..00000000 --- a/external/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/sst26.patch +++ /dev/null @@ -1,198 +0,0 @@ ---- flashrom-0.9.9.orig/chipdrivers.h -+++ flashrom-0.9.9/chipdrivers.h -@@ -103,6 +103,7 @@ - int spi_prettyprint_status_register_sst25(struct flashctx *flash); - int spi_prettyprint_status_register_sst25vf016(struct flashctx *flash); - int spi_prettyprint_status_register_sst25vf040b(struct flashctx *flash); -+int spi_disable_blockprotect_sst26_global_unprotect(struct flashctx *flash); - - /* sfdp.c */ - int probe_spi_sfdp(struct flashctx *flash); ---- flashrom-0.9.9.orig/flashchips.c -+++ flashrom-0.9.9/flashchips.c -@@ -12564,6 +12564,120 @@ - - { - .vendor = "SST", -+ .name = "SST26VF016B(A)", -+ .bustype = BUS_SPI, -+ .manufacture_id = SST_ID, -+ .model_id = SST_SST26VF016B, -+ .total_size = 2048, -+ .page_size = 256, -+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP, -+ .tested = TEST_OK_PREW, -+ .probe = probe_spi_rdid, -+ .probe_timing = TIMING_ZERO, -+ .block_erasers = -+ { -+ { -+ .eraseblocks = { {4 * 1024, 512} }, -+ .block_erase = spi_block_erase_20, -+ }, { -+ .eraseblocks = { -+ {8 * 1024, 4}, -+ {32 * 1024, 1}, -+ {64 * 1024, 30}, -+ {32 * 1024, 1}, -+ {8 * 1024, 4}, -+ }, -+ .block_erase = spi_block_erase_d8, -+ }, { -+ .eraseblocks = { {2 * 1024 * 1024, 1} }, -+ .block_erase = spi_block_erase_c7, -+ }, -+ }, -+ .printlock = spi_prettyprint_status_register_plain, /* TODO: improve */ -+ .unlock = spi_disable_blockprotect_sst26_global_unprotect, -+ .write = spi_chip_write_256, /* Multi I/O supported */ -+ .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */ -+ .voltage = {2700, 3600}, -+ }, -+ { -+ .vendor = "SST", -+ .name = "SST26VF032B(A)", -+ .bustype = BUS_SPI, -+ .manufacture_id = SST_ID, -+ .model_id = SST_SST26VF032B, -+ .total_size = 4096, -+ .page_size = 256, -+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP, -+ .tested = TEST_UNTESTED, -+ .probe = probe_spi_rdid, -+ .probe_timing = TIMING_ZERO, -+ .block_erasers = -+ { -+ { -+ .eraseblocks = { {4 * 1024, 1024} }, -+ .block_erase = spi_block_erase_20, -+ }, { -+ .eraseblocks = { -+ {8 * 1024, 4}, -+ {32 * 1024, 1}, -+ {64 * 1024, 62}, -+ {32 * 1024, 1}, -+ {8 * 1024, 4}, -+ }, -+ .block_erase = spi_block_erase_d8, -+ }, { -+ .eraseblocks = { {4 * 1024 * 1024, 1} }, -+ .block_erase = spi_block_erase_c7, -+ }, -+ }, -+ .printlock = spi_prettyprint_status_register_plain, /* TODO: improve */ -+ .unlock = spi_disable_blockprotect_sst26_global_unprotect, -+ .write = spi_chip_write_256, /* Multi I/O supported */ -+ .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */ -+ .voltage = {2700, 3600}, -+ }, -+ -+ -+ { -+ .vendor = "SST", -+ .name = "SST26VF064B(A)", -+ .bustype = BUS_SPI, -+ .manufacture_id = SST_ID, -+ .model_id = SST_SST26VF064B, -+ .total_size = 8192, -+ .page_size = 256, -+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP, -+ .tested = TEST_OK_PREW, -+ .probe = probe_spi_rdid, -+ .probe_timing = TIMING_ZERO, -+ .block_erasers = -+ { -+ { -+ .eraseblocks = { {4 * 1024, 2048} }, -+ .block_erase = spi_block_erase_20, -+ }, { -+ .eraseblocks = { -+ {8 * 1024, 4}, -+ {32 * 1024, 1}, -+ {64 * 1024, 126}, -+ {32 * 1024, 1}, -+ {8 * 1024, 4}, -+ }, -+ .block_erase = spi_block_erase_d8, -+ }, { -+ .eraseblocks = { {8 * 1024 * 1024, 1} }, -+ .block_erase = spi_block_erase_c7, -+ }, -+ }, -+ .printlock = spi_prettyprint_status_register_plain, /* TODO: improve */ -+ .unlock = spi_disable_blockprotect_sst26_global_unprotect, -+ .write = spi_chip_write_256, /* Multi I/O supported */ -+ .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */ -+ .voltage = {2700, 3600}, -+ }, -+ -+ { -+ .vendor = "SST", - .name = "SST25WF512", - .bustype = BUS_SPI, - .manufacture_id = SST_ID, ---- flashrom-0.9.9.orig/flashchips.h -+++ flashrom-0.9.9/flashchips.h -@@ -697,6 +697,8 @@ - #define SST_SST25VF064C 0x254B - #define SST_SST26VF016 0x2601 - #define SST_SST26VF032 0x2602 -+#define SST_SST26VF016B 0x2641 -+#define SST_SST26VF032B 0x2642 - #define SST_SST26VF064B 0x2643 - #define SST_SST27SF512 0xA4 - #define SST_SST27SF010 0xA5 ---- flashrom-0.9.9.orig/linux_spi.c -+++ flashrom-0.9.9/linux_spi.c -@@ -141,6 +141,16 @@ - return 0; - } - -+static void print_hex(const char *msg, const void *buf, size_t len) -+{ -+ size_t i; -+ msg_pspew("%s:\n", msg); -+ for (i = 0; i < len; i++) { -+ msg_pspew(" %02x", ((uint8_t *)buf)[i]); -+ } -+ msg_pspew("\n"); -+} -+ - static int linux_spi_send_command(struct flashctx *flash, unsigned int writecnt, - unsigned int readcnt, - const unsigned char *txbuf, -@@ -172,10 +182,12 @@ - else - iocontrol_code = SPI_IOC_MESSAGE(2); - -+ print_hex("Write", txbuf, writecnt); - if (ioctl(fd, iocontrol_code, msg) == -1) { - msg_cerr("%s: ioctl: %s\n", __func__, strerror(errno)); - return -1; - } -+ if (readcnt) print_hex("Got", rxbuf, readcnt); - return 0; - } - ---- flashrom-0.9.9.orig/spi25_statusreg.c -+++ flashrom-0.9.9/spi25_statusreg.c -@@ -196,6 +196,19 @@ - return spi_disable_blockprotect_generic(flash, 0x3C, 0, 0, 0xFF); - } - -+int spi_disable_blockprotect_sst26_global_unprotect(struct flashctx *flash) -+{ -+ int result = spi_write_enable(flash); -+ if (result) -+ return result; -+ -+ static const unsigned char cmd[] = { 0x98 }; /* ULBPR */ -+ result = spi_send_command(flash, sizeof(cmd), 0, cmd, NULL); -+ if (result) -+ msg_cerr("ULBPR failed\n"); -+ return result; -+} -+ - /* A common block protection disable that tries to unset the status register bits masked by 0x0C (BP0-1) and - * protected/locked by bit #7. Useful when bits 4-5 may be non-0). */ - int spi_disable_blockprotect_bp1_srwd(struct flashctx *flash) |