edison: Support for writing an xFSTK image
cover edison: Support for writing an xFSTK image
At present it is painful to put Edison in a hardware lab because it has two separate recovery modes. When the board has a functioning U-Boot, DFU can be used. Otherwise an xFSTK image must be used.
This series converts Andy's script to a binman description so that U-Boot can produce an xFSTK image directly.
With this, I can put an Edison in my lab fairly easily.
The series is available at u-boot-dm/edison-working and is based on the reset binman series for sunxi.
[1] https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f
Simon Glass (5):
x86: Use multiple images
binman: Show an error when a file is missing
binman: Support adding a U-Boot environment
x86: edison: Generate an image suitable for xFSTK
x86: edison: Add documentation for using am xFSTK image
arch/x86/cpu/tangier/Kconfig | 1 + arch/x86/dts/edison.dts | 34 ++++++ arch/x86/dts/u-boot.dtsi | 7 -- board/intel/edison/edison-environment.txt | 48 +++++++++ board/intel/edison/edison-mbr.dat | Bin 0 -> 512 bytes doc/board/intel/edison.rst | 120 ++++++++++++++++++++++ tools/binman/etype/blob.py | 7 +- tools/binman/etype/u_boot_env.py | 42 ++++++++ tools/binman/ftest.py | 38 +++++++ tools/binman/test/173_missing_blob.dts | 14 +++ tools/binman/test/174_env.dts | 20 ++++ tools/binman/test/175_env_no_size.dts | 19 ++++ tools/binman/test/176_env_too_small.dts | 20 ++++ 13 files changed, 360 insertions(+), 10 deletions(-) create mode 100644 board/intel/edison/edison-environment.txt create mode 100644 board/intel/edison/edison-mbr.dat create mode 100644 tools/binman/etype/u_boot_env.py create mode 100644 tools/binman/test/173_missing_blob.dts create mode 100644 tools/binman/test/174_env.dts create mode 100644 tools/binman/test/175_env_no_size.dts create mode 100644 tools/binman/test/176_env_too_small.dts
Signature · 1 line
2.28.0.526.ge36021eeef-goog
PATCH 1/5 x86: Use multiple images
We already use binman's 'multiple-images' feature with Chrome OS and we want to use it for Edison. There is no real down-side.
Adjust x86 to always use multiple-images.
---
arch/x86/dts/u-boot.dtsi | 7 ------- 1 file changed, 7 deletions(-)
arch/x86/dts/u-boot.dtsi +0 -7
@@ -6,7 +6,6 @@ #include <config.h> -#ifdef CONFIG_CHROMEOS / { binman { multiple-images;
@@ -14,12 +13,6 @@ }; }; }; -#else -/ { - rom: binman { - }; -}; -#endif #ifdef CONFIG_ROM_SIZE &rom {
Signature · 1 line
2.28.0.526.ge36021eeef-goog
PATCH 1/5 x86: Use multiple images
Quoted 4 lines · Simon Glass
We already use binman's 'multiple-images' feature with Chrome OS and we want to use it for Edison. There is no real down-side.
Adjust x86 to always use multiple-images.
Quoted 34 lines
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/u-boot.dtsi | 7 ------- 1 file changed, 7 deletions(-)arch/x86/dts/u-boot.dtsi +0
-7@@ -6,7 +6,6 @@ #include <config.h> -#ifdef CONFIG_CHROMEOS / { binman { multiple-images;@@ -14,12 +13,6 @@ }; }; }; -#else -/ { - rom: binman { - }; -}; -#endif #ifdef CONFIG_ROM_SIZE &rom {Signature · 1 line
2.28.0.526.ge36021eeef-goog
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 2/5 binman: Show an error when a file is missing
In reply to Simon GlassThe recent support for missing external binaries does not show an error message when a file is genuinely missing (i.e. it is missing but not marked as 'external'). This means that when -m is passed to binman, it will never report a missing file.
Fix this and add a test.
---
tools/binman/etype/blob.py | 7 ++++--- tools/binman/ftest.py | 7 +++++++ tools/binman/test/173_missing_blob.dts | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 tools/binman/test/173_missing_blob.dts
tools/binman/etype/blob.py +4 -3
@@ -37,13 +37,14 @@ class Entry_blob(Entry): def ObtainContents(self): self._filename = self.GetDefaultFilename() - self._pathname = tools.GetInputFilename(self._filename, - self.section.GetAllowMissing()) + self._pathname = tools.GetInputFilename( + self._filename, self.external and self.section.GetAllowMissing()) # Allow the file to be missing - if self.external and not self._pathname: + if not self._pathname: self.SetContents(b'') self.missing = True return True + self.ReadBlobContents() return True
tools/binman/ftest.py +7 -0
@@ -3708,5 +3708,12 @@ class TestFunctional(unittest.TestCase): self.assertIn('Wibble test', err) self.assertIn('Another test', err) + def testMissingBlob(self): + """Test handling of a blob containing a missing file""" + with self.assertRaises(ValueError) as e: + self._DoTestFile('173_missing_blob.dts', allow_missing=True) + self.assertIn("Filename 'missing' not found in input path", + str(e.exception)) + if __name__ == "__main__": unittest.main()
tools/binman/test/173_missing_blob.dts new file +14 -0
@@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob { + filename = "missing"; + }; + }; +};
Signature · 1 line
2.28.0.526.ge36021eeef-goog
PATCH 2/5 binman: Show an error when a file is missing
Quoted 6 lines · Simon Glass
The recent support for missing external binaries does not show an error message when a file is genuinely missing (i.e. it is missing but not marked as 'external'). This means that when -m is passed to binman, it will never report a missing file.
Fix this and add a test.
One note below.
Quoted 15 lines
Signed-off-by Simon Glass <[email protected]>---
tools/binman/etype/blob.py | 7 ++++--- tools/binman/ftest.py | 7 +++++++ tools/binman/test/173_missing_blob.dts | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 tools/binman/test/173_missing_blob.dtstools/binman/etype/blob.py +0
-0
tools/binman/etype/blob.py class Entry_blob(Entry): · line 41
Quoted 7 lines
tools/binman/etype/blob.py +2
-2@@ -37,13 +37,14 @@ class Entry_blob(Entry): def ObtainContents(self): self._filename = self.GetDefaultFilename() - self._pathname = tools.GetInputFilename(self._filename, - self.section.GetAllowMissing()) + self._pathname = tools.GetInputFilename( + self._filename, self.external and self.section.GetAllowMissing())
I hope you know that 'and' has a bit different semantics in Python than in C for example. And why to move first parameter to new line?
Quoted 50 lines
tools/binman/etype/blob.py +2
-1# Allow the file to be missing - if self.external and not self._pathname: + if not self._pathname: self.SetContents(b'') self.missing = True return True + self.ReadBlobContents() return Truetools/binman/ftest.py +7
-0@@ -3708,5 +3708,12 @@ class TestFunctional(unittest.TestCase): self.assertIn('Wibble test', err) self.assertIn('Another test', err) + def testMissingBlob(self): + """Test handling of a blob containing a missing file""" + with self.assertRaises(ValueError) as e: + self._DoTestFile('173_missing_blob.dts', allow_missing=True) + self.assertIn("Filename 'missing' not found in input path", + str(e.exception)) + if __name__ == "__main__": unittest.main()tools/binman/test/173_missing_blob.dts new file +14
-0@@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob { + filename = "missing"; + }; + }; +};Signature · 1 line
2.28.0.526.ge36021eeef-goog
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 2/5 binman: Show an error when a file is missing
Hi Andy,
Quoted 29 lines · Andy Shevchenko
Quoted 6 lines · Simon Glass
The recent support for missing external binaries does not show an error message when a file is genuinely missing (i.e. it is missing but not marked as 'external'). This means that when -m is passed to binman, it will never report a missing file.
Fix this and add a test.
Acked-by Andy Shevchenko <[email protected]>One note below.
Quoted 16 lines
Signed-off-by Simon Glass <[email protected]>---
tools/binman/etype/blob.py | 7 ++++--- tools/binman/ftest.py | 7 +++++++ tools/binman/test/173_missing_blob.dts | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 tools/binman/test/173_missing_blob.dtstools/binman/etype/blob.py +0
-0@@ -37,13 +37,14 @@ class Entry_blob(Entry):
Quoted 8 lines
tools/binman/etype/blob.py class Entry_blob(Entry): · line 41
Quoted 6 lines
tools/binman/etype/blob.py +2
-2def ObtainContents(self): self._filename = self.GetDefaultFilename() - self._pathname = tools.GetInputFilename(self._filename, - self.section.GetAllowMissing()) + self._pathname = tools.GetInputFilename( + self._filename, self.external and self.section.GetAllowMissing())I hope you know that 'and' has a bit different semantics in Python than in C for example.
I think I understand it, in the sense that 'x and y' returns y if x is true. Is that what you mean?
Quoted 1 line
And why to move first parameter to new line?
I think the style is to either line up the params agained the '(' or indented 4 from the start of the line. I'll flip it back as pylint3 doesn't seem to mind either way.
Regards,
Simon
PATCH 2/5 binman: Show an error when a file is missing
Quoted 9 lines · Simon Glass
Quoted 7 lines · Andy Shevchenko
Quoted 4 lines · Simon Glass
tools/binman/etype/blob.py +2
-2- self._pathname = tools.GetInputFilename(self._filename, - self.section.GetAllowMissing()) + self._pathname = tools.GetInputFilename( + self._filename, self.external and self.section.GetAllowMissing())
Quoted 4 lines
Quoted 1 line
I hope you know that 'and' has a bit different semantics in Python than in C for example.
I think I understand it, in the sense that 'x and y' returns y if x is true. Is that what you mean?
There is no boolean object involved!
"Note that neither and nor or restrict the value and type they return to False and True, but rather return the last evaluated argument."
If x is last evaluated argument (false), it will be returned. Means that there are possibilities to get None, False, empty container, etc as returned value of 'and'.
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 2/5 binman: Show an error when a file is missing
Hi Andy,
Quoted 16 lines · Andy Shevchenko
Quoted 9 lines · Simon Glass
Quoted 7 lines · Andy Shevchenko
Quoted 4 lines · Simon Glass
tools/binman/etype/blob.py +2
-2- self._pathname = tools.GetInputFilename(self._filename, - self.section.GetAllowMissing()) + self._pathname = tools.GetInputFilename( + self._filename, self.external and self.section.GetAllowMissing())Quoted 4 lines
Quoted 1 line
I hope you know that 'and' has a bit different semantics in Python than in C for example.
I think I understand it, in the sense that 'x and y' returns y if x is true. Is that what you mean?
Quoted 8 lines
There is no boolean object involved!
"Note that neither and nor or restrict the value and type they return to False and True, but rather return the last evaluated argument."
If x is last evaluated argument (false), it will be returned. Means that there are possibilities to get None, False, empty container, etc as returned value of 'and'.
Yes I think that matches with my understanding. It's more like 'if...else' in this case. Anyway, both x and y are booleans in the code above.
Regards,
Simon
PATCH 3/5 binman: Support adding a U-Boot environment
In reply to Simon GlassIn some cases it is useful to include a U-Boot environment region in an image. This allows the board to start up with an environment ready to go.
Add a new entry type for this. The input is a text file containing the environment entries, one per line, in the format:
var=value
---
tools/binman/etype/u_boot_env.py | 42 +++++++++++++++++++++++++ tools/binman/ftest.py | 31 ++++++++++++++++++ tools/binman/test/174_env.dts | 20 ++++++++++++ tools/binman/test/175_env_no_size.dts | 19 +++++++++++ tools/binman/test/176_env_too_small.dts | 20 ++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 tools/binman/etype/u_boot_env.py create mode 100644 tools/binman/test/174_env.dts create mode 100644 tools/binman/test/175_env_no_size.dts create mode 100644 tools/binman/test/176_env_too_small.dts
tools/binman/etype/u_boot_env.py new file +42 -0
@@ -0,0 +1,42 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2018 Google, Inc +# Written by Simon Glass <[email protected]> +# + +import struct +import zlib + +from binman.etype.blob import Entry_blob +from dtoc import fdt_util +from patman import tools + +class Entry_u_boot_env(Entry_blob): + """An entry which contains a U-Boot environment + + Properties / Entry arguments: + - filename: File containing the environment text, with each line in the + form var=value + """ + def __init__(self, section, etype, node): + super().__init__(section, etype, node) + + def ReadNode(self): + super().ReadNode() + if self.size is None: + self.Raise("'u-boot-env' entry must have a size property") + self.fill_value = fdt_util.GetByte(self._node, 'fill-byte', 0) + + def ReadBlobContents(self): + indata = tools.ReadFile(self._pathname) + data = b'' + for line in indata.splitlines(): + data += line + b'\0' + data += b'\0'; + pad = self.size - len(data) - 5 + if pad < 0: + self.Raise("'u-boot-env' entry too small to hold data (need %#x more bytes)" % -pad) + data += tools.GetBytes(self.fill_value, pad) + crc = zlib.crc32(data) + buf = struct.pack('<I', crc) + b'\x01' + data + self.SetContents(buf) + return True
tools/binman/ftest.py +31 -0
@@ -77,6 +77,7 @@ FSP_T_DATA = b'fsp_t' ATF_BL31_DATA = b'bl31' TEST_FDT1_DATA = b'fdt1' TEST_FDT2_DATA = b'test-fdt2' +ENV_DATA = b'var1=1\nvar2="2"' # Subdirectory of the input dir to use to put test FDTs TEST_FDT_SUBDIR = 'fdts'
@@ -181,6 +182,8 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputFile('%s/test-fdt2.dtb' % TEST_FDT_SUBDIR, TEST_FDT2_DATA) + TestFunctional._MakeInputFile('env.txt', ENV_DATA) + # Travis-CI may have an old lz4 cls.have_lz4 = True try:
@@ -3715,5 +3718,33 @@ class TestFunctional(unittest.TestCase): self.assertIn("Filename 'missing' not found in input path", str(e.exception)) + def testEnvironment(self): + """Test adding a U-Boot environment""" + data = self._DoReadFile('174_env.dts') + self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)]) + self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):]) + env = data[len(U_BOOT_DATA):-len(U_BOOT_NODTB_DATA)] + self.assertEqual(b'\x1b\x97\x22\x7c\x01var1=1\0var2="2"\0\0\xff\xff', + env) + + def testEnvironmentNoSize(self): + """Test that a missing 'size' property is detected""" + with self.assertRaises(ValueError) as e: + data = self._DoTestFile('175_env_no_size.dts') + self.assertIn("'u-boot-env' entry must have a size property", + str(e.exception)) + + def testEnvironmentTooSmall(self): + """Test handling of an environment that does not fit""" + with self.assertRaises(ValueError) as e: + data = self._DoTestFile('176_env_too_small.dts') + + # checksum, start byte, environment with \0 terminator, final \0 + need = 4 + 1 + len(ENV_DATA) + 1 + 1 + short = need - 0x8 + self.assertIn("too small to hold data (need %#x more bytes)" % short, + str(e.exception)) + + if __name__ == "__main__": unittest.main()
tools/binman/test/174_env.dts new file +20 -0
@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot { + }; + u-boot-env { + filename = "env.txt"; + size = <0x18>; + fill-byte = [ff]; + }; + u-boot-nodtb { + }; + }; +};
tools/binman/test/175_env_no_size.dts new file +19 -0
@@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot { + }; + u-boot-env { + filename = "env.txt"; + fill-byte = [ff]; + }; + u-boot-nodtb { + }; + }; +};
tools/binman/test/176_env_too_small.dts new file +20 -0
@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot { + }; + u-boot-env { + filename = "env.txt"; + size = <0x8>; + fill-byte = [ff]; + }; + u-boot-nodtb { + }; + }; +};
Signature · 1 line
2.28.0.526.ge36021eeef-goog
PATCH 3/5 binman: Support adding a U-Boot environment
Quoted 7 lines · Simon Glass
In some cases it is useful to include a U-Boot environment region in an image. This allows the board to start up with an environment ready to go.
Add a new entry type for this. The input is a text file containing the environment entries, one per line, in the format:
var=value
Quoted 197 lines
Signed-off-by Simon Glass <[email protected]>---
tools/binman/etype/u_boot_env.py | 42 +++++++++++++++++++++++++ tools/binman/ftest.py | 31 ++++++++++++++++++ tools/binman/test/174_env.dts | 20 ++++++++++++ tools/binman/test/175_env_no_size.dts | 19 +++++++++++ tools/binman/test/176_env_too_small.dts | 20 ++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 tools/binman/etype/u_boot_env.py create mode 100644 tools/binman/test/174_env.dts create mode 100644 tools/binman/test/175_env_no_size.dts create mode 100644 tools/binman/test/176_env_too_small.dtstools/binman/etype/u_boot_env.py new file +42
-0@@ -0,0 +1,42 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2018 Google, Inc +# Written by Simon Glass <[email protected]> +# + +import struct +import zlib + +from binman.etype.blob import Entry_blob +from dtoc import fdt_util +from patman import tools + +class Entry_u_boot_env(Entry_blob): + """An entry which contains a U-Boot environment + + Properties / Entry arguments: + - filename: File containing the environment text, with each line in the + form var=value + """ + def __init__(self, section, etype, node): + super().__init__(section, etype, node) + + def ReadNode(self): + super().ReadNode() + if self.size is None: + self.Raise("'u-boot-env' entry must have a size property") + self.fill_value = fdt_util.GetByte(self._node, 'fill-byte', 0) + + def ReadBlobContents(self): + indata = tools.ReadFile(self._pathname) + data = b'' + for line in indata.splitlines(): + data += line + b'\0' + data += b'\0'; + pad = self.size - len(data) - 5 + if pad < 0: + self.Raise("'u-boot-env' entry too small to hold data (need %#x more bytes)" % -pad) + data += tools.GetBytes(self.fill_value, pad) + crc = zlib.crc32(data) + buf = struct.pack('<I', crc) + b'\x01' + data + self.SetContents(buf) + return Truetools/binman/ftest.py +31
-0@@ -77,6 +77,7 @@ FSP_T_DATA = b'fsp_t' ATF_BL31_DATA = b'bl31' TEST_FDT1_DATA = b'fdt1' TEST_FDT2_DATA = b'test-fdt2' +ENV_DATA = b'var1=1\nvar2="2"' # Subdirectory of the input dir to use to put test FDTs TEST_FDT_SUBDIR = 'fdts'@@ -181,6 +182,8 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputFile('%s/test-fdt2.dtb' % TEST_FDT_SUBDIR, TEST_FDT2_DATA) + TestFunctional._MakeInputFile('env.txt', ENV_DATA) + # Travis-CI may have an old lz4 cls.have_lz4 = True try:@@ -3715,5 +3718,33 @@ class TestFunctional(unittest.TestCase): self.assertIn("Filename 'missing' not found in input path", str(e.exception)) + def testEnvironment(self): + """Test adding a U-Boot environment""" + data = self._DoReadFile('174_env.dts') + self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)]) + self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):]) + env = data[len(U_BOOT_DATA):-len(U_BOOT_NODTB_DATA)] + self.assertEqual(b'\x1b\x97\x22\x7c\x01var1=1\0var2="2"\0\0\xff\xff', + env) + + def testEnvironmentNoSize(self): + """Test that a missing 'size' property is detected""" + with self.assertRaises(ValueError) as e: + data = self._DoTestFile('175_env_no_size.dts') + self.assertIn("'u-boot-env' entry must have a size property", + str(e.exception)) + + def testEnvironmentTooSmall(self): + """Test handling of an environment that does not fit""" + with self.assertRaises(ValueError) as e: + data = self._DoTestFile('176_env_too_small.dts') + + # checksum, start byte, environment with \0 terminator, final \0 + need = 4 + 1 + len(ENV_DATA) + 1 + 1 + short = need - 0x8 + self.assertIn("too small to hold data (need %#x more bytes)" % short, + str(e.exception)) + + if __name__ == "__main__": unittest.main()tools/binman/test/174_env.dts new file +20
-0@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot { + }; + u-boot-env { + filename = "env.txt"; + size = <0x18>; + fill-byte = [ff]; + }; + u-boot-nodtb { + }; + }; +};tools/binman/test/175_env_no_size.dts new file +19
-0@@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot { + }; + u-boot-env { + filename = "env.txt"; + fill-byte = [ff]; + }; + u-boot-nodtb { + }; + }; +};tools/binman/test/176_env_too_small.dts new file +20
-0@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot { + }; + u-boot-env { + filename = "env.txt"; + size = <0x8>; + fill-byte = [ff]; + }; + u-boot-nodtb { + }; + }; +};Signature · 1 line
2.28.0.526.ge36021eeef-goog
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 4/5 x86: edison: Generate an image suitable for xFSTK
In reply to Simon GlassIt is useful to be able to flash Edison directly without relying on the installed U-Boot being functional.
Add a binman image for this. It includes a master-boot record, U-Boot binary and an environment.
---
arch/x86/cpu/tangier/Kconfig | 1 + arch/x86/dts/edison.dts | 34 +++++++++++++++ board/intel/edison/edison-environment.txt | 48 ++++++++++++++++++++++ board/intel/edison/edison-mbr.dat | Bin 0 -> 512 bytes 4 files changed, 83 insertions(+) create mode 100644 board/intel/edison/edison-environment.txt create mode 100644 board/intel/edison/edison-mbr.dat
arch/x86/cpu/tangier/Kconfig +1 -0
@@ -12,6 +12,7 @@ config INTEL_TANGIER imply MMC_SDHCI_TANGIER imply USB imply USB_DWC3 + imply BINMAN if INTEL_TANGIER
arch/x86/dts/edison.dts +34 -0
@@ -22,6 +22,10 @@ serial2 = &serial2; }; + binman: binman { + multiple-images; + }; + chosen { stdout-path = &serial2; };
@@ -130,3 +134,33 @@ }; }; }; + +&binman { + u-boot-edison { + filename = "u-boot-edison.img"; + + /* This is Master-Boot Record */ + blob { + filename = "edison-mbr.dat"; + }; + + u-boot { + offset = <0x200>; + }; + + u-boot-env { + offset = <0x200200>; + filename = "edison-environment.txt"; + size = <0x10000>; + fill-byte = [ff]; + }; + + u-boot-env2 { + type = "u-boot-env"; + offset = <0x500200>; + filename = "edison-environment.txt"; + size = <0x10000>; + fill-byte = [ff]; + }; + }; +};
board/intel/edison/edison-environment.txt new file +48 -0
48 lines not on this page · raw message
board/intel/edison/edison-mbr.dat new file binary +0 -0
Signature · 1 line
2.28.0.526.ge36021eeef-goog
PATCH 4/5 x86: edison: Generate an image suitable for xFSTK
Quoted 5 lines · Simon Glass
It is useful to be able to flash Edison directly without relying on the installed U-Boot being functional.
Add a binman image for this. It includes a master-boot record, U-Boot binary and an environment.
master-boot record -> OSIP header
It's a part of DnX (Download'n'Execute) protocol. Let's say it's coincidence it looks like MBR.
With above and below changes made,
Quoted 8 lines
Signed-off-by Simon Glass <[email protected]>---
arch/x86/cpu/tangier/Kconfig | 1 + arch/x86/dts/edison.dts | 34 +++++++++++++++ board/intel/edison/edison-environment.txt | 48 ++++++++++++++++++++++board/intel/edison/edison-mbr.dat | Bin 0 -> 512 bytes
mbr -> osip
Quoted 133 lines
4 files changed, 83 insertions(+) create mode 100644 board/intel/edison/edison-environment.txt create mode 100644 board/intel/edison/edison-mbr.datarch/x86/cpu/tangier/Kconfig +1
-0@@ -12,6 +12,7 @@ config INTEL_TANGIER imply MMC_SDHCI_TANGIER imply USB imply USB_DWC3 + imply BINMAN if INTEL_TANGIERarch/x86/dts/edison.dts +34
-0@@ -22,6 +22,10 @@ serial2 = &serial2; }; + binman: binman { + multiple-images; + }; + chosen { stdout-path = &serial2; };@@ -130,3 +134,33 @@ }; }; }; + +&binman { + u-boot-edison { + filename = "u-boot-edison.img"; + + /* This is Master-Boot Record */ + blob { + filename = "edison-mbr.dat"; + }; + + u-boot { + offset = <0x200>; + }; + + u-boot-env { + offset = <0x200200>; + filename = "edison-environment.txt"; + size = <0x10000>; + fill-byte = [ff]; + }; + + u-boot-env2 { + type = "u-boot-env"; + offset = <0x500200>; + filename = "edison-environment.txt"; + size = <0x10000>; + fill-byte = [ff]; + }; + }; +};board/intel/edison/edison-environment.txt new file +48
-0@@ -0,0 +1,48 @@ +partitions=uuid_disk=${uuid_disk};name=u-boot0,start=1MiB,size=2MiB,uuid=${uuid_uboot0};name=u-boot-env0,size=1MiB,uuid=${uuid_uboot_env0};name=u-boot1,size=2MiB,uuid=${uuid_uboot1};name=u-boot-env1,size=1MiB,uuid=${uuid_uboot_env1};name=factory,size=1MiB,uuid=${uuid_factory};name=panic,size=24MiB,uuid=${uuid_panic};name=boot,size=32MiB,uuid=${uuid_boot};name=rootfs,size=1536MiB,uuid=${uuid_rootfs};name=update,size=768MiB,uuid=${uuid_update};name=home,size=-,uuid=${uuid_home}; +do_dfu_alt_info_mmc=setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2;u-boot0 part 0 1;u-boot-env0 part 0 2;u-boot1 part 0 3;u-boot-env1 part 0 4;boot part 0 7;rootfs part 0 8;update part 0 9;home part 0 10;vmlinuz fat 0 7;initrd fat 0 7" +dfu_alt_info_ram=kernel ram ${loadaddr} 0x800000 +do_dfu_alt_info_ifwi=setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2" +dfu_alt_info_reset=reset ram 0x0 0x0 +bootargs_console=console=ttyMFD2 earlyprintk=ttyMFD2,keep +bootargs_debug=loglevel=4 +do_bootargs_rootfs=setenv bootargs_rootfs rootwait root=PARTUUID=${uuid_rootfs} rootfstype=ext4 +first_install_retry=0 +first_install_max_retries=3 +ota_update_retry=0 +ota_update_max_retries=3 +audio_codec_name=audio_codec="dummy" +do_audio_support=setenv audio_support platform_mrfld_audio.${audio_codec_name} +do_compute_target=if itest.b ${first_install_retry} -gt ${first_install_max_retries} || itest.b ${ota_update_retry} -gt ${ota_update_max_retries}; then echo "Switch to Rescue target"; setenv bootargs_target rescue; saveenv; fi +mmc-bootargs=run do_bootargs_rootfs; run do_audio_support; setenv bootargs ${bootargs_rootfs} ${bootargs_console} ${bootargs_debug} g_multi.ethernet_config=${bootargs_ethconfig} systemd.unit=${bootargs_target}.target hardware_id=${hardware_id} g_multi.iSerialNumber=${serial#} g_multi.dev_addr=${usb0addr} ${audio_support} +loadaddr=0x100000 +load_kernel=fatload mmc 0:7 ${loadaddr} vmlinuz +do_partition_done=0 +do_partition=if itest.b ${do_partition_done} -eq 1; then echo "Partitioning already done..."; else run do_force_partition ; fi +do_force_partition=echo "Partitioning using GPT"; gpt write mmc 0 ${partitions} ; mmc rescan; setenv do_partition_done 1 ; saveenv +do_flash_ifwi=run do_dfu_alt_info_ifwi ; dfu 0 mmc 0 $dfu_to_sec +do_flash_os=if itest.b ${do_flash_os_done} -eq 1 ; then echo "Flashing already done..." ; else run do_force_flash_os; fi +do_force_flash_os=run do_dfu_alt_info_mmc ; sleep 1 ; setenv do_flash_os_done 1 ; saveenv ; dfu 0 mmc 0 $dfu_to_sec +do_flashall=run do_partition;run do_flash_ifwi;run do_flash_os +do_dnx=setenv dfu_alt_info ${dfu_alt_info_ram};dfu 0 ram 0 ram;run bootcmd +init_dfu=run do_dfu_alt_info_mmc ; saveenv +bootcmd=echo "Target:${target_name}"; run do_partition; run do_handle_bootargs_mode; +do_handle_bootargs_mode=run do_preprocess_bootargs_mode; if itest.s $bootargs_mode == "ota" ; then run do_ota; fi; if itest.s $bootargs_mode == "boot" ; then run do_boot; fi; if itest.s $bootargs_mode == "flash"; then run do_flash; fi; run do_fallback; exit; +do_preprocess_bootargs_mode=if env exists bootargs_mode ; then ; else setenv bootargs_mode "boot" ;fi; +do_fallback=echo "Unknown boot mode: $bootargs_mode"; env delete -f bootargs_mode; saveenv; echo "Resetting to default boot mode and reboot..."; reset; +do_boot=run boot_target_cmd; +do_flash=run do_force_flash_os; +ota_done=0 +ota_script_addr=0x100000 +do_ota_init=setenv ota_status 1 ; env delete -f bootargs_mode +do_load_ota_scr=if fatload mmc 0:9 $ota_script_addr ota_update.scr ; then setenv ota_status 0 ; else setenv ota_status 1 ; fi +do_source_ota_scr=if test $ota_status -eq 0 ; then if source $ota_script_addr ; then setenv ota_status 0 ; else setenv ota_status 2 ; fi ; fi +do_ota_clean=saveenv ; reset +do_ota=run do_ota_init ; run do_load_ota_scr ; run do_source_ota_scr ; run do_ota_clean +target_name=blank +bootdelay=1 +do_flash_os_done=1 +bootargs_target=multi-user +bootargs_ethconfig=cdc +dfu_to_sec=3 +do_probe_dfu=run do_dfu_alt_info_mmc ; dfu 0 mmc 0 $dfu_to_sec +boot_target_cmd=run do_flash_os;run do_probe_dfu;run do_compute_target;run mmc-bootargs;run load_kernel;zboot ${loadaddr}board/intel/edison/edison-mbr.dat new file binary +0
-0Signature · 2 lines
-- 2.28.0.526.ge36021eeef-goog
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 5/5 x86: edison: Add documentation for using am xFSTK image
In reply to Simon GlassAdd a description of how to flash Edison using the XFSTK tool.
---
doc/board/intel/edison.rst | 120 +++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+)
doc/board/intel/edison.rst +120 -0
@@ -39,3 +39,123 @@ use. reset the board:: => reset + + +Updating U-Boot using xFSTK +--------------------------- + +You can also update U-Boot using the xfstk-dldr-solo tool if you can build it. +One way to do that is to follow the `xFSTK`_ instructions. You may need to use +a virtual machine running Ubuntu Trusty. Once you have built it and installed +libboost-all-dev, you can copy xfstk-dldr-solo to /usr/local/bin and +libboost_program_options.so.1.54.0 to /usr/lib/i386-linux-gnu/ and with luck +it will work. You might fine this `drive`_ helpful. + +If it does, then you can download and unpack the Edison reocovery image, +install dfu-util, reset your board and flash U-Boot like this:: + + $ xfstk-dldr-solo --gpflags 0x80000007 \ + --osimage u-boot-edison.img \ + --fwdnx recover/edison_dnx_fwr.bin \ + --fwimage recover/edison_ifwi-dbg-00.bin \ + --osdnx recover/edison_dnx_osr.bin + +This should show the following + +.. code-block:: none + + XFSTK Downloader Solo 0.0.0 + Copyright (c) 2015 Intel Corporation + Build date and time: Aug 15 2020 15:07:13 + + .Intel SoC Device Detection Found + Parsing Commandline.... + Registering Status Callback.... + .Initiating Download Process.... + .......(lots of dots)........XFSTK-STATUS--Reconnecting to device - Attempt #1 + .......(even more dots)...................... + + +You have about 10 seconds after resetting the board to type the above command. +If you want to check if the board is ready, type: + +.. code-block:: none + + lsusb |egrep "8087|8086" + Bus 001 Device 004: ID 8086:e005 Intel Corp. + +If you see a device with the same ID as above, the board is waiting for your +command. + +After about 5 seconds you should see some console output from the board: + +.. code-block:: none + + ****************************** + PSH KERNEL VERSION: b0182b2b + WR: 20104000 + ****************************** + + SCU IPC: 0x800000d0 0xfffce92c + + PSH miaHOB version: TNG.B0.VVBD.0000000c + + microkernel built 11:24:08 Feb 5 2015 + + ******* PSH loader ******* + PCM page cache size = 192 KB + Cache Constraint = 0 Pages + Arming IPC driver .. + Adding page store pool .. + PagestoreAddr(IMR Start Address) = 0x04899000 + pageStoreSize(IMR Size) = 0x00080000 + + *** Ready to receive application *** + + After another 10 seconds the xFSTK tool completes and the board resets. About + 10 seconds after that should see the above message again and then within a + few seconds U-Boot should start on your board: + +.. code-block:: none + + U-Boot 2020.10-rc3-00032-gd9f6680e925-dirty (Sep 03 2020 - 18:44:28 -0600) + + CPU: Genuine Intel(R) CPU 4000 @ 500MHz + DRAM: 980.6 MiB + WDT: Started with servicing (60s timeout) + MMC: mmc at ff3fc000: 0, mmc at ff3fa000: 1 + Loading Environment from MMC... OK + In: serial + Out: serial + Err: serial + Saving Environment to MMC... Writing to redundant MMC(0)... OK + Saving Environment to MMC... Writing to MMC(0)... OK + Net: No ethernet found. + Hit any key to stop autoboot: 0 + Target:blank + Partitioning using GPT + Writing GPT: success! + Saving Environment to MMC... Writing to redundant MMC(0)... OK + Flashing already done... + 5442816 bytes read in 238 ms (21.8 MiB/s) + Valid Boot Flag + Setup Size = 0x00003c00 + Magic signature found + Using boot protocol version 2.0c + Linux kernel version 3.10.17-poky-edison+ (ferry at kalamata) #1 SMP PREEMPT Mon Jan 11 14:54:18 CET 2016 + Building boot_params at 0x00090000 + Loading bzImage at address 100000 (5427456 bytes) + Magic signature found + Kernel command line: "rootwait root=PARTUUID=ada722ed-6410-764e-8619-abff6f66e10e rootfstype=ext4 console=ttyMFD2 earlyprintk=ttyMFD2,keep loglevel=4 g_multi.ethernet_config=cdc systemd.unit=multi-user.target hardware_id=00 g_multi.iSerialNumber=2249baf774c675598661a63098c0ad41 g_multi.dev_addr=02:00:86:c0:ad:41 platform_mrfld_audio.audio_codec=dummy" + Magic signature found + + Starting kernel ... + + ... + + Poky (Yocto Project Reference Distro) 1.7.2 edison ttyMFD2 + + edison login: + +.. _xFSTK: https://community.intel.com/t5/Intel-Makers/Building-xFSTK-on-Ubuntu-14-04-32-bit-for-flashing-Edison/td-p/538081 +.. _drive: https://drive.google.com/drive/u/0/folders/1URPHrOk9-UBsh8hjv-7WwC0W6Fy61uAJ
Signature · 1 line
2.28.0.526.ge36021eeef-goog
PATCH 5/5 x86: edison: Add documentation for using am xFSTK image
Quoted 1 line · Simon Glass
Add a description of how to flash Edison using the XFSTK tool.
Switch to OSIP and mentioned DnX may affect the wording here, though I didn't see if it really the case. Also, please update with using clean U-Boot version (no Git hash, no dirty suffix).
After addressing,
Quoted 137 lines
Signed-off-by Simon Glass <[email protected]>---
doc/board/intel/edison.rst | 120 +++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+)doc/board/intel/edison.rst +120
-0@@ -39,3 +39,123 @@ use. reset the board:: => reset + + +Updating U-Boot using xFSTK +--------------------------- + +You can also update U-Boot using the xfstk-dldr-solo tool if you can build it. +One way to do that is to follow the `xFSTK`_ instructions. You may need to use +a virtual machine running Ubuntu Trusty. Once you have built it and installed +libboost-all-dev, you can copy xfstk-dldr-solo to /usr/local/bin and +libboost_program_options.so.1.54.0 to /usr/lib/i386-linux-gnu/ and with luck +it will work. You might fine this `drive`_ helpful. + +If it does, then you can download and unpack the Edison reocovery image, +install dfu-util, reset your board and flash U-Boot like this:: + + $ xfstk-dldr-solo --gpflags 0x80000007 \ + --osimage u-boot-edison.img \ + --fwdnx recover/edison_dnx_fwr.bin \ + --fwimage recover/edison_ifwi-dbg-00.bin \ + --osdnx recover/edison_dnx_osr.bin + +This should show the following + +.. code-block:: none + + XFSTK Downloader Solo 0.0.0 + Copyright (c) 2015 Intel Corporation + Build date and time: Aug 15 2020 15:07:13 + + .Intel SoC Device Detection Found + Parsing Commandline.... + Registering Status Callback.... + .Initiating Download Process.... + .......(lots of dots)........XFSTK-STATUS--Reconnecting to device - Attempt #1 + .......(even more dots)...................... + + +You have about 10 seconds after resetting the board to type the above command. +If you want to check if the board is ready, type: + +.. code-block:: none + + lsusb |egrep "8087|8086" + Bus 001 Device 004: ID 8086:e005 Intel Corp. + +If you see a device with the same ID as above, the board is waiting for your +command. + +After about 5 seconds you should see some console output from the board: + +.. code-block:: none + + ****************************** + PSH KERNEL VERSION: b0182b2b + WR: 20104000 + ****************************** + + SCU IPC: 0x800000d0 0xfffce92c + + PSH miaHOB version: TNG.B0.VVBD.0000000c + + microkernel built 11:24:08 Feb 5 2015 + + ******* PSH loader ******* + PCM page cache size = 192 KB + Cache Constraint = 0 Pages + Arming IPC driver .. + Adding page store pool .. + PagestoreAddr(IMR Start Address) = 0x04899000 + pageStoreSize(IMR Size) = 0x00080000 + + *** Ready to receive application *** + + After another 10 seconds the xFSTK tool completes and the board resets. About + 10 seconds after that should see the above message again and then within a + few seconds U-Boot should start on your board: + +.. code-block:: none + + U-Boot 2020.10-rc3-00032-gd9f6680e925-dirty (Sep 03 2020 - 18:44:28 -0600) + + CPU: Genuine Intel(R) CPU 4000 @ 500MHz + DRAM: 980.6 MiB + WDT: Started with servicing (60s timeout) + MMC: mmc at ff3fc000: 0, mmc at ff3fa000: 1 + Loading Environment from MMC... OK + In: serial + Out: serial + Err: serial + Saving Environment to MMC... Writing to redundant MMC(0)... OK + Saving Environment to MMC... Writing to MMC(0)... OK + Net: No ethernet found. + Hit any key to stop autoboot: 0 + Target:blank + Partitioning using GPT + Writing GPT: success! + Saving Environment to MMC... Writing to redundant MMC(0)... OK + Flashing already done... + 5442816 bytes read in 238 ms (21.8 MiB/s) + Valid Boot Flag + Setup Size = 0x00003c00 + Magic signature found + Using boot protocol version 2.0c + Linux kernel version 3.10.17-poky-edison+ (ferry at kalamata) #1 SMP PREEMPT Mon Jan 11 14:54:18 CET 2016 + Building boot_params at 0x00090000 + Loading bzImage at address 100000 (5427456 bytes) + Magic signature found + Kernel command line: "rootwait root=PARTUUID=ada722ed-6410-764e-8619-abff6f66e10e rootfstype=ext4 console=ttyMFD2 earlyprintk=ttyMFD2,keep loglevel=4 g_multi.ethernet_config=cdc systemd.unit=multi-user.target hardware_id=00 g_multi.iSerialNumber=2249baf774c675598661a63098c0ad41 g_multi.dev_addr=02:00:86:c0:ad:41 platform_mrfld_audio.audio_codec=dummy" + Magic signature found + + Starting kernel ... + + ... + + Poky (Yocto Project Reference Distro) 1.7.2 edison ttyMFD2 + + edison login: + +.. _xFSTK: https://community.intel.com/t5/Intel-Makers/Building-xFSTK-on-Ubuntu-14-04-32-bit-for-flashing-Edison/td-p/538081 +.. _drive: https://drive.google.com/drive/u/0/folders/1URPHrOk9-UBsh8hjv-7WwC0W6Fy61uAJSignature · 1 line
2.28.0.526.ge36021eeef-goog
Signature · 2 lines
With Best Regards, Andy Shevchenko
cover edison: Support for writing an xFSTK image
In reply to Simon GlassQuoted 11 lines · Simon Glass
At present it is painful to put Edison in a hardware lab because it has two separate recovery modes. When the board has a functioning U-Boot, DFU can be used. Otherwise an xFSTK image must be used.
This series converts Andy's script to a binman description so that U-Boot can produce an xFSTK image directly.
With this, I can put an Edison in my lab fairly easily.
The series is available at u-boot-dm/edison-working and is based on the reset binman series for sunxi.
Thanks for doing this! It will reduce burden when unbricking the board! I have few minor comments (individually per patch) and one ask to Cc next version to Ferry Toth <[email protected]>.
Quoted 35 lines
[1] https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f
Simon Glass (5):
x86: Use multiple images
binman: Show an error when a file is missing
binman: Support adding a U-Boot environment
x86: edison: Generate an image suitable for xFSTK
x86: edison: Add documentation for using am xFSTK imagearch/x86/cpu/tangier/Kconfig | 1 + arch/x86/dts/edison.dts | 34 ++++++ arch/x86/dts/u-boot.dtsi | 7 -- board/intel/edison/edison-environment.txt | 48 +++++++++ board/intel/edison/edison-mbr.dat | Bin 0 -> 512 bytes doc/board/intel/edison.rst | 120 ++++++++++++++++++++++ tools/binman/etype/blob.py | 7 +- tools/binman/etype/u_boot_env.py | 42 ++++++++ tools/binman/ftest.py | 38 +++++++ tools/binman/test/173_missing_blob.dts | 14 +++ tools/binman/test/174_env.dts | 20 ++++ tools/binman/test/175_env_no_size.dts | 19 ++++ tools/binman/test/176_env_too_small.dts | 20 ++++ 13 files changed, 360 insertions(+), 10 deletions(-) create mode 100644 board/intel/edison/edison-environment.txt create mode 100644 board/intel/edison/edison-mbr.dat create mode 100644 tools/binman/etype/u_boot_env.py create mode 100644 tools/binman/test/173_missing_blob.dts create mode 100644 tools/binman/test/174_env.dts create mode 100644 tools/binman/test/175_env_no_size.dts create mode 100644 tools/binman/test/176_env_too_small.dtsSignature · 1 line
2.28.0.526.ge36021eeef-goog
Signature · 2 lines
With Best Regards, Andy Shevchenko
cover edison: Support for writing an xFSTK image
Hi Andy,
Quoted 9 lines · Andy Shevchenko
Quoted 7 lines · Simon Glass
At present it is painful to put Edison in a hardware lab because it has two separate recovery modes. When the board has a functioning U-Boot, DFU can be used. Otherwise an xFSTK image must be used.
This series converts Andy's script to a binman description so that U-Boot can produce an xFSTK image directly.
Quoted 8 lines
Quoted 4 lines
With this, I can put an Edison in my lab fairly easily.
The series is available at u-boot-dm/edison-working and is based on the reset binman series for sunxi.
Thanks for doing this! It will reduce burden when unbricking the board! I have few minor comments (individually per patch) and one ask to Cc next version to Ferry Toth <[email protected]>.
OK will do.
I do have a question though. How does the board decide whether to wait for the xFSTK tool to connect? Sometimes when I reset it it, it does. Sometimes it goes straight into receiving application. I am not pressing any button other than reset. Once it makes it mind up, it seems to stick to it until the power is removed? But it is powered by USB too, so removing power is not so easy.
Regards,
Simon
cover edison: Support for writing an xFSTK image
Quoted 10 lines · Simon Glass
Quoted 1 line · Andy Shevchenko
On Thu, Sep 03, 2020 at 07:28:51PM -0600, Simon Glass wrote:
I do have a question though. How does the board decide whether to wait for the xFSTK tool to connect? Sometimes when I reset it it, it does. Sometimes it goes straight into receiving application. I am not pressing any button other than reset. Once it makes it mind up, it seems to stick to it until the power is removed? But it is powered by USB too, so removing power is not so easy.
It's a good question. I don't know the answer unfortunately. I think the parties that are involved here are PMIC and thus its firmware (I don't have access to it and even if ask will not get), DnX protocol, USB implementation on IFWI level (no access to me either). And I truly believe there are bugs in all of them, though I dunno if they are related to the above behaviour.
Btw, pressing the reset button helps?
Signature · 2 lines
With Best Regards, Andy Shevchenko
cover edison: Support for writing an xFSTK image
Hi Andy,
Quoted 13 lines · Andy Shevchenko
Quoted 10 lines · Simon Glass
Quoted 1 line · Andy Shevchenko
On Thu, Sep 03, 2020 at 07:28:51PM -0600, Simon Glass wrote:
I do have a question though. How does the board decide whether to wait for the xFSTK tool to connect? Sometimes when I reset it it, it does. Sometimes it goes straight into receiving application. I am not pressing any button other than reset. Once it makes it mind up, it seems to stick to it until the power is removed? But it is powered by USB too, so removing power is not so easy.
Quoted 7 lines
It's a good question. I don't know the answer unfortunately. I think the parties that are involved here are PMIC and thus its firmware (I don't have access to it and even if ask will not get), DnX protocol, USB implementation on IFWI level (no access to me either). And I truly believe there are bugs in all of them, though I dunno if they are related to the above behaviour.
Btw, pressing the reset button helps?
Pressing reset either boots quickly or waits 10 seconds for xFSTK to connect. It's like cracking a code and I haven't cracked it yet. I'll have another go at some point, and maybe finally get this board into my lab.
Regards,
Simon
cover edison: Support for writing an xFSTK image
Quoted 24 lines · Simon Glass
Hi Andy,
Quoted 13 lines · Andy Shevchenko
Quoted 10 lines · Simon Glass
Quoted 1 line · Andy Shevchenko
On Thu, Sep 03, 2020 at 07:28:51PM -0600, Simon Glass wrote:
I do have a question though. How does the board decide whether to wait for the xFSTK tool to connect? Sometimes when I reset it it, it does. Sometimes it goes straight into receiving application. I am not pressing any button other than reset. Once it makes it mind up, it seems to stick to it until the power is removed? But it is powered by USB too, so removing power is not so easy.
Quoted 7 lines
It's a good question. I don't know the answer unfortunately. I think the parties that are involved here are PMIC and thus its firmware (I don't have access to it and even if ask will not get), DnX protocol, USB implementation on IFWI level (no access to me either). And I truly believe there are bugs in all of them, though I dunno if they are related to the above behaviour.
Btw, pressing the reset button helps?
Quoted 4 lines
Pressing reset either boots quickly or waits 10 seconds for xFSTK to connect. It's like cracking a code and I haven't cracked it yet. I'll have another go at some point, and maybe finally get this board into my lab.
On a tangent, when it comes to lab stuff I picked up
https://www.yepkit.com/products/ykush a while back precisely for "device can be USB powered on purpose/accident" in order to have software-controlled USB ports I can bring up/down.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200907/e6db814c/attachment.sig>
cover edison: Support for writing an xFSTK image
Hi Tom,
Quoted 31 lines · Tom Rini
Quoted 24 lines · Simon Glass
Hi Andy,
Quoted 13 lines · Andy Shevchenko
Quoted 10 lines · Simon Glass
Quoted 1 line · Andy Shevchenko
On Thu, Sep 03, 2020 at 07:28:51PM -0600, Simon Glass wrote:
I do have a question though. How does the board decide whether to wait for the xFSTK tool to connect? Sometimes when I reset it it, it does. Sometimes it goes straight into receiving application. I am not pressing any button other than reset. Once it makes it mind up, it seems to stick to it until the power is removed? But it is powered by USB too, so removing power is not so easy.
Quoted 7 lines
It's a good question. I don't know the answer unfortunately. I think the parties that are involved here are PMIC and thus its firmware (I don't have access to it and even if ask will not get), DnX protocol, USB implementation on IFWI level (no access to me either). And I truly believe there are bugs in all of them, though I dunno if they are related to the above behaviour.
Btw, pressing the reset button helps?Quoted 4 lines
Pressing reset either boots quickly or waits 10 seconds for xFSTK to connect. It's like cracking a code and I haven't cracked it yet. I'll have another go at some point, and maybe finally get this board into my lab.
Quoted 4 lines
On a tangent, when it comes to lab stuff I picked up
https://www.yepkit.com/products/ykush a while back precisely for "device can be USB powered on purpose/accident" in order to have software-controlled USB ports I can bring up/down.
Actually that's very relevant. I did try that with Edison and it definitely does power off the board now. I keep thinking with just a bit more messing around I can nut it out. My first board turned out to have a problem with the slider switch which could have been part of the issue.
Regards,
Simon
cover edison: Support for writing an xFSTK image
Quoted 2 lines · Simon Glass
Quoted 1 line · Tom Rini
On Mon, Sep 07, 2020 at 07:57:12AM -0600, Simon Glass wrote:
...
Quoted 10 lines
Quoted 4 lines
On a tangent, when it comes to lab stuff I picked up
https://www.yepkit.com/products/ykush a while back precisely for "device can be USB powered on purpose/accident" in order to have software-controlled USB ports I can bring up/down.Actually that's very relevant. I did try that with Edison and it definitely does power off the board now. I keep thinking with just a bit more messing around I can nut it out. My first board turned out to have a problem with the slider switch which could have been part of the issue.
Btw, seems you are using Edison/Arduino one. It has more (electrical) issues that slider switch and so. I would recommend rather to buy another base board for it, like SparkFun or DFRobot (I recently bought the latter one, i.e. IO Expander for Intel Edison, and it works nicely, but I didn't check xFSTK extensively, only DFU).
Signature · 2 lines
With Best Regards, Andy Shevchenko
cover edison: Support for writing an xFSTK image
In reply to Simon GlassHi Simon,
Quoted 8 lines · Simon Glass
At present it is painful to put Edison in a hardware lab because it has two separate recovery modes. When the board has a functioning U-Boot, DFU can be used. Otherwise an xFSTK image must be used.
This series converts Andy's script to a binman description so that U-Boot can produce an xFSTK image directly.
Quoted 8 lines
With this, I can put an Edison in my lab fairly easily.
The series is available at u-boot-dm/edison-working and is based on the reset binman series for sunxi.
[1] https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f
This series does not apply on u-boot-x86/next.
Is this due to "the reset binman series for sunxi" not applied yet?
Regards,
Bin
cover edison: Support for writing an xFSTK image
Hi Bin,
Quoted 17 lines · Bin Meng
Hi Simon,
Quoted 13 lines · Simon Glass
At present it is painful to put Edison in a hardware lab because it has two separate recovery modes. When the board has a functioning U-Boot, DFU can be used. Otherwise an xFSTK image must be used.
This series converts Andy's script to a binman description so that U-Boot can produce an xFSTK image directly.
With this, I can put an Edison in my lab fairly easily.
The series is available at u-boot-dm/edison-working and is based on the reset binman series for sunxi.
Quoted 7 lines
Quoted 3 lines
[1] https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f
This series does not apply on u-boot-x86/next.
Is this due to "the reset binman series for sunxi" not applied yet?
Yes. It's in dm/next but I'll send a pull request upstream.
Regards,
Simon
cover edison: Support for writing an xFSTK image
Quoted 25 lines · Simon Glass
Hi Bin,
Quoted 21 lines · Bin Meng
Hi Simon,
Quoted 16 lines · Simon Glass
At present it is painful to put Edison in a hardware lab because it has two separate recovery modes. When the board has a functioning U-Boot, DFU can be used. Otherwise an xFSTK image must be used.
This series converts Andy's script to a binman description so that U-Boot can produce an xFSTK image directly.
With this, I can put an Edison in my lab fairly easily.
The series is available at u-boot-dm/edison-working and is based on the reset binman series for sunxi.
[1] https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f
Quoted 5 lines
Quoted 3 lines
This series does not apply on u-boot-x86/next.
Is this due to "the reset binman series for sunxi" not applied yet?
Yes. It's in dm/next but I'll send a pull request upstream.
Series applied to u-boot-x86/next, thanks!
cover edison: Support for writing an xFSTK image
Hi Simon,
Quoted 27 lines · Bin Meng
Quoted 25 lines · Simon Glass
Hi Bin,
Quoted 21 lines · Bin Meng
Hi Simon,
Quoted 16 lines · Simon Glass
At present it is painful to put Edison in a hardware lab because it has two separate recovery modes. When the board has a functioning U-Boot, DFU can be used. Otherwise an xFSTK image must be used.
This series converts Andy's script to a binman description so that U-Boot can produce an xFSTK image directly.
With this, I can put an Edison in my lab fairly easily.
The series is available at u-boot-dm/edison-working and is based on the reset binman series for sunxi.
[1] https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
This series does not apply on u-boot-x86/next.
Is this due to "the reset binman series for sunxi" not applied yet?
Yes. It's in dm/next but I'll send a pull request upstream.
Series applied to u-boot-x86/next, thanks!
This seems to break the build.
Could you please help look at it?
https://dev.azure.com/bmeng/GitHub/_build/results?buildId=295&view=results
Regards,
Bin
cover edison: Support for writing an xFSTK image
Hi Bin,
Quoted 35 lines · Bin Meng
Hi Simon,
Quoted 31 lines · Bin Meng
Quoted 29 lines · Simon Glass
Hi Bin,
Quoted 24 lines · Bin Meng
Hi Simon,
Quoted 8 lines · Simon Glass
At present it is painful to put Edison in a hardware lab because it has two separate recovery modes. When the board has a functioning U-Boot, DFU can be used. Otherwise an xFSTK image must be used.
This series converts Andy's script to a binman description so that U-Boot can produce an xFSTK image directly.
Quoted 8 lines
With this, I can put an Edison in my lab fairly easily.
The series is available at u-boot-dm/edison-working and is based on the reset binman series for sunxi.
[1] https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f
This series does not apply on u-boot-x86/next.
Is this due to "the reset binman series for sunxi" not applied yet?
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Yes. It's in dm/next but I'll send a pull request upstream.
Series applied to u-boot-x86/next, thanks!
This seems to break the build.
Could you please help look at it?
https://dev.azure.com/bmeng/GitHub/_build/results?buildId=295&view=results
OK yes it looks like I dropped a patch perhaps. I'll send a fix-up.
Regards,
Simon