Browse Source

Merge branch '2020-04-27-master-imports'

- Assorted bugfixes.
- Documentation improvements including support for https://u-boot.readthedocs.io/
Tom Rini 4 years ago
parent
commit
08977f873f
11 changed files with 60 additions and 31 deletions
  1. 19 0
      .readthedocs.yml
  2. 3 1
      Makefile
  3. 4 5
      cmd/mem.c
  4. 2 0
      doc/conf.py
  5. 2 2
      doc/sphinx/parse-headers.pl
  6. 3 0
      fs/ext4/ext4_journal.c
  7. 16 15
      lib/zlib/trees.c
  8. 4 0
      net/Kconfig
  9. 1 6
      net/tftp.c
  10. 3 2
      test/py/tests/test_fs/conftest.py
  11. 3 0
      tools/env/fw_env.c

+ 19 - 0
.readthedocs.yml

@@ -0,0 +1,19 @@
+# .readthedocs.yml
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Required
+version: 2
+
+# Build documentation in the docs/ directory with Sphinx
+sphinx:
+  configuration: docs/conf.py
+
+# Optionally build your docs in additional formats such as PDF and ePub
+formats: []
+
+# Optionally set the version of Python and requirements required to build your docs
+# python:
+#   version: 3.7
+#   install:
+#     - requirements: docs/requirements.txt

+ 3 - 1
Makefile

@@ -1325,7 +1325,9 @@ endif
 # Boards with more complex image requirements can provide an .its source file
 # or a generator script
 ifneq ($(CONFIG_SPL_FIT_SOURCE),"")
-U_BOOT_ITS = $(subst ",,$(CONFIG_SPL_FIT_SOURCE))
+U_BOOT_ITS := u-boot.its
+$(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE))
+	$(call if_changed,copy)
 else
 ifneq ($(CONFIG_SPL_FIT_GENERATOR),"")
 U_BOOT_ITS := u-boot.its

+ 4 - 5
cmd/mem.c

@@ -1144,10 +1144,8 @@ static int do_random(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	unsigned char *buf8;
 	unsigned int i;
 
-	if (argc < 3 || argc > 4) {
-		printf("usage: %s <addr> <len> [<seed>]\n", argv[0]);
-		return 0;
-	}
+	if (argc < 3 || argc > 4)
+		return CMD_RET_USAGE;
 
 	len = simple_strtoul(argv[2], NULL, 16);
 	addr = simple_strtoul(argv[1], NULL, 16);
@@ -1174,7 +1172,8 @@ static int do_random(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	unmap_sysmem(start);
 	printf("%lu bytes filled with random data\n", len);
-	return 1;
+
+	return CMD_RET_SUCCESS;
 }
 #endif
 

+ 2 - 0
doc/conf.py

@@ -31,6 +31,8 @@ from load_config import loadConfig
 # If your documentation needs a minimal Sphinx version, state it here.
 needs_sphinx = '1.3'
 
+latex_engine = 'xelatex'
+
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.

+ 2 - 2
doc/sphinx/parse-headers.pl

@@ -344,7 +344,7 @@ enums and defines and create cross-references to a Sphinx book.
 
 B<parse_headers.pl> [<options>] <C_FILE> <OUT_FILE> [<EXCEPTIONS_FILE>]
 
-Where <options> can be: --debug, --help or --man.
+Where <options> can be: --debug, --help or --usage.
 
 =head1 OPTIONS
 
@@ -382,7 +382,7 @@ ioctl.
 The EXCEPTIONS_FILE contain two rules to allow ignoring a symbol or
 to replace the default references by a custom one.
 
-Please read doc/doc-guide/parse-headers.rst at the Kernel's
+Please read Documentation/doc-guide/parse-headers.rst at the Kernel's
 tree for more details.
 
 =head1 BUGS

+ 3 - 0
fs/ext4/ext4_journal.c

@@ -409,6 +409,9 @@ int ext4fs_check_journal_state(int recovery_flag)
 	char *temp_buff1 = NULL;
 	struct ext_filesystem *fs = get_fs();
 
+	if (le32_to_cpu(fs->sb->feature_ro_compat) & EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)
+		return 0;
+
 	temp_buff = zalloc(fs->blksz);
 	if (!temp_buff)
 		return -ENOMEM;

+ 16 - 15
lib/zlib/trees.c

@@ -7,27 +7,28 @@
 /*
  *  ALGORITHM
  *
- *      The "deflation" process uses several Huffman trees. The more
- *      common source values are represented by shorter bit sequences.
+ *	The "deflation" process uses several Huffman trees. The more
+ *	common source values are represented by shorter bit sequences.
  *
- *      Each code tree is stored in a compressed form which is itself
- * a Huffman encoding of the lengths of all the code strings (in
- * ascending order by source values).  The actual code strings are
- * reconstructed from the lengths in the inflate process, as described
- * in the deflate specification.
+ *	Each code tree is stored in a compressed form which is itself
+ *	a Huffman encoding of the lengths of all the code strings (in
+ *	ascending order by source values). The actual code strings are
+ *	reconstructed from the lengths in the inflate process, as
+ *	described in the deflate specification.
  *
  *  REFERENCES
  *
- *      Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
- *      Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
+ *	Deutsch, P.
+ *	    RFC 1951, DEFLATE Compressed Data Format Specification version 1.3
+ *	    https://tools.ietf.org/html/rfc1951, 1996
  *
- *      Storer, James A.
- *          Data Compression:  Methods and Theory, pp. 49-50.
- *          Computer Science Press, 1988.  ISBN 0-7167-8156-5.
+ *	Storer, James A.
+ *	    Data Compression:  Methods and Theory, pp. 49-50.
+ *	    Computer Science Press, 1988.  ISBN 0-7167-8156-5.
  *
- *      Sedgewick, R.
- *          Algorithms, p290.
- *          Addison-Wesley, 1983. ISBN 0-201-06672-6.
+ *	Sedgewick, R.
+ *	    Algorithms, p290.
+ *	    Addison-Wesley, 1983. ISBN 0-201-06672-6.
  */
 
 /* @(#) $Id$ */

+ 4 - 0
net/Kconfig

@@ -44,5 +44,9 @@ config TFTP_BLOCKSIZE
 	default 1468
 	help
 	  Default TFTP block size.
+	  The MTU is typically 1500 for ethernet, so a TFTP block of
+	  1468 (MTU minus eth.hdrs) provides a good throughput with
+	  almost-MTU block sizes.
+	  You can also activate CONFIG_IP_DEFRAG to set a larger block.
 
 endif   # if NET

+ 1 - 6
net/tftp.c

@@ -133,14 +133,9 @@ static char tftp_filename[MAX_LEN];
  * almost-MTU block sizes.  At least try... fall back to 512 if need be.
  * (but those using CONFIG_IP_DEFRAG may want to set a larger block in cfg file)
  */
-#ifdef CONFIG_TFTP_BLOCKSIZE
-#define TFTP_MTU_BLOCKSIZE CONFIG_TFTP_BLOCKSIZE
-#else
-#define TFTP_MTU_BLOCKSIZE 1468
-#endif
 
 static unsigned short tftp_block_size = TFTP_BLOCK_SIZE;
-static unsigned short tftp_block_size_option = TFTP_MTU_BLOCKSIZE;
+static unsigned short tftp_block_size_option = CONFIG_TFTP_BLOCKSIZE;
 
 static inline int store_block(int block, uchar *src, unsigned int len)
 {

+ 3 - 2
test/py/tests/test_fs/conftest.py

@@ -335,8 +335,9 @@ def fs_obj_basic(request, u_boot_config):
         md5val.append(out.split()[0])
 
         umount_fs(mount_dir)
-    except CalledProcessError:
-        pytest.skip('Setup failed for filesystem: ' + fs_type)
+    except CalledProcessError as err:
+        pytest.skip('Setup failed for filesystem: ' + fs_type + \
+            '. {}'.format(err))
         return
     else:
         yield [fs_ubtype, fs_img, md5val]

+ 3 - 0
tools/env/fw_env.c

@@ -1647,6 +1647,9 @@ static int check_device_config(int dev)
 			goto err;
 		}
 		DEVTYPE(dev) = mtdinfo.type;
+		if (DEVESIZE(dev) == 0 && ENVSECTORS(dev) == 0 &&
+		    mtdinfo.type == MTD_NORFLASH)
+			DEVESIZE(dev) = mtdinfo.erasesize;
 		if (DEVESIZE(dev) == 0)
 			/* Assume the erase size is the same as the env-size */
 			DEVESIZE(dev) = ENVSIZE(dev);