]> git.sur5r.net Git - u-boot/commitdiff
Merge git://git.denx.de/u-boot-marvell
authorTom Rini <trini@konsulko.com>
Tue, 29 May 2018 15:01:46 +0000 (11:01 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 29 May 2018 15:01:46 +0000 (11:01 -0400)
arch/arm/dts/dragonboard820c.dts
arch/arm/mach-snapdragon/Kconfig
drivers/mtd/ubi/fastmap-wl.c
include/dt_table.h [new file with mode: 0644]

index 7bfae1c42669e893595f51dc18e7d075a7e9e3fa..7457d7b7e3ff2ab7e324019026d8090ab37c35e6 100644 (file)
@@ -50,6 +50,7 @@
                blsp2_uart1: serial@75b0000 {
                        compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
                        reg = <0x75b0000 0x1000>;
+                       clock = <&gcc 4>;
                };
 
                sdhc2: sdhci@74a4900 {
index d55dc1aaa1d02212117bedd44692a19c5cadb2e6..bfd99db6e271ae901dc50dc859ab06da589d0a6c 100644 (file)
@@ -3,6 +3,12 @@ if ARCH_SNAPDRAGON
 config SYS_SOC
        default "snapdragon"
 
+config SYS_MALLOC_F_LEN
+       default 0x2000
+
+config SPL_SYS_MALLOC_F_LEN
+       default 0x2000
+
 choice
        prompt "Snapdragon board select"
 
index 675e487ae8c8f9feed11f1ae03cce30b39ef31f9..4cb1377c4257c507330c5a0dc0d8a1362e3abed0 100644 (file)
@@ -169,6 +169,30 @@ void ubi_refill_pools(struct ubi_device *ubi)
        spin_unlock(&ubi->wl_lock);
 }
 
+/**
+ * produce_free_peb - produce a free physical eraseblock.
+ * @ubi: UBI device description object
+ *
+ * This function tries to make a free PEB by means of synchronous execution of
+ * pending works. This may be needed if, for example the background thread is
+ * disabled. Returns zero in case of success and a negative error code in case
+ * of failure.
+ */
+static int produce_free_peb(struct ubi_device *ubi)
+{
+       int err;
+
+       while (!ubi->free.rb_node && ubi->works_count) {
+               dbg_wl("do one work synchronously");
+               err = do_work(ubi);
+
+               if (err)
+                       return err;
+       }
+
+       return 0;
+}
+
 /**
  * ubi_wl_get_peb - get a physical eraseblock.
  * @ubi: UBI device description object
@@ -211,6 +235,11 @@ again:
                }
                retried = 1;
                up_read(&ubi->fm_eba_sem);
+               ret = produce_free_peb(ubi);
+               if (ret < 0) {
+                       down_read(&ubi->fm_eba_sem);
+                       goto out;
+               }
                goto again;
        }
 
diff --git a/include/dt_table.h b/include/dt_table.h
new file mode 100644 (file)
index 0000000..7fb16e9
--- /dev/null
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * This is from the Android Project,
+ * Repository: https://android.googlesource.com/platform/system/libufdt
+ * File: utils/src/dt_table.h
+ * Commit: 2626d8b9e4d8e8c6cc67ceb1dc4e05a47779785c
+ * Copyright (C) 2017 The Android Open Source Project
+ */
+
+#ifndef DT_TABLE_H
+#define DT_TABLE_H
+
+#include <linux/types.h>
+
+#define DT_TABLE_MAGIC                 0xd7b7ab1e
+#define DT_TABLE_DEFAULT_PAGE_SIZE     2048
+#define DT_TABLE_DEFAULT_VERSION       0
+
+struct dt_table_header {
+       u32 magic;              /* DT_TABLE_MAGIC */
+       u32 total_size;         /* includes dt_table_header + all dt_table_entry
+                                * and all dtb/dtbo
+                                */
+       u32 header_size;        /* sizeof(dt_table_header) */
+
+       u32 dt_entry_size;      /* sizeof(dt_table_entry) */
+       u32 dt_entry_count;     /* number of dt_table_entry */
+       u32 dt_entries_offset;  /* offset to the first dt_table_entry
+                                * from head of dt_table_header.
+                                * The value will be equal to header_size if
+                                * no padding is appended
+                                */
+       u32 page_size;          /* flash page size we assume */
+       u32 version;            /* DTBO image version, the current version is 0.
+                                * The version will be incremented when the
+                                * dt_table_header struct is updated.
+                                */
+};
+
+struct dt_table_entry {
+       u32 dt_size;
+       u32 dt_offset;          /* offset from head of dt_table_header */
+
+       u32 id;                 /* optional, must be zero if unused */
+       u32 rev;                /* optional, must be zero if unused */
+       u32 custom[4];          /* optional, must be zero if unused */
+};
+
+#endif