Re: [U-Boot] [PATCH] dm: core: Widen the dump tree to show more of the driver's name.

2018-09-28 Thread Simon Glass
Hi,

On 17 September 2018 at 20:06, Simon Glass  wrote:
> On 17 September 2018 at 10:57, Liviu Dudau  wrote:
>> With drivers that have prefix names that are quite long (like
>> 'versatile_') it is useful to have a wider column for the driver's
>> name when dumping the device driver tree.
>>
>> Signed-off-by: Liviu Dudau 
>> ---
>>  drivers/core/dump.c | 8 
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> Reviewed-by: Simon Glass 

Unfortunately this seems to break some tests (make tests). Please can
you take a look?

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/2] efi_selftest: creating new handle in controller test

2018-09-28 Thread Heinrich Schuchardt
When the last protocol interface is uninstalled the handle is deleted but
this does not set the value of the handle to NULL.

To create a new handle with OpenProtocolInterface the value of the handle
must be NULL.

Signed-off-by: Heinrich Schuchardt 
---
 lib/efi_selftest/efi_selftest_controllers.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/efi_selftest/efi_selftest_controllers.c 
b/lib/efi_selftest/efi_selftest_controllers.c
index e8a80d778da..38720bb63d3 100644
--- a/lib/efi_selftest/efi_selftest_controllers.c
+++ b/lib/efi_selftest/efi_selftest_controllers.c
@@ -134,6 +134,8 @@ static efi_status_t EFIAPI start(
 
/* Create child controllers */
for (i = 0; i < NUMBER_OF_CHILD_CONTROLLERS; ++i) {
+   /* Creating a new handle for the child controller */
+   handle_child_controller[i] = 0;
ret = boottime->install_protocol_interface(
_child_controller[i], _child_controller,
EFI_NATIVE_INTERFACE, NULL);
-- 
2.19.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 0/2] efi_loader: delete handles

2018-09-28 Thread Heinrich Schuchardt
When the last protocol interface has been uninstalled remove the handle.
Adjust ReinstallProtocol so that it does not remove the handle.

Correct the unit test for controllers.

Heinrich Schuchardt (2):
  efi_selftest: creating new handle in controller test
  efi_loader: delete handles

 lib/efi_loader/efi_boottime.c   | 81 -
 lib/efi_selftest/efi_selftest_controllers.c |  2 +
 2 files changed, 63 insertions(+), 20 deletions(-)

-- 
2.19.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] efi_loader: delete handles

2018-09-28 Thread Heinrich Schuchardt
When the last protocol interface has been uninstalled remove the handle.

Adjust ReinstallProtocol so that it does not remove the handle.

Signed-off-by: Heinrich Schuchardt 
---
 lib/efi_loader/efi_boottime.c | 81 ++-
 1 file changed, 61 insertions(+), 20 deletions(-)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 5acd04b3842..b716498fbaa 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1155,21 +1155,19 @@ static efi_status_t efi_disconnect_all_drivers
 }
 
 /**
- * efi_uninstall_protocol_interface() - uninstall protocol interface
+ * efi_uninstall_protocol() - uninstall protocol interface
+ *
  * @handle: handle from which the protocol shall be removed
  * @protocol:   GUID of the protocol to be removed
  * @protocol_interface: interface to be removed
  *
- * This function implements the UninstallProtocolInterface service.
- *
- * See the Unified Extensible Firmware Interface (UEFI) specification for
- * details.
+ * This function DOES NOT delete a handle without installed protocol.
  *
  * Return: status code
  */
-static efi_status_t EFIAPI efi_uninstall_protocol_interface(
-   efi_handle_t handle, const efi_guid_t *protocol,
-   void *protocol_interface)
+static efi_status_t efi_uninstall_protocol
+   (efi_handle_t handle, const efi_guid_t *protocol,
+void *protocol_interface)
 {
struct efi_object *efiobj;
struct efi_handler *handler;
@@ -1177,8 +1175,6 @@ static efi_status_t EFIAPI 
efi_uninstall_protocol_interface(
struct efi_open_protocol_info_item *pos;
efi_status_t r;
 
-   EFI_ENTRY("%p, %pUl, %p", handle, protocol, protocol_interface);
-
/* Check handle */
efiobj = efi_search_obj(handle);
if (!efiobj) {
@@ -1209,7 +1205,41 @@ static efi_status_t EFIAPI 
efi_uninstall_protocol_interface(
}
r = efi_remove_protocol(handle, protocol, protocol_interface);
 out:
-   return EFI_EXIT(r);
+   return r;
+}
+
+/**
+ * efi_uninstall_protocol_interface() - uninstall protocol interface
+ * @handle: handle from which the protocol shall be removed
+ * @protocol:   GUID of the protocol to be removed
+ * @protocol_interface: interface to be removed
+ *
+ * This function implements the UninstallProtocolInterface service.
+ *
+ * See the Unified Extensible Firmware Interface (UEFI) specification for
+ * details.
+ *
+ * Return: status code
+ */
+static efi_status_t EFIAPI efi_uninstall_protocol_interface
+   (efi_handle_t handle, const efi_guid_t *protocol,
+void *protocol_interface)
+{
+   efi_status_t ret;
+
+   EFI_ENTRY("%p, %pUl, %p", handle, protocol, protocol_interface);
+
+   ret = efi_uninstall_protocol(handle, protocol, protocol_interface);
+   if (ret != EFI_SUCCESS)
+   goto out;
+
+   /* If the last protocol has been removed, delete the handle. */
+   if (list_empty(>protocols)) {
+   list_del(>link);
+   free(handle);
+   }
+out:
+   return EFI_EXIT(ret);
 }
 
 /**
@@ -2357,16 +2387,21 @@ static efi_status_t EFIAPI 
efi_uninstall_multiple_protocol_interfaces(
if (!protocol)
break;
protocol_interface = efi_va_arg(argptr, void*);
-   r = EFI_CALL(efi_uninstall_protocol_interface(
-   handle, protocol,
-   protocol_interface));
+   r = efi_uninstall_protocol(handle, protocol,
+  protocol_interface);
if (r != EFI_SUCCESS)
break;
i++;
}
efi_va_end(argptr);
-   if (r == EFI_SUCCESS)
+   if (r == EFI_SUCCESS) {
+   /* If the last protocol has been removed, delete the handle. */
+   if (list_empty(>protocols)) {
+   list_del(>link);
+   free(handle);
+   }
return EFI_EXIT(r);
+   }
 
/* If an error occurred undo all changes. */
efi_va_start(argptr, handle);
@@ -2828,13 +2863,19 @@ static efi_status_t EFIAPI 
efi_reinstall_protocol_interface(
 
EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, old_interface,
  new_interface);
-   ret = EFI_CALL(efi_uninstall_protocol_interface(handle, protocol,
-   old_interface));
+
+   /* Uninstall protocol but do not delete handle */
+   ret = efi_uninstall_protocol(handle, protocol, old_interface);
if (ret != EFI_SUCCESS)
goto out;
-   ret = EFI_CALL(efi_install_protocol_interface(, protocol,
-  

Re: [U-Boot] [PATCH v8 08/15] regmap: Add raw read/write functions

2018-09-28 Thread Daniel Schwierzeck


On 28.09.2018 09:16, Mario Six wrote:
> Hi Daniel,
> On Thu, Sep 27, 2018 at 1:28 PM Daniel Schwierzeck
>  wrote:
>>
>> Hi Mario,
>>
>> Am Do., 27. Sep. 2018 um 11:48 Uhr schrieb Mario Six :
>>>
>>> The regmap functions currently assume that all register map accesses
>>> have a data width of 32 bits, but there are maps that have different
>>> widths.
>>>
>>> To rectify this, implement the regmap_raw_read and regmap_raw_write
>>> functions from the Linux kernel API that specify the width of a desired
>>> read or write operation on a regmap.
>>>
>>> Implement the regmap_read and regmap_write functions using these raw
>>> functions in a backwards-compatible manner.
>>>
>>> Reviewed-by: Anatolij Gustschin 
>>> Signed-off-by: Mario Six 
>>>
>>> ---
>>>
>>> v7 -> v8:
>>> No changes
>>>
>>> v6 -> v7:
>>> * Fixed wrong variable type in 64-bit read (u32 -> u64)
>>> * Added 64-bit case in write function
>>>
>>> v5 -> v6:
>>> * Corrected format specifier
>>> * Added support for 64-bit reads/writes
>>>
>>> v4 -> v5:
>>> No changes
>>>
>>> v3 -> v4:
>>> * Switched 'ranges[0] + offset' to 'ranges[0].start + offset'
>>> * Explained the difference between the raw and non-raw read/write
>>>   functions better in the docs
>>>
>>> v2 -> v3:
>>> * Implement the "raw" functions from Linux instead of adding a size
>>>   parameter to the regmap_{read,write} functions
>>> * Fixed style violation
>>> * Improved error handling
>>>
>>> v1 -> v2:
>>> New in v2
>>>
>>> ---
>>>  drivers/core/regmap.c | 64 
>>> +--
>>>  include/regmap.h  | 58 ++
>>>  2 files changed, 115 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/core/regmap.c b/drivers/core/regmap.c
>>> index 154426269d9..1025099797f 100644
>>> --- a/drivers/core/regmap.c
>>> +++ b/drivers/core/regmap.c
>>> @@ -188,22 +188,72 @@ int regmap_uninit(struct regmap *map)
>>> return 0;
>>>  }
>>>
>>> +int regmap_raw_read(struct regmap *map, uint offset, void *valp, size_t 
>>> val_len)
>>> +{
>>> +   void *ptr;
>>> +
>>> +   ptr = map_physmem(map->ranges[0].start + offset, val_len, 
>>> MAP_NOCACHE);
>>> +
>>> +   switch (val_len) {
>>> +   case REGMAP_SIZE_8:
>>> +   *((u8 *)valp) = in_8((u8 *)ptr);
>>> +   break;
>>> +   case REGMAP_SIZE_16:
>>> +   *((u16 *)valp) = in_le16((u16 *)ptr);
>>> +   break;
>>> +   case REGMAP_SIZE_32:
>>> +   *((u32 *)valp) = in_le32((u32 *)ptr);
>>> +   break;
>>> +#if defined(in_le64) && defined(readq)
>>> +   case REGMAP_SIZE_64:
>>> +   *((u64 *)valp) = in_le64((u64 *)ptr);
>>> +   break;
>>> +#endif
>>> +   default:
>>> +   debug("%s: regmap size %zu unknown\n", __func__, val_len);
>>> +   return -EINVAL;
>>> +   }
>>> +   return 0;
>>> +}
>>
>> I'm still not convinced why you want to enforce Little Endian here.
>> This makes regmap unuseable on archs like MIPS or PowerPC.
>>
>> Typically a SoC with a MIPS CPU core can have an AMBA bus or other LE
>> based sub-systems. Some SoCs can select the endianess of the CPU core
>> via pin strapping. Normally the endianess conversion is automatically
>> done in HW.
>>
>> So I suggest to simply use readl or __raw_readl to support native
>> endianess as default. Later we could add a DT properties
>> "native-endian", "big-endian" and "little-endian" like in the Linux
>> implementation.
>>
> Ironically, we want to use the interface on a PowerPC platform :-) (for a
> little-endian FPGA interface that's not auto-translating). But I do see your
> point.
> 
> I just finished testing a v9 of this series that implements support for the
> "native-endian", "big-endian", and "little-endian" DT properties (and uses
> native-endian as the default). That way we can use the interface on our
> platform, and native-endian is the default, so MIPS should be able to use
> regmap too.
> 
> I think that should solve the problem adequately for everyone.
> 

looks good, thank you.

-- 
- Daniel



signature.asc
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] sf: remove spi-flash chip names from SPL binary

2018-09-28 Thread Simon Goldschmidt

On 28.09.2018 19:20, Jagan Teki wrote:

On Fri, Aug 17, 2018 at 12:23 PM Simon Goldschmidt
 wrote:

The table of spi flash chips 'spi_flash_ids' currently
includes chip names. The only usage of these is to
print the name when the chip is probed.

Since this message is not shown in SPL, we can remove
the names from the SPL binary.

Removing the chip names saves ~890 Byte from the SPL
binary in my configuration (socfpga_socrates_defconfig,
MACRONIX, SPANSION and STMICRO enabled).

Signed-off-by: Simon Goldschmidt 
---

  drivers/mtd/spi/sf_internal.h   |  10 ++
  drivers/mtd/spi/spi_flash.c |   7 +-
  drivers/mtd/spi/spi_flash_ids.c | 270 +---
  3 files changed, 156 insertions(+), 131 deletions(-)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 4f63cacc64..e5f91ca952 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -113,9 +113,18 @@ int sst_write_bp(struct spi_flash *flash, u32 offset, 
size_t len,
  #define JEDEC_EXT(info)(((info)->id[3]) << 8 | 
((info)->id[4]))
  #define SPI_FLASH_MAX_ID_LEN   6

+/* Exclude chip names for SPL to save space */
+#ifdef CONFIG_SPL_BUILD
+#define SPI_FLASH_INCLUDE_NAME 0
+#else
+#define SPI_FLASH_INCLUDE_NAME 1

No need for extra macro, define macros wherever needed and expand SPL
and non-SPL?


So directly use #ifdef CONFIG_SPL_BUILD everywhere instead of 
SPI_FLASH_INCLUDE_NAME? No problem.




+#endif
+
  struct spi_flash_info {
+#if SPI_FLASH_INCLUDE_NAME
 /* Device name ([MANUFLETTER][DEVTYPE][DENSITY][EXTRAINFO]) */
 const char  *name;
+#endif

 /*
  * This array stores the ID bytes.
@@ -147,6 +156,7 @@ struct spi_flash_info {
  };


[snip]


 {}, /* Empty entry to terminate the list */
 /*
@@ -205,3 +213,5 @@ const struct spi_flash_info spi_flash_ids[] = {
  * (w25q256fw, w25q256fv_qpi)
  */
  };
+
+const size_t spi_flash_ids_size = ARRAY_SIZE(spi_flash_ids);

Check array size directly in for loop.


That desn't work as the array is defined in spi_flash_ids.c and the for 
loop in spi_flash.c doesn't know its size at compile time.


I can change the code to check for 'info->sector_size != 0' instead of 
'info->name != NULL' if this is preferred.



Simon

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 00/15] test: Various test refinements and improvements

2018-09-28 Thread Simon Glass
Hi,

On 23 September 2018 at 16:47, Simon Glass  wrote:
>
> This series includes a number of small changes designed to make tests run
> more smoothly. The overall goal is that 'make check' runs cleanly without
> unnecessary output and all temporary files aare cleaned up.
>
>
> Simon Glass (15):
>   sandbox: Unprotect DATA regions in bus tests
>   patman: Handle unicode in _ProjectConfigParser tests
>   test/py: Fix unicode handling for log filtering
>   buildman: Make the toolchain test more forgiving
>   binman: Reorder tests to put helper functions first
>   Makefile: Add a 'check' target for make
>   test: Simplify the PATH setup
>   test: Print the name of each test before running it
>   test: Tidy up comments and variable name
>   binman: Add a default path to libfdt.py
>   binman: Fix up removal of temporary directories
>   binman: Separate out testSplBssPad()
>   buildman: dtoc: Suppress unwanted output from test
>   tools: Set an initial value for indir
>   patman: Don't clear progress in tout unless it was used
>
>  Makefile   |   6 +-
>  arch/sandbox/cpu/os.c  |  11 ++
>  include/os.h   |  11 ++
>  test/dm/bus.c  |  12 ++
>  test/py/multiplexed_log.py |   7 +-
>  test/run   |  50 ---
>  tools/binman/binman.py |   2 +
>  tools/binman/elf_test.py   |   5 +
>  tools/binman/entry_test.py |   8 +-
>  tools/binman/fdt_test.py   |   4 +
>  tools/binman/ftest.py  | 261 ++---
>  tools/buildman/test.py |   8 +-
>  tools/dtoc/dtoc.py |   5 +
>  tools/dtoc/test_dtoc.py|   6 +-
>  tools/dtoc/test_fdt.py |  10 +-
>  tools/patman/settings.py   |  27 +++-
>  tools/patman/tools.py  |   3 +
>  tools/patman/tout.py   |   8 +-
>  18 files changed, 273 insertions(+), 171 deletions(-)
>
> --
> 2.19.0.444.g18242da7ef-goog
>

If any of you have time to try this out on your setup I would
appreciate it. I am planning to pull it in for rc1 if I can, but it
has only been on the list 5 days.

It's at dm/testing-working

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] sf: remove spi-flash chip names from SPL binary

2018-09-28 Thread Jagan Teki
On Fri, Aug 17, 2018 at 12:23 PM Simon Goldschmidt
 wrote:
>
> The table of spi flash chips 'spi_flash_ids' currently
> includes chip names. The only usage of these is to
> print the name when the chip is probed.
>
> Since this message is not shown in SPL, we can remove
> the names from the SPL binary.
>
> Removing the chip names saves ~890 Byte from the SPL
> binary in my configuration (socfpga_socrates_defconfig,
> MACRONIX, SPANSION and STMICRO enabled).
>
> Signed-off-by: Simon Goldschmidt 
> ---
>
>  drivers/mtd/spi/sf_internal.h   |  10 ++
>  drivers/mtd/spi/spi_flash.c |   7 +-
>  drivers/mtd/spi/spi_flash_ids.c | 270 +---
>  3 files changed, 156 insertions(+), 131 deletions(-)
>
> diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
> index 4f63cacc64..e5f91ca952 100644
> --- a/drivers/mtd/spi/sf_internal.h
> +++ b/drivers/mtd/spi/sf_internal.h
> @@ -113,9 +113,18 @@ int sst_write_bp(struct spi_flash *flash, u32 offset, 
> size_t len,
>  #define JEDEC_EXT(info)(((info)->id[3]) << 8 | 
> ((info)->id[4]))
>  #define SPI_FLASH_MAX_ID_LEN   6
>
> +/* Exclude chip names for SPL to save space */
> +#ifdef CONFIG_SPL_BUILD
> +#define SPI_FLASH_INCLUDE_NAME 0
> +#else
> +#define SPI_FLASH_INCLUDE_NAME 1

No need for extra macro, define macros wherever needed and expand SPL
and non-SPL?

> +#endif
> +
>  struct spi_flash_info {
> +#if SPI_FLASH_INCLUDE_NAME
> /* Device name ([MANUFLETTER][DEVTYPE][DENSITY][EXTRAINFO]) */
> const char  *name;
> +#endif
>
> /*
>  * This array stores the ID bytes.
> @@ -147,6 +156,7 @@ struct spi_flash_info {
>  };
>

[snip]

> {}, /* Empty entry to terminate the list */
> /*
> @@ -205,3 +213,5 @@ const struct spi_flash_info spi_flash_ids[] = {
>  * (w25q256fw, w25q256fv_qpi)
>  */
>  };
> +
> +const size_t spi_flash_ids_size = ARRAY_SIZE(spi_flash_ids);

Check array size directly in for loop.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] Pull request: u-boot-sunxi/master

2018-09-28 Thread Jagan Teki
Hi Tom,

Please pull this PR.

thanks,
Jagan.

The following changes since commit bbef20d479441b01d62252cf127498c58078b2c3:

  Merge tag 'xilinx-for-v2018.11' of git://git.denx.de/u-boot-microblaze 
(2018-09-27 08:29:10 -0400)

are available in the Git repository at:

  git://git.denx.de/u-boot-sunxi.git master

for you to fetch changes up to 9ad93c0c968c8e6cd1273b73c44ec7262c616408:

  ARM: dts: sun8i: Update A23/A33/r16 dts(i) files from Linux-v4.18-rc3 
(2018-09-28 22:09:24 +0530)


Jagan Teki (5):
  ARM: dts: sun4i: Update A10 dts(i) files from Linux-v4.18-rc3
  ARM: dts: sun5i: Update A10s/A13/gr8/r8 dts(i) files from Linux-v4.18-rc3
  ARM: dts: sun6i: Update A31/A31s dts(i) files from Linux-v4.18-rc3
  ARM: dts: sun7i: Update A20 dts(i) files from Linux-v4.18-rc3
  ARM: dts: sun8i: Update A23/A33/r16 dts(i) files from Linux-v4.18-rc3

 arch/arm/dts/axp209.dtsi   |   17 +-
 arch/arm/dts/sun4i-a10-a1000.dts   |   61 +-
 arch/arm/dts/sun4i-a10-ba10-tvbox.dts  |   23 +-
 arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts |   37 +-
 arch/arm/dts/sun4i-a10-cubieboard.dts  |   67 +-
 arch/arm/dts/sun4i-a10-dserve-dsrv9703c.dts|   76 +-
 arch/arm/dts/sun4i-a10-gemei-g9.dts|   28 +-
 arch/arm/dts/sun4i-a10-hackberry.dts   |   32 +-
 arch/arm/dts/sun4i-a10-hyundai-a7hd.dts|   31 +-
 arch/arm/dts/sun4i-a10-inet-3f.dts |2 +-
 arch/arm/dts/sun4i-a10-inet-3w.dts |2 +-
 arch/arm/dts/sun4i-a10-inet1.dts   |   58 +-
 arch/arm/dts/sun4i-a10-inet97fv2.dts   |   41 +-
 arch/arm/dts/sun4i-a10-inet9f-rev03.dts|  101 +-
 arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts|   24 +-
 arch/arm/dts/sun4i-a10-jesurun-q5.dts  |   34 +-
 arch/arm/dts/sun4i-a10-marsboard.dts   |   38 +-
 arch/arm/dts/sun4i-a10-mini-xplus.dts  |   16 +-
 arch/arm/dts/sun4i-a10-mk802.dts   |   59 +-
 arch/arm/dts/sun4i-a10-mk802ii.dts |9 +-
 arch/arm/dts/sun4i-a10-olinuxino-lime.dts  |   75 +-
 arch/arm/dts/sun4i-a10-pcduino.dts |   47 +-
 arch/arm/dts/sun4i-a10-pcduino2.dts|   11 -
 arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts|   89 +-
 arch/arm/dts/sun4i-a10.dtsi| 1349 --
 arch/arm/dts/sun5i-a10s-auxtek-t003.dts|   26 +-
 arch/arm/dts/sun5i-a10s-auxtek-t004.dts|   42 +-
 arch/arm/dts/sun5i-a10s-mk802.dts  |   24 +-
 arch/arm/dts/sun5i-a10s-olinuxino-micro.dts|   82 +-
 arch/arm/dts/sun5i-a10s-r7-tv-dongle.dts   |   24 +-
 arch/arm/dts/sun5i-a10s-wobo-i5.dts|   29 +-
 arch/arm/dts/sun5i-a10s.dtsi   |  224 +--
 arch/arm/dts/sun5i-a13-empire-electronix-d709.dts  |   29 +-
 arch/arm/dts/sun5i-a13-hsg-h702.dts|   29 +-
 arch/arm/dts/sun5i-a13-inet-98v-rev2.dts   |  164 +--
 arch/arm/dts/sun5i-a13-olinuxino-micro.dts |   44 +-
 arch/arm/dts/sun5i-a13-olinuxino.dts   |  100 +-
 arch/arm/dts/sun5i-a13-utoo-p66.dts|   49 +-
 arch/arm/dts/sun5i-a13.dtsi|  268 +---
 arch/arm/dts/sun5i-gr8-chip-pro.dts|   16 +-
 arch/arm/dts/sun5i-gr8.dtsi| 1082 +-
 arch/arm/dts/sun5i-r8-chip.dts |   91 +-
 arch/arm/dts/sun5i-r8.dtsi |   40 -
 arch/arm/dts/sun5i-reference-design-tablet.dtsi|   69 +-
 arch/arm/dts/sun5i.dtsi|  792 +-
 arch/arm/dts/sun6i-a31-app4-evb1.dts   |7 +-
 arch/arm/dts/sun6i-a31-colombus.dts|   26 +-
 arch/arm/dts/sun6i-a31-hummingbird.dts |  153 +-
 arch/arm/dts/sun6i-a31-i7.dts  |   82 +-
 arch/arm/dts/sun6i-a31-m9.dts  |   23 +-
 arch/arm/dts/sun6i-a31-mele-a1000g-quad.dts|   23 +-
 arch/arm/dts/sun6i-a31.dtsi| 1151 +--
 arch/arm/dts/sun6i-a31s-cs908.dts  |2 -
 arch/arm/dts/sun6i-a31s-primo81.dts|   69 +-
 arch/arm/dts/sun6i-a31s-sina31s-core.dtsi  |1 -
 arch/arm/dts/sun6i-a31s-sina31s.dts|   77 +-
 arch/arm/dts/sun6i-a31s-sinovoip-bpi-m2.dts|  154 +-
 .../arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts |   13 +-
 arch/arm/dts/sun6i-a31s.dtsi   |8 +
 arch/arm/dts/sun6i-reference-design-tablet.dtsi|   18 +-
 arch/arm/dts/sun7i-a20-bananapi-m1-plus.dts|   32 +-
 arch/arm/dts/sun7i-a20-bananapi.dts|  106 +-
 arch/arm/dts/sun7i-a20-bananapro.dts   |   73 +-
 arch/arm/dts/sun7i-a20-cubieboard2.dts |   56 +-
 arch/arm/dts/sun7i-a20-cubietruck.dts

Re: [U-Boot] [PATCH v5] spi: Add SPI driver for MT76xx SoCs

2018-09-28 Thread Jagan Teki
On Thu, Aug 16, 2018 at 2:19 PM Stefan Roese  wrote:
>
> This patch adds the SPI driver for the MediaTek MT7688 SoC (and
> derivates). Its been tested on the LinkIt Smart 7688 and the Gardena
> Smart Gateway with and SPI NOR on CS0 and on the Gardena Smart
> Gateway additionally with an SPI NAND on CS1.
>
> Note that the SPI controller only supports a max transfer size of 32
> bytes. This driver implementes a workaround to enable bigger xfer
> sizes to speed up the transfer especially for the SPI NAND support.
>
> Signed-off-by: Stefan Roese 
> Cc: Jagan Teki 
> Cc: Daniel Schwierzeck 
> Cc: Piotr Dymacz 
> Reviewed-by: Jagan Teki 
> Reviewed-by: Daniel Schwierzeck 
> ---

Applied to u-boot-spi/master
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] uclass: Use uclass_foreach_dev() macro instead of open coding

2018-09-28 Thread Simon Glass
Hi Livu,

On 28 September 2018 at 10:02, Liviu Dudau  wrote:
> On Fri, Sep 28, 2018 at 09:57:49AM -0600, Simon Glass wrote:
>> On 28 September 2018 at 06:12, Liviu Dudau  wrote:
>> > Use the uclass_foreach_dev() macro instead of the open coded version.
>> >
>> > Signed-off-by: Liviu Dudau 
>> > ---
>> > Changelog:
>> >  - v2: Find more places where the open coded version exists and
>> >replace them with the macro
>> >
>> >  drivers/core/dump.c   |  2 +-
>> >  drivers/core/uclass.c | 18 +-
>> >  2 files changed, 10 insertions(+), 10 deletions(-)
>>
>> Reviewed-by: Simon Glass 
>>
>> I wonder how you got that email address?!
>
> Which one? Mine or yours?
>
> Mine comes from the new setup that Arm has for dealing with FOSS, where
> the email servers don't send the standard Arm disclaimer.

Yes I mean yours. OK I see, seems useful.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] uclass: Use uclass_foreach_dev() macro instead of open coding

2018-09-28 Thread Liviu Dudau
On Fri, Sep 28, 2018 at 09:57:49AM -0600, Simon Glass wrote:
> On 28 September 2018 at 06:12, Liviu Dudau  wrote:
> > Use the uclass_foreach_dev() macro instead of the open coded version.
> >
> > Signed-off-by: Liviu Dudau 
> > ---
> > Changelog:
> >  - v2: Find more places where the open coded version exists and
> >replace them with the macro
> >
> >  drivers/core/dump.c   |  2 +-
> >  drivers/core/uclass.c | 18 +-
> >  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> Reviewed-by: Simon Glass 
> 
> I wonder how you got that email address?!

Which one? Mine or yours?

Mine comes from the new setup that Arm has for dealing with FOSS, where
the email servers don't send the standard Arm disclaimer.

Best regards,
Liviu

> 
> - Simon

-- 

| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---
¯\_(ツ)_/¯
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] uclass: Use uclass_foreach_dev() macro instead of open coding

2018-09-28 Thread Simon Glass
On 28 September 2018 at 06:12, Liviu Dudau  wrote:
> Use the uclass_foreach_dev() macro instead of the open coded version.
>
> Signed-off-by: Liviu Dudau 
> ---
> Changelog:
>  - v2: Find more places where the open coded version exists and
>replace them with the macro
>
>  drivers/core/dump.c   |  2 +-
>  drivers/core/uclass.c | 18 +-
>  2 files changed, 10 insertions(+), 10 deletions(-)

Reviewed-by: Simon Glass 

I wonder how you got that email address?!

- Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 17/17] misc: Add MPC83xx serdes driver

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Add a driver to configure the SerDes (Serializer/Deserializer) lanes on
> the MPC83xx architecture.
>
> Reviewed-by: Simon Glass 
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> * Added full documentation
> * Introduced separate local header file
> * Added error debug output
>
> v2 -> v3:
> * Added driver file to MAINTAINERS
>
> v1 -> v2:
> No changes
>
>  .../bindings/misc/fsl,mpc83xx-serdes.txt   |  24 +++
>  MAINTAINERS|   1 +
>  arch/powerpc/cpu/mpc83xx/serdes.c  |   4 +
>  arch/powerpc/include/asm/fsl_mpc83xx_serdes.h  |   4 +
>  drivers/misc/Kconfig   |   7 +
>  drivers/misc/Makefile  |   1 +
>  drivers/misc/mpc83xx_serdes.c  | 185 
>  drivers/misc/mpc83xx_serdes.h  | 232 
> +
>  8 files changed, 458 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/misc/fsl,mpc83xx-serdes.txt
>  create mode 100644 drivers/misc/mpc83xx_serdes.c
>  create mode 100644 drivers/misc/mpc83xx_serdes.h

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 09/17] timer: Add MPC83xx timer driver

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Add a timer driver for the MPC83xx architecture.
>
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> * Removed superfluous get_timer (switched to usage of standard function)
> * Improved error handling and debug reporting
> * Added full documentation
>
> v2 -> v3:
> * Got rid of the static variables
> * Added driver files to MAINTAINERS
>
> v1 -> v2:
> * Removed now-superfluous comments
> * Removed usage of uclass_{first,next}_device_compat
> * Switched to usage of new board uclass (instead of devinfo)
>
>  .../bindings/timer/fsl,mpc83xx-timer.txt   |  21 ++
>  MAINTAINERS|   1 +
>  arch/powerpc/cpu/mpc83xx/cpu.c |   4 +-
>  arch/powerpc/lib/Makefile  |   4 +
>  arch/powerpc/lib/interrupts.c  |   5 +-
>  drivers/timer/Kconfig  |   7 +
>  drivers/timer/Makefile |   1 +
>  drivers/timer/mpc83xx_timer.c  | 249 
> +
>  8 files changed, 289 insertions(+), 3 deletions(-)
>  create mode 100644 
> Documentation/devicetree/bindings/timer/fsl,mpc83xx-timer.txt
>  create mode 100644 drivers/timer/mpc83xx_timer.c

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 16/17] cpu: Add MPC83xx CPU driver

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Add a CPU driver for the MPC83xx architecture.
>
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> * Fixed style violations
> * Switched to using cpu_probe_all method
> * Switched to bitfield macros
> * Moved mpc83xx_cpu_info fields into mpc83xx_cpu_priv
> * Fixed CPU family determination
> * Improved error checking and debug reporting
> * Added forgotten compatible strings
> * Added full documentation
> * Simplified revid determination
>
> v2 -> v3:
> * Added driver files to MAINTAINERS
>
> v1 -> v2:
> * Removed cpu_print_info
> * Fixed CPU info printing
> * Removed usage of uclass_{first,next}_device_compat
> * Removed printing of reset status
>
>  .../devicetree/bindings/cpu/fsl,mpc83xx.txt|  34 ++
>  MAINTAINERS|   2 +
>  arch/powerpc/cpu/mpc83xx/cpu.c |   2 +
>  arch/powerpc/cpu/mpc83xx/cpu_init.c|   2 +
>  arch/powerpc/include/asm/processor.h   |   2 +
>  drivers/cpu/Kconfig|   7 +
>  drivers/cpu/Makefile   |   1 +
>  drivers/cpu/mpc83xx_cpu.c  | 349 
> +
>  drivers/cpu/mpc83xx_cpu.h  | 126 
>  9 files changed, 525 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/cpu/fsl,mpc83xx.txt
>  create mode 100644 drivers/cpu/mpc83xx_cpu.c
>  create mode 100644 drivers/cpu/mpc83xx_cpu.h

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 03/17] sysreset: Add get_status method

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> It's useful to have the reset status of the SoC printed out during reset
> (e.g. to learn whether the reset was caused by software or a watchdog).
>
> As a first step to implement this, add a get_status method to the
> sysreset class, which enables the caller to get printable information
> about the reset status (akin to get_desc in the CPU uclass).
>
> Reviewed-by: Simon Glass 
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> No changes
>
> v2 -> v3:
> No changes
>
> v1 -> v2:
> New in v2
>
>  drivers/sysreset/sysreset-uclass.c | 10 ++
>  include/sysreset.h | 17 +
>  2 files changed, 27 insertions(+)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 05/17] board_f: Add reset status printing

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> To print the reset status during boot, add a method print_resetinfo to
> board_f, which is called in init_sequence_f[], that gets the reset
> information from the sysreset driver (assuming there is only one seems
> reasonable), and prints it.
>
> Reviewed-by: Simon Glass 
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> No changes
>
> v2 -> v3:
> * Improved behavior and error handling
>
> v1 -> v2:
> New in v2
>
>  common/board_f.c | 28 
>  1 file changed, 28 insertions(+)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 08/17] timer: Sort Makefile entries

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Makefile entries should be sorted.
>
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> New in v4
>
>  drivers/timer/Makefile | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 06/17] mpc83xx: Add sysreset driver

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Add a sysreset driver for the MPC83xx platform.
>
> Reviewed-by: Simon Glass 
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> * Fixed style violation
> * Added full documentation
> * Switched to wait_for_bit_be32 usage
> * Improved error handling and debug printing
> * Minimized usage of preprocessor
>
> v2 -> v3:
> * Added driver file to MAINTAINERS
>
> v1 -> v2:
> New in v2
>
>  MAINTAINERS |   2 +
>  arch/powerpc/cpu/mpc83xx/cpu.c  |   3 +-
>  drivers/sysreset/Kconfig|   5 +
>  drivers/sysreset/Makefile   |   9 +-
>  drivers/sysreset/sysreset_mpc83xx.c | 212 
> 
>  drivers/sysreset/sysreset_mpc83xx.h | 103 ++
>  6 files changed, 329 insertions(+), 5 deletions(-)
>  create mode 100644 drivers/sysreset/sysreset_mpc83xx.c
>  create mode 100644 drivers/sysreset/sysreset_mpc83xx.h

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 11/17] init: Fix documentation

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> The documentation in init.h is not in kernel-doc format. Fix this.
>
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> New in v4
>
>  include/init.h | 27 ++-
>  1 file changed, 14 insertions(+), 13 deletions(-)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 07/17] clk: Add MPC83xx clock driver

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Add a clock driver for the MPC83xx architecture.
>
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> * Gotten rid of all #ifdefs (SoC is now determined by compatible string)
> * Added MPC83xx-wide functions to get properties of SoCs
> * Gotten rid of most clock variables in global data
> * Marked more files as static
> * Improved error handling and debug reporting
> * Simplified bitmask handling
> * Added binding file
> * Added full documentation
>
> v2 -> v3:
> * Added driver files to MAINTAINERS
>
> v1 -> v2:
> * Added binding of sysreset driver
>
>  .../devicetree/bindings/clk/fsl,mpc83xx-clk.txt|  23 ++
>  MAINTAINERS|   3 +
>  arch/powerpc/cpu/mpc83xx/speed.c   |   4 +
>  arch/powerpc/include/asm/arch-mpc83xx/soc.h|  74 
>  arch/powerpc/include/asm/config.h  |   2 +-
>  arch/powerpc/include/asm/global_data.h |   4 +
>  drivers/clk/Kconfig|   6 +
>  drivers/clk/Makefile   |   1 +
>  drivers/clk/mpc83xx_clk.c  | 410 
> +
>  drivers/clk/mpc83xx_clk.h  | 379 +++
>  include/dt-bindings/clk/mpc83xx-clk.h  |  33 ++
>  11 files changed, 938 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/devicetree/bindings/clk/fsl,mpc83xx-clk.txt
>  create mode 100644 arch/powerpc/include/asm/arch-mpc83xx/soc.h
>  create mode 100644 drivers/clk/mpc83xx_clk.c
>  create mode 100644 drivers/clk/mpc83xx_clk.h
>  create mode 100644 include/dt-bindings/clk/mpc83xx-clk.h

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] dm: uclass: Adding missing child_pre_probe description

2018-09-28 Thread Simon Glass
Hi Bin,

On 15 September 2018 at 06:41, Bin Meng  wrote:
> Hi Simon,
>
> On Fri, Sep 14, 2018 at 6:55 PM Simon Glass  wrote:
>>
>> On 7 September 2018 at 16:51, Bin Meng  wrote:
>> > The comment of child_pre_probe, one of the 'struct uclass_driver'
>> > members, is currently missing.
>> >
>> > Signed-off-by: Bin Meng 
>> > ---
>> >
>> >  include/dm/uclass.h | 1 +
>> >  1 file changed, 1 insertion(+)
>> >
>>
>> Reviewed-by: Simon Glass 
>>
>> > diff --git a/include/dm/uclass.h b/include/dm/uclass.h
>> > index 0e882ce..6e7c1cd 100644
>> > --- a/include/dm/uclass.h
>> > +++ b/include/dm/uclass.h
>> > @@ -58,6 +58,7 @@ struct udevice;
>> >   * @post_probe: Called after a new device is probed
>> >   * @pre_remove: Called before a device is removed
>> >   * @child_post_bind: Called after a child is bound to a device in this 
>> > uclass
>> > + * @child_pre_probe: Called before a child is probed in this uclass
>>
>> I prefer 'a child in this uclass is probed'
>
> OK, I will make this change and will include the v2 patch in another
> related patch series.

Actually I picked this up in the end. I think it is a minor thing.

Applied to u-boot-dm, and now in mainline, thanks!

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 01/17] ram: Add driver for MPC83xx

2018-09-28 Thread Simon Glass
On 17 August 2018 at 07:16, Simon Glass  wrote:
> Hi Mario,
>
> On 6 August 2018 at 02:23, Mario Six  wrote:
>> Add a RAM driver for the MPC83xx architecture.
>>
>> Reviewed-by: Simon Glass 
>> Signed-off-by: Mario Six 
>> ---
>>
>> Notes:
>> v3 -> v4:
>> * Switched preprocessor constants to C constants
>> * Improved error reporting
>> * Added driver binding file
>> * Added full documentation
>>
>> v2 -> v3:
>> * Converted some #ifdefs to if (IS_ENABLED(...))
>> * Added driver files to MAINTAINERS
>>
>> v1 -> v2:
>> No changes
>>
>>  .../bindings/ram/fsl,mpc83xx-mem-controller.txt|  314 ++
>>  MAINTAINERS|2 +
>>  arch/powerpc/cpu/mpc83xx/spd_sdram.c   |4 +
>>  drivers/ram/Kconfig|9 +
>>  drivers/ram/Makefile   |1 +
>>  drivers/ram/mpc83xx_sdram.c| 1096 
>> 
>>  include/dt-bindings/memory/mpc83xx-sdram.h |  161 +++
>>  include/mpc83xx.h  |6 +
>>  8 files changed, 1593 insertions(+)
>>  create mode 100644 
>> Documentation/devicetree/bindings/ram/fsl,mpc83xx-mem-controller.txt
>>  create mode 100644 drivers/ram/mpc83xx_sdram.c
>>  create mode 100644 include/dt-bindings/memory/mpc83xx-sdram.h
>
> This series has ended up assigned to me in patchwork.
>
> We are at RC2 now so I can pull it into u-boot-dm/next. But if you
> have other plans for the series, please let me know.
>

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 10/17] common: board_f: Sort includes

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Includes should be sorted.
>
> Reviewed-by: Simon Glass 
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> No changes
>
> v2 -> v3:
> No changes
>
> v1 -> v2:
> New in v2
>
>  common/board_f.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 15/17] test: Add tests for CPU uclass

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Add a sandbox CPU driver, and some tests for the CPU uclass.
>
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> New in v4
>
>  arch/sandbox/dts/test.dts | 12 ++
>  drivers/cpu/Makefile  |  1 +
>  drivers/cpu/cpu_sandbox.c | 61 
> +++
>  test/dm/Makefile  |  1 +
>  test/dm/cpu.c | 45 ++
>  5 files changed, 120 insertions(+)
>  create mode 100644 drivers/cpu/cpu_sandbox.c
>  create mode 100644 test/dm/cpu.c'

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 14/17] cpu: Add cpu_probe_all method

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Add a method to probe all CPUs of the board.
>
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> New in v4
>
>  drivers/cpu/cpu-uclass.c | 23 +++
>  include/cpu.h|  7 +++
>  2 files changed, 30 insertions(+)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 13/17] cpu: Fix cpu.h documentation

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Documentation in cpu.h is not in kernel-doc format. Change it to comply
> with it.
>
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> New in v4
>
>  include/cpu.h | 28 +++-
>  1 file changed, 15 insertions(+), 13 deletions(-)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/2] sandbox: Enable bitrev library build

2018-09-28 Thread Simon Glass
On 8 August 2018 at 02:56, Simon Glass  wrote:
> On 3 August 2018 at 00:58, Bin Meng  wrote:
>> Imply CONFIG_BITREVERSE for Sandbox.
>>
>> Signed-off-by: Bin Meng 
>>
>> ---
>>
>> Changes in v2:
>> - Change to imply in the Kconfig
>>
>>  arch/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] lib: bitrev: Sync with Linux kernel v4.17

2018-09-28 Thread Simon Glass
On 2 August 2018 at 23:58, Bin Meng  wrote:
> Signed-off-by: Bin Meng 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  include/linux/bitrev.h | 102 
> -
>  lib/bitrev.c   |  28 +-
>  2 files changed, 102 insertions(+), 28 deletions(-)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 04/17] test: Add tests for sysreset_get_status

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Add some tests for sysreset_get_status.
>
> Reviewed-by: Simon Glass 
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> * Switched to usage of strlcpy
>
> v2 -> v3:
> New in v3.
>
>  drivers/sysreset/sysreset_sandbox.c | 16 
>  test/dm/sysreset.c  | 20 
>  2 files changed, 36 insertions(+)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/4] dm: core: Scan "/firmware" node by default

2018-09-28 Thread Simon Glass
On 25 September 2018 at 23:33, Michal Simek  wrote:
> Hi Simon,
>
> On 19.9.2018 12:43, Rajan Vaja wrote:
>> All Linux firmware drivers are put under "/firmware" node
>> and it has support to populate "/firmware" node by default.
>>
>> u-boot and Linux can share same DTB. In this case, driver
>> probe for devices under "/firmware" will not be invoked
>> as "/firmware" does not have its own "compatible" property.
>>
>> This patch series scans "/firmware" node by default like "/clocks".
>> To avoid duplication of code, first patch moves, node scan code
>> into separate function.
>>
>> This series also test to make sure "/firmware" nodes are scanned
>> properly.
>>
>> Rajan Vaja (4):
>>   firmware: Add FIRMWARE config prompt string
>>   dm: core: Move "/clock" node scan into function
>>   dm: core: Scan "/firmware" node by default
>>   dm: test: Add "/firmware" node scan test
>>
>>  arch/sandbox/dts/test.dts   |  7 +++
>>  drivers/core/root.c | 35 ++-
>>  drivers/firmware/Kconfig|  2 +-
>>  drivers/firmware/Makefile   |  1 +
>>  drivers/firmware/firmware-sandbox.c | 20 
>>  test/dm/Makefile|  1 +
>>  test/dm/firmware.c  | 22 ++
>>  7 files changed, 74 insertions(+), 14 deletions(-)
>>  create mode 100644 drivers/firmware/firmware-sandbox.c
>>  create mode 100644 test/dm/firmware.c
>>
>
> Can you please take it via your tree?
>
> Thanks,
> Michal

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] dm: core: fix devfdt_remap_addr_index()

2018-09-28 Thread Simon Glass
On 15 August 2018 at 07:06, Daniel Schwierzeck
 wrote:
>
>
> On 14.08.2018 12:48, Cédric Le Goater wrote:
>> commit 30a90f56c3a2 ("dm: core: add functions to get memory-mapped I/O
>> addresses") introduced a devfdt_remap_addr_index() routine but it does
>> not make use of the index parameter.
>>
>> Signed-off-by: Cédric Le Goater 
>> ---
>>  drivers/core/fdtaddr.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>
> Reviewed-by: Daniel Schwierzeck 

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] binman: fix a few typos in documentation

2018-09-28 Thread Simon Glass
On 23 August 2018 at 03:45, Simon Glass  wrote:
> On 22 August 2018 at 14:01, Michael Heimpold  wrote:
>> This fixes four small typos in the README file.
>>
>> Signed-off-by: Michael Heimpold 
>> Cc: Simon Glass 
>> ---
>>  tools/binman/README | 8 
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> Reviewed-by: Simon Glass 
>
> Thanks.

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 02/17] powerpc: Add read*_*/write*_* macros

2018-09-28 Thread Simon Glass
On 6 August 2018 at 01:23, Mario Six  wrote:
> Define the read*_*/write*_* macros for the PowerPC platform to be able
> to use the macros in wait_bit.h.
>
> Signed-off-by: Mario Six 
> ---
>
> Notes:
> v3 -> v4:
> New in v4
>
>  arch/powerpc/include/asm/io.h | 18 ++
>  1 file changed, 18 insertions(+)
>

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/4] dm: core: Move "/clock" node scan into function

2018-09-28 Thread Simon Glass
On 19 September 2018 at 03:43, Rajan Vaja  wrote:
> Create separate function for scanning node by path and
> move "/clock" node scan code into that function.
>
> This will be usable if scanning of more node is required.
>
> Signed-off-by: Rajan Vaja 
> Reviewed-by: Simon Glass 
> ---
> Changes in v2:
>   * None
> ---
>  drivers/core/root.c | 33 ++---
>  1 file changed, 18 insertions(+), 15 deletions(-)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/3] test: ofnode: test ofnode_by_prop_value()

2018-09-28 Thread Simon Glass
On 21 August 2018 at 10:30, Simon Glass  wrote:
> On 20 August 2018 at 03:10, Jens Wiklander  wrote:
>> Test ofnode_by_prop_value()
>>
>> Signed-off-by: Jens Wiklander 
>> ---
>>  test/dm/ofnode.c | 27 +++
>>  1 file changed, 27 insertions(+)
>
> Reviewed-by: Simon Glass 
>
> Thanks

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] sandbox: Build with -fPIC

2018-09-28 Thread Simon Glass
On 14 September 2018 at 19:03, Simon Glass  wrote:
> On 3 September 2018 at 11:08, Andy Shevchenko
>  wrote:
>> Sandbox is not a real bootloader and it does require
>> a position independent code to be supported.
>>
>> Thus, build it with -fPIC explicitly.
>>
>> Fixes: 16940f720f9b ("Makefile: Don't generate position independent code")
>> Signed-off-by: Andy Shevchenko 
>> Reported-by: Simon Glass 
>> Tested-by: Bin Meng 
>> ---
>>
>> - rebased on top of latest u-boot/master
>> - added Bin's Tb tag
>>
>>  arch/sandbox/config.mk | 1 +
>>  1 file changed, 1 insertion(+)
>
> Acked-by: Simon Glass 
> Tested-by: Simon Glass 

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] ofnode: add ofnode_by_prop_value()

2018-09-28 Thread Simon Glass
On 21 August 2018 at 10:30, Simon Glass  wrote:
> On 20 August 2018 at 03:09, Jens Wiklander  wrote:
>> Adds ofnode_by_prop_value() to search for nodes with a given property
>> and value, an ofnode version of fdt_node_offset_by_prop_value().
>>
>> Signed-off-by: Jens Wiklander 
>> ---
>>  drivers/core/of_access.c | 27 +++
>>  drivers/core/ofnode.c| 14 ++
>>  include/dm/of_access.h   | 16 
>>  include/dm/ofnode.h  | 14 ++
>>  4 files changed, 71 insertions(+)
>
> Reviewed-by: Simon Glass 

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] dm: fix alignment of help message of "dm" command

2018-09-28 Thread Simon Glass
On 7 September 2018 at 06:17, Bin Meng  wrote:
> On Fri, Sep 7, 2018 at 7:32 PM Masahiro Yamada
>  wrote:
>>
>> Currently, "help dm" shows as follows:
>>
>> => help dm
>> dm - Driver model low level access
>>
>> Usage:
>> dm tree Dump driver model tree ('*' = activated)
>> dm uclassDump list of instances for each uclass
>> dm devresDump list of device resources for each device
>>
>> Signed-off-by: Masahiro Yamada 
>> ---
>>
>>  test/dm/cmd_dm.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm, and now in mainline, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/8] powerpc/dts: Define '_end' symbol in mpc85xx U-Boot lds files

2018-09-28 Thread York Sun
On 09/02/2018 10:08 PM, Jagdish Gediya wrote:
> 'board_fdt_blob_setup' function sets up fdt blob at '&_end' so
> define '_end' symbol in mpc85xx lds files.
> 
> Signed-off-by: Jagdish Gediya 
> ---
> Changes for v2:
>   - Define '_end' symbol in lds file instead of defining new
> 'board_fdt_blob_setup' function using existing '_init_end' symbol.
> 
> Changes for v3:
>   - Define '_end' symbol in spl lds files too.
> 

This patch set has been applied to mpc85xx master, awaiting upstream.
Thanks.

York

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] qe: Kconfig: Move CONFIG_U_QE to Kconfig

2018-09-28 Thread York Sun
On 09/25/2018 10:46 PM, Ran Wang wrote:
> This patch moves CONFIG_U_QE to Kconfig
> 
> Signed-off-by: Ran Wang 
> ---
> Change in v3:
>   - Combine 1/3 and 2/3 patch of v2
>   - Remove unnecessary space in front of U-QE in drivers/qe/Kconfig
>   - Remove CONFIG_U_QE in scripts/config_whitelist.txt
> 
> Change in v2:
>   Add more conditional define to support more platforms.
> 

This patch set is applied to fsl-qoriq master, awaiting upstream. Thanks.

York

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [v3 patch] net: fman: Support both new and legacy FMan Compatibles

2018-09-28 Thread York Sun
On 08/28/2018 08:49 PM, Zhao Qiang wrote:
> Recently  the FMan Port and MAC compatibles were changed.
> This patch aligns the FMan Port and MAC compatibles
> to the new FMan device tree binding document.
> The FMan device tree binding document can be found in the Linux
> kernel:
> version 3.18.0
> commit 297d35fd2a7d3fbd4e5c0f0c1c18213117ba11ba
> ./Documentation/devicetree/bindings/powerpc/fsl/fman.txt
> 
> This patch doesn't affect legacy compatibles support.
> 
> Signed-off-by: Zhao Qiang 
> ---
> Changes for v2
>   - add kernel version and commit id modifing the binding
> Changes for v3
>   - put "fsl,fman-xgec" before "fsl,fman-tgec"
>   - because it use the former in latest kernel version
> 

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ls2080ardb: remove dhcp function from env as boot source

2018-09-28 Thread York Sun
On 09/17/2018 10:29 PM, Priyanka Jain wrote:
> Signed-off-by: Priyanka Jain 
> ---

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ls1088a: remove dhcp function from u-boot env as boot source

2018-09-28 Thread York Sun
On 09/14/2018 04:24 AM, Pramod Kumar wrote:
> Signed-off-by: Pramod Kumar 
> ---

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ls1012a: remove debug info from u-boot log.

2018-09-28 Thread York Sun
On 09/12/2018 01:46 AM, Pramod Kumar wrote:
> Signed-off-by: Pramod Kumar 
> ---

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] armv8: fsl-layerscape: add missing qe base address define

2018-09-28 Thread York Sun
On 08/27/2018 07:34 AM, laurentiu.tu...@nxp.com wrote:
> From: Laurentiu Tudor 
> 
> Add define for quiccengine register block base address.
> 
> Signed-off-by: Laurentiu Tudor 
> ---

This patch set is applied to fsl-qoriq master, awaiting upstream. Thanks.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH][v3] driver: net: fsl-mc: Memset MC reserve ram memory before usage

2018-09-28 Thread York Sun
On 08/27/2018 12:29 AM, Prabhakar Kushwaha wrote:
> It is required to clean Management Complex reserve memory before any
> usage.
> So memset MC reserve memory.
> 
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changes for v2: 
>   - updated patch subject
>   - Consider case of dpl apply and mc_boot failure 
> Changes for v3
>   - updated mc_boot failure case for more clarity
> 
> 

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] u-boot: fixup the iommu-map property of fsl-mc node

2018-09-28 Thread York Sun
On 08/20/2018 03:31 AM, Nipun Gupta wrote:
> The iommu-map property in the fsl-mc node is updated by
> valid stream-ids by u-boot. This patch is to fixup this
> property for LS208x and LS1088.
> 
> Signed-off-by: Nipun Gupta 
> ---
> 

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ls1012afrwy: Add ls1012afrwy revC board support.

2018-09-28 Thread York Sun
On 08/13/2018 09:19 PM, Pramod Kumar wrote:
> ls1012afrwy support three revisions of the board.
> 512MB revA, revB boards and 1GB revC board.
> revision A and B board are collectively identified as revA/B,
> however revision C board is identifies as revC.
> 
> Signed-off-by: Pramod Kumar 
> ---

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] armv7: fsl: remove sata support

2018-09-28 Thread York Sun
On 07/31/2018 11:18 PM, Peng Ma wrote:
> Remove the old implementation in order to enable DM for sata
> 
> Signed-off-by: Peng Ma 
> ---

This patch set has been applied to fsl-qoriq master, awaiting upstream.
Thanks.

York


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3, v2] armv8: dts: fsl-ls1043a: add sata node support

2018-09-28 Thread York Sun
On 07/31/2018 08:37 PM, Peng Ma wrote:
> Add sata node to support ls1043a.
> 
> Signed-off-by: Peng Ma 
> ---
> v2:
>   -no changes

This patch set has been applied to fsl-qoriq master, awaiting upstream.
Thanks.

York

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v9 1/8] ppa/fm/qe: use block layer in ppa/fm/qe driver

2018-09-28 Thread York Sun
On 09/24/2018 11:50 PM, Yinbo Zhu wrote:
> At present the MMC subsystem maintains its own list
> of MMC devices. This cannot work with driver model
> when CONFIG_BLK is enabled, use blk_dread to
> replace previous mmc read interface,
> use mmc_get_blk_desc to get the mmc device property
> 
> Signed-off-by: Yinbo Zhu 
> ---
> Change in v9:
>   fix ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig compiling 
> errors 


This patch set has been applied to fsl-qoriq master, awaiting upstream.
Thanks.

York

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] Please pull u-boot-mpc85xx master

2018-09-28 Thread York Sun
Tom,

The following changes since commit 9dc8d155d4e88563f572ee79aab758eb4272f3fd:

  Merge git://git.denx.de/u-boot-imx (2018-09-19 20:35:27 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-mpc85xx.git tags/mpc85xx-for-v2018.11-rc1

for you to fetch changes up to 432054b947a79dbf0f1554f6d6814e8ea8ecb623:

  powerpc: dts: Enable device tree support for T2080QDS (2018-09-27
10:14:14 -0700)


Use device tree for mpc85xx with binman. Enabled for T2080QDS.

Build log is available at
https://travis-ci.org/yorksun/u-boot/builds/434213313.


Jagdish Gediya (8):
  powerpc/dts: Define '_end' symbol in mpc85xx U-Boot lds files
  powerpc/dts: Makefile changes to clean and build dts
  binman: Add a new "skip-at-start" property in Section class
  binman: Add support for PowerPC mpc85xx 'bootpg + resetvec' entry
  powerpc: mpc85xx: Select BINMAN by default
  powerpc: mpc85xx: Use binman to embed dtb inside U-Boot
  powerpc: dts: Add u-boot.dtsi to use binman for MPC85xx boards
  powerpc: dts: Enable device tree support for T2080QDS

 Makefile   | 23 +++-
 arch/powerpc/Kconfig   |  1 +
 arch/powerpc/cpu/mpc85xx/Kconfig   |  4 ++
 arch/powerpc/cpu/mpc85xx/u-boot-nand.lds   |  1 +
 arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds   |  1 +
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds|  1 +
 arch/powerpc/cpu/mpc85xx/u-boot.lds|  1 +
 arch/powerpc/dts/Makefile  | 14 +
 arch/powerpc/dts/e6500_power_isa.dtsi  | 39 ++
 arch/powerpc/dts/t2080.dtsi| 62
++
 arch/powerpc/dts/t2080qds.dts  | 17 ++
 arch/powerpc/dts/u-boot.dtsi   | 32 +++
 board/freescale/t208xqds/README| 19 +++
 configs/T2080QDS_NAND_defconfig|  3 +-
 configs/T2080QDS_SDCARD_defconfig  |  3 +-
 configs/T2080QDS_SPIFLASH_defconfig|  3 +-
 configs/T2080QDS_defconfig |  4 +-
 dts/Makefile   |  2 +-
 tools/binman/README|  9 
 tools/binman/README.entries| 14 -
 tools/binman/bsection.py   | 15 --
 .../etype/powerpc_mpc85xx_bootpg_resetvec.py   | 25 +
 tools/binman/ftest.py  | 16 ++
 .../test/80_4gb_and_skip_at_start_together.dts | 21 
 .../test/81_powerpc_mpc85xx_bootpg_resetvec.dts| 16 ++
 25 files changed, 335 insertions(+), 11 deletions(-)
 create mode 100644 arch/powerpc/dts/Makefile
 create mode 100644 arch/powerpc/dts/e6500_power_isa.dtsi
 create mode 100644 arch/powerpc/dts/t2080.dtsi
 create mode 100644 arch/powerpc/dts/t2080qds.dts
 create mode 100644 arch/powerpc/dts/u-boot.dtsi
 create mode 100644 tools/binman/etype/powerpc_mpc85xx_bootpg_resetvec.py
 create mode 100644 tools/binman/test/80_4gb_and_skip_at_start_together.dts
 create mode 100644 tools/binman/test/81_powerpc_mpc85xx_bootpg_resetvec.dts

Thanks.

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] enabling MMU in U-Boot-2017.09

2018-09-28 Thread Mrun Lele
Hi Bin,

Thanks for your reply.

I am using acadia processor.

After Linux boots we are getting some problems in MMU path.
Debugging that would be one way to move ahead.

However, I want to enable MMU in Uboot context to test MMU path to RAM.

Also, is there any document or README which will have all the available
configuration options?
README in the U-Boot-2017.09 do have some of the configuration options but
I believe not all of them are included there.

Please, do let me know if you need more details.
I am new to this community. Please, bare with me.

Thanks,
Harshad.

On Thu, Sep 27, 2018 at 11:37 PM Bin Meng  wrote:

> Hi,
>
> On Fri, Sep 28, 2018 at 11:30 AM Mrun Lele  wrote:
> >
> > Hello Everyone,
> >
> > I am using U-Boot-2017.09. I want to enable MMU before U-Boot loads
> uImage.
> >
> > I googled it and I found one thread dated back in July 2010.
> > this is the link
> > https://lists.denx.de/pipermail/u-boot/2010-July/073510.html
> >
> > Basically, it involved code change (enabling MMU in start.S and some
> other
> > modifications).
> >
> > Before walking down on that road described in that link, I want to know
> is
> > there any configuration parameter with which I can achieve it easily in
> > U-Boot-2017.09?
> >
> > If not, then is there any document/ guide which I can follow for
> > U-Boot-2017.09? I am using armv7 cpu.
> >
> > Any help would be highly appreciated.
>
> You did not specify which exact armv7 processor you are using, and
> what issues are you trying to fix. Please provide more details.
>
> Regards,
> Bin
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] Please pull u-boot-fsl-qoriq master

2018-09-28 Thread York Sun
Tom,

The following changes since commit 9dc8d155d4e88563f572ee79aab758eb4272f3fd:

  Merge git://git.denx.de/u-boot-imx (2018-09-19 20:35:27 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-fsl-qoriq.git tags/fsl-qoriq-for-v2018.11-rc1

for you to fetch changes up to 26cbc0d663555b8af7d40ecfd0d0fefe960d9686:

  armv7: ls102xa: Disable QE before enter deep sleep (2018-09-27
10:01:28 -0700)


Switch to driver model for eSDHC on Layerscape SoCs including LS1021A,
LS1043A, LS1046A, LS1088A, LS2088A.
Switch to driver model for SATA on LS1021A and LS1043A.
Add support for LS1012AFRWY rev C board.
Enable SMMU for LS1043A.

Build log is available at
https://travis-ci.org/yorksun/u-boot/builds/434207475.


Laurentiu Tudor (4):
  armv8: fsl-layerscape: add missing qe base address define
  armv8: ls1043a: advertise QMan v3 in configuration
  armv8: ls1043a: add icid setup support
  armv8: ls1043a: enable icid setup for qman portals

Nipun Gupta (1):
  u-boot: fixup the iommu-map property of fsl-mc node

Peng Ma (7):
  armv8: dts: fsl-ls1043a: add sata node support
  scsi: ceva: add ls1043a soc support
  arm64: ls1043aqds: enable DM support for sata
  armv7: fsl: remove sata support
  armv7: dts: fsl-ls1021a: add sata node support enable sata for
ls1021a-qds and ls1021a-twr
  arm: ls1021atwr: enable DM support for sata
  scsi: ceva: add ls1021a soc support.

Prabhakar Kushwaha (1):
  driver: net: fsl-mc: Memset MC reserve ram memory before usage

Pramod Kumar (3):
  ls1012afrwy: Add ls1012afrwy revC board support.
  ls1012a: remove debug info from u-boot log
  ls1088a: remove dhcp function from u-boot env as boot source

Priyanka Jain (1):
  ls2080ardb: remove dhcp function from env as boot source

Ran Wang (2):
  drivers: qe: Move CONFIG_U_QE to Kconfig
  armv7: ls102xa: Disable QE before enter deep sleep

Yinbo Zhu (8):
  ppa/fm/qe: use block layer in ppa/fm/qe driver
  armv8/ls1088a/ls2088a: esdhc: Add esdhc clock support
  armv8: ls2088a: add eSDHC node
  armv8: ls1088a: add eSDHC node
  armv8: ls1043a: add eSDHC node
  armv8: ls1046a: add eSDHC node
  armv7: ls1021a: enable esdhc
  Enable CONFIG_BLK and CONFIG_DM_MMC to Kconfig

Zhao Qiang (1):
  net: fman: Support both new and legacy FMan Compatibles

 arch/arm/cpu/armv7/ls102xa/Makefile|  1 -
 arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c  |  4 +
 arch/arm/cpu/armv7/ls102xa/ls102xa_sata.c  | 41 --
 arch/arm/cpu/armv8/fsl-layerscape/Makefile |  1 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch3_speed.c | 14 
 arch/arm/cpu/armv8/fsl-layerscape/ls1043_ids.c | 90
++
 arch/arm/cpu/armv8/fsl-layerscape/ppa.c|  7 +-
 arch/arm/cpu/armv8/fsl-layerscape/soc.c|  2 +-
 arch/arm/dts/fsl-ls1043a-qds.dtsi  |  4 +
 arch/arm/dts/fsl-ls1043a.dtsi  | 16 
 arch/arm/dts/fsl-ls1046a.dtsi  |  8 ++
 arch/arm/dts/fsl-ls1088a.dtsi  |  9 +++
 arch/arm/dts/fsl-ls2080a.dtsi  |  8 ++
 arch/arm/dts/ls1021a-qds.dtsi  |  4 +
 arch/arm/dts/ls1021a-twr.dtsi  |  4 +
 arch/arm/dts/ls1021a.dtsi  |  8 +-
 arch/arm/include/asm/arch-fsl-layerscape/config.h  |  1 +
 .../arm/include/asm/arch-fsl-layerscape/fsl_icid.h |  4 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  2 +
 .../asm/arch-fsl-layerscape/stream_id_lsch3.h  |  3 +
 arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h  | 29 +--
 arch/arm/include/asm/arch-ls102xa/ls102xa_sata.h   | 10 ---
 board/freescale/ls1012afrdm/ls1012afrdm.c  | 20 +++--
 board/freescale/ls1021aiot/ls1021aiot.c|  5 --
 board/freescale/ls1021aqds/ls1021aqds.c|  4 -
 board/freescale/ls1021atwr/ls1021atwr.c|  4 -
 board/freescale/ls1043aqds/ls1043aqds.c|  3 +
 board/freescale/ls1043ardb/ls1043ardb.c|  3 +
 board/freescale/ls1088a/ls1088a.c  |  2 +
 board/freescale/ls2080a/ls2080a.c  |  2 +
 board/freescale/ls2080aqds/ls2080aqds.c|  2 +
 board/freescale/ls2080ardb/ls2080ardb.c|  2 +
 configs/ls1021atwr_nor_SECURE_BOOT_defconfig   |  2 +
 configs/ls1021atwr_nor_defconfig   |  7 ++
 configs/ls1021atwr_nor_lpuart_defconfig|  2 +
 configs/ls1021atwr_qspi_defconfig  |  2 +
 configs/ls1021atwr_sdcard_ifc_defconfig|  2 +
 configs/ls1021atwr_sdcard_qspi_defconfig   |  2 +
 configs/ls1043aqds_defconfig   |  7 ++
 configs/ls1043aqds_lpuart_defconfig|  2 +
 configs/ls1043aqds_nand_defconfig  |  2 +
 

Re: [U-Boot] [PATCH 00/48] mpc83xx: Kconfig migrations

2018-09-28 Thread York Sun
On 09/28/2018 02:53 AM, Mario Six wrote:
> This series converts the first bunch of legacy configuration options to
> the Kconfig framework.
> 
> Functionality is preserved where possible, and setting configuration
> options is made a comfortable as possible.
> 
> Mario Six (48):
>   mpc83xx: Introduce ARCH_MPC830*
>   mpc83xx: Introduce ARCH_MPC831*
>   mpc83xx: Introduce ARCH_MPC832*
>   mpc83xx: Introduce ARCH_MPC834*
>   mpc83xx: Introduce ARCH_MPC836*
>   mpc83xx: Introduce ARCH_MPC837X
>   keymile: Make distinct kmtegr1, kmvect1, suvd3 configs
>   keymile: Simplify kmtegr1, kmvect1, suvd3 configs

Does it make sense to squash the above two patches (and other similar
patches)?

York
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/4] pico-imx6ul, pico-imx7d: Use eMMC user partition by default

2018-09-28 Thread Otavio Salvador
Hello Stefano,

I forgot to add you to Cc list

On Fri, Sep 28, 2018 at 11:22 AM Otavio Salvador
 wrote:
>
> After discussing with TechNexion about how its default setting, it is
> better to install on the eMMC user partition by default, when using
> DFU, so it works out of box for majority of users.
>
> Reviewed-by: Fabio Estevam 
> Signed-off-by: Otavio Salvador 




-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854  Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 3/4] pico-imx7d: Make SPL binary fit into 64kB

2018-09-28 Thread Otavio Salvador
From: Fabio Estevam 

Currently SPL binary is larger than 64kB, which is larger than
CONFIG_SPL_MAX_SIZE defined in imx7_spl.h.

This causes boot failure on the pico-mx7 targets.

Remove CONFIG_SPL_LIBDISK_SUPPORT option for now, so that the SPL
binary can fit into the 64kB range.

Signed-off-by: Fabio Estevam 
Signed-off-by: Otavio Salvador 
---

Changes in v3:
- new patch

Changes in v2: None

 configs/pico-hobbit-imx7d_defconfig | 1 -
 configs/pico-imx7d_defconfig| 1 -
 configs/pico-pi-imx7d_defconfig | 1 -
 3 files changed, 3 deletions(-)

diff --git a/configs/pico-hobbit-imx7d_defconfig 
b/configs/pico-hobbit-imx7d_defconfig
index 568fb11d59..b02cae5237 100644
--- a/configs/pico-hobbit-imx7d_defconfig
+++ b/configs/pico-hobbit-imx7d_defconfig
@@ -8,7 +8,6 @@ CONFIG_TARGET_PICO_IMX7D=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
-CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
diff --git a/configs/pico-imx7d_defconfig b/configs/pico-imx7d_defconfig
index d6cfc2065e..f355f07be7 100644
--- a/configs/pico-imx7d_defconfig
+++ b/configs/pico-imx7d_defconfig
@@ -8,7 +8,6 @@ CONFIG_TARGET_PICO_IMX7D=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
-CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig
index 73800fc8eb..3a182dcb81 100644
--- a/configs/pico-pi-imx7d_defconfig
+++ b/configs/pico-pi-imx7d_defconfig
@@ -8,7 +8,6 @@ CONFIG_TARGET_PICO_IMX7D=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
-CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
-- 
2.19.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 4/4] pico-imx7d: Add USB Host support

2018-09-28 Thread Otavio Salvador
From: Fabio Estevam 

USB OTG2 port is connected to the USB host connector.

Add support for it.

Signed-off-by: Fabio Estevam 
Signed-off-by: Otavio Salvador 
---

Changes in v3:
- new patch

Changes in v2: None

 board/technexion/pico-imx7d/pico-imx7d.c | 29 +++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/board/technexion/pico-imx7d/pico-imx7d.c 
b/board/technexion/pico-imx7d/pico-imx7d.c
index 0767d0462f..53e14693a5 100644
--- a/board/technexion/pico-imx7d/pico-imx7d.c
+++ b/board/technexion/pico-imx7d/pico-imx7d.c
@@ -282,7 +282,34 @@ int checkboard(void)
return 0;
 }
 
+static iomux_v3_cfg_t const usb_otg2_pads[] = {
+   MX7D_PAD_UART3_CTS_B__USB_OTG2_PWR | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+int board_ehci_hcd_init(int port)
+{
+   switch (port) {
+   case 0:
+   break;
+   case 1:
+   imx_iomux_v3_setup_multiple_pads(usb_otg2_pads,
+ARRAY_SIZE(usb_otg2_pads));
+   break;
+   default:
+   return -EINVAL;
+   }
+   return 0;
+}
+
 int board_usb_phy_mode(int port)
 {
-   return USB_INIT_DEVICE;
+   switch (port) {
+   case 0:
+   return USB_INIT_DEVICE;
+   case 1:
+   return USB_INIT_HOST;
+   default:
+   return -EINVAL;
+   }
+   return 0;
 }
-- 
2.19.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 2/4] pico-imx6ul, pico-imx7d: Enable USB and PXE boot support

2018-09-28 Thread Otavio Salvador
This allow the use of a USB storage or PXE network booting as
fallback, allowing for example for manufacturing installation of eMMC
storage in an easy way.

Reviewed-by: Fabio Estevam 
Signed-off-by: Otavio Salvador 
---

Changes in v3: None
Changes in v2:
- improve commit log (fabio)

 include/configs/pico-imx6ul.h | 2 ++
 include/configs/pico-imx7d.h  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h
index 0fea2d65dd..8082b74c9c 100644
--- a/include/configs/pico-imx6ul.h
+++ b/include/configs/pico-imx6ul.h
@@ -103,6 +103,8 @@
 
 #define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
+   func(USB, usb, 0) \
+   func(PXE, pxe, na) \
func(DHCP, dhcp, na)
 
 #include 
diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 614be99d93..2bc42a04a0 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -92,6 +92,8 @@
 
 #define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
+   func(USB, usb, 0) \
+   func(PXE, pxe, na) \
func(DHCP, dhcp, na)
 
 #include 
-- 
2.19.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 1/4] pico-imx6ul, pico-imx7d: Use eMMC user partition by default

2018-09-28 Thread Otavio Salvador
After discussing with TechNexion about how its default setting, it is
better to install on the eMMC user partition by default, when using
DFU, so it works out of box for majority of users.

Reviewed-by: Fabio Estevam 
Signed-off-by: Otavio Salvador 
---

Changes in v3: None
Changes in v2: None

 include/configs/pico-imx6ul.h | 4 ++--
 include/configs/pico-imx7d.h  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h
index 3d93205535..0fea2d65dd 100644
--- a/include/configs/pico-imx6ul.h
+++ b/include/configs/pico-imx6ul.h
@@ -56,8 +56,8 @@
 
 #define CONFIG_DFU_ENV_SETTINGS \
"dfu_alt_info=" \
-   "spl raw 0x2 0x400 mmcpart 1;" \
-   "u-boot raw 0x8a 0x400 mmcpart 1;" \
+   "spl raw 0x2 0x400;" \
+   "u-boot raw 0x8a 0x400;" \
"/boot/zImage ext4 0 1;" \
"/boot/imx6ul-pico-hobbit.dtb ext4 0 1;" \
"/boot/imx6ul-pico-pi.dtb ext4 0 1;" \
diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 0e770bf41f..614be99d93 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -45,8 +45,8 @@
 
 #define CONFIG_DFU_ENV_SETTINGS \
"dfu_alt_info=" \
-   "spl raw 0x2 0x400 mmcpart 1;" \
-   "u-boot raw 0x8a 0x400 mmcpart 1;" \
+   "spl raw 0x2 0x400;" \
+   "u-boot raw 0x8a 0x400;" \
"/boot/zImage ext4 0 1;" \
"/boot/imx7d-pico-hobbit.dtb ext4 0 1;" \
"/boot/imx7d-pico-pi.dtb ext4 0 1;" \
-- 
2.19.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 0/7] SPI-NAND support (third batch)

2018-09-28 Thread Miquel Raynal
Hi Jagan,

Jagan Teki  wrote on Fri, 28 Sep 2018
19:09:21 +0530:

> On Fri, Sep 28, 2018 at 3:10 PM Miquel Raynal  
> wrote:
> >
> > Hi Miquel,
> >
> > Miquel Raynal  wrote on Fri, 28 Sep 2018
> > 09:35:02 +0200:
> >  
> > > Hi Jagan,
> > >
> > > Jagan Teki  wrote on Fri, 28 Sep 2018
> > > 12:56:43 +0530:
> > >  
> > > > On Fri, Sep 28, 2018 at 12:38 PM Miquel Raynal
> > > >  wrote:  
> > > > >
> > > > > Hi Jagan,
> > > > >
> > > > > Jagan Teki  wrote on Fri, 28 Sep 2018
> > > > > 12:18:49 +0530:
> > > > >  
> > > > > > On Thu, Sep 27, 2018 at 3:04 PM Miquel Raynal 
> > > > > >  wrote:  
> > > > > > >
> > > > > > > During the last months, Boris Brezillon shared his work to support
> > > > > > > serial flashes within Linux. First, he delivered (and merged) a 
> > > > > > > new
> > > > > > > layer called spi-mem. He also initiated in Linux MTD subsystem 
> > > > > > > the move
> > > > > > > of all 'raw' NAND related code to a raw/ subdirectory, adding at 
> > > > > > > the
> > > > > > > same time a NAND core that would be shared with all NAND devices. 
> > > > > > > Then,
> > > > > > > he contributed a generic SPI-NAND driver, making use of this NAND 
> > > > > > > core,
> > > > > > > as well as some vendor code to drive a few chips.
> > > > > > >
> > > > > > > On top of this work, I made some cleanups in the MTD layer and 
> > > > > > > added an
> > > > > > > 'mtd' U-Boot command to handle all sort of MTD devices. This 
> > > > > > > should
> > > > > > > become the default command instead of having one per flash flavor
> > > > > > > ('sf', 'nand', 'spi-nand' ?).
> > > > > > >
> > > > > > > The series has been tested on an Ocelot board PCB123 (VSC7514),
> > > > > > > featuring a Macronix SPI NAND chip.
> > > > > > >
> > > > > > > TL;DR: the series contains (stripped version since ~30 patches 
> > > > > > > have
> > > > > > > already been taken):
> > > > > > > - Support for spi-nand devices in mtdparts.
> > > > > > > - Generics mtdparts/mtdids parsers.
> > > > > > > - A new 'mtd' command.
> > > > > > > - A note to set mtdparts command legacy.
> > > > > > >
> > > > > > > To test your SPI-NAND device with U-Boot, you can test someting 
> > > > > > > like:
> > > > > > >  
> > > > > > > > setenv mtdparts 'spi-nand0:1m(foo),-(bar)'
> > > > > > > > setenv mtdids 'spi-nand0=spi0.0' # spi0.0 is Linux MTD name for 
> > > > > > > > this device
> > > > > > > > ubi part bar # create a static UBI volume in the bar 
> > > > > > > > partition
> > > > > > > > mtd list # show the current MTD devices/partitions  
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Miquèl
> > > > > > >
> > > > > > >
> > > > > > > NB1: If UBI refuses to attach, verify the partition is epty with
> > > > > > >  # mtd erase bar
> > > > > > >
> > > > > > > NB2: If your U-Boot crashes and you are using a non SPI-NAND 
> > > > > > > device,
> > > > > > >  don't forget to probe your device *first* (sf probe, ...).
> > > > > > >
> > > > > > >
> > > > > > > Changes since v9:
> > > > > > > -
> > > > > > > * mtd_search_alternate_name() is moved in mtd_uboot.c (generic 
> > > > > > > code,
> > > > > > >   everybody wants to use mtdids).
> > > > > > > * mtd_parse_partitions() is still in mtdparts.c because it 
> > > > > > > depends on
> > > > > > >   partitions support, but the header file declaring it
> > > > > > >   (include/linux/mtd/partitions.h) also has a dummy function if
> > > > > > >   #if IS_ENABLED(CONFIG_MTD_PARTITIONS) is false.
> > > > > > > * Typo corrected in mtd_parse_partitions prototype
> > > > > > >   (s/_nb_parts/_nparts/).
> > > > > > > * Added Boris' R-b tags.
> > > > > > >
> > > > > > > Changes since v8 (called v7 by mistake):
> > > > > > > 
> > > > > > > * Moved most of the generic logic to the core (mtd_uboot.c) so 
> > > > > > > that it
> > > > > > >   can be reused by other parts of U-Boot without depending on 
> > > > > > > anything
> > > > > > >   else than the MTD core itself.
> > > > > > > * Removed the "#ifdef CONFIG_MTD" around mtd_probe_devices() 
> > > > > > > calls now
> > > > > > >   that the code is in the core.
> > > > > > > * Created an helper for partitions deletion (as there is one to
> > > > > > >   parse/create partition objects).
> > > > > > > * Enhanced a bit the text in Kconfig about deprecating mtdparts.
> > > > > > > * Fixed checkpatch.pl warnings in the mtdparts driver.
> > > > > > > * Drop "cmd: mtdparts: try to probe the MTD devices as a 
> > > > > > > fallback" to
> > > > > > >   actually deprecate the command.  
> > > > >
> > > > > [...]
> > > > >  
> > > > > > > Miquel Raynal (7):
> > > > > > >   mtd: uclass: add probe function
> > > > > > >   mtd: mtdpart: add a generic mtdparts-like parser
> > > > > > >   mtd: uboot: search for an equivalent MTD name with the mtdids
> > > > > > >   mtd: mtdpart: implement proper partition handling
> > > > > > >   cmd: mtd: add 'mtd' command
> > > > > > >   cmd: ubi: clean the partition 

Re: [U-Boot] [PATCH v10 0/7] SPI-NAND support (third batch)

2018-09-28 Thread Jagan Teki
On Fri, Sep 28, 2018 at 3:10 PM Miquel Raynal  wrote:
>
> Hi Miquel,
>
> Miquel Raynal  wrote on Fri, 28 Sep 2018
> 09:35:02 +0200:
>
> > Hi Jagan,
> >
> > Jagan Teki  wrote on Fri, 28 Sep 2018
> > 12:56:43 +0530:
> >
> > > On Fri, Sep 28, 2018 at 12:38 PM Miquel Raynal
> > >  wrote:
> > > >
> > > > Hi Jagan,
> > > >
> > > > Jagan Teki  wrote on Fri, 28 Sep 2018
> > > > 12:18:49 +0530:
> > > >
> > > > > On Thu, Sep 27, 2018 at 3:04 PM Miquel Raynal 
> > > > >  wrote:
> > > > > >
> > > > > > During the last months, Boris Brezillon shared his work to support
> > > > > > serial flashes within Linux. First, he delivered (and merged) a new
> > > > > > layer called spi-mem. He also initiated in Linux MTD subsystem the 
> > > > > > move
> > > > > > of all 'raw' NAND related code to a raw/ subdirectory, adding at the
> > > > > > same time a NAND core that would be shared with all NAND devices. 
> > > > > > Then,
> > > > > > he contributed a generic SPI-NAND driver, making use of this NAND 
> > > > > > core,
> > > > > > as well as some vendor code to drive a few chips.
> > > > > >
> > > > > > On top of this work, I made some cleanups in the MTD layer and 
> > > > > > added an
> > > > > > 'mtd' U-Boot command to handle all sort of MTD devices. This should
> > > > > > become the default command instead of having one per flash flavor
> > > > > > ('sf', 'nand', 'spi-nand' ?).
> > > > > >
> > > > > > The series has been tested on an Ocelot board PCB123 (VSC7514),
> > > > > > featuring a Macronix SPI NAND chip.
> > > > > >
> > > > > > TL;DR: the series contains (stripped version since ~30 patches have
> > > > > > already been taken):
> > > > > > - Support for spi-nand devices in mtdparts.
> > > > > > - Generics mtdparts/mtdids parsers.
> > > > > > - A new 'mtd' command.
> > > > > > - A note to set mtdparts command legacy.
> > > > > >
> > > > > > To test your SPI-NAND device with U-Boot, you can test someting 
> > > > > > like:
> > > > > >
> > > > > > > setenv mtdparts 'spi-nand0:1m(foo),-(bar)'
> > > > > > > setenv mtdids 'spi-nand0=spi0.0' # spi0.0 is Linux MTD name for 
> > > > > > > this device
> > > > > > > ubi part bar # create a static UBI volume in the bar 
> > > > > > > partition
> > > > > > > mtd list # show the current MTD devices/partitions
> > > > > >
> > > > > > Thanks,
> > > > > > Miquèl
> > > > > >
> > > > > >
> > > > > > NB1: If UBI refuses to attach, verify the partition is epty with
> > > > > >  # mtd erase bar
> > > > > >
> > > > > > NB2: If your U-Boot crashes and you are using a non SPI-NAND device,
> > > > > >  don't forget to probe your device *first* (sf probe, ...).
> > > > > >
> > > > > >
> > > > > > Changes since v9:
> > > > > > -
> > > > > > * mtd_search_alternate_name() is moved in mtd_uboot.c (generic code,
> > > > > >   everybody wants to use mtdids).
> > > > > > * mtd_parse_partitions() is still in mtdparts.c because it depends 
> > > > > > on
> > > > > >   partitions support, but the header file declaring it
> > > > > >   (include/linux/mtd/partitions.h) also has a dummy function if
> > > > > >   #if IS_ENABLED(CONFIG_MTD_PARTITIONS) is false.
> > > > > > * Typo corrected in mtd_parse_partitions prototype
> > > > > >   (s/_nb_parts/_nparts/).
> > > > > > * Added Boris' R-b tags.
> > > > > >
> > > > > > Changes since v8 (called v7 by mistake):
> > > > > > 
> > > > > > * Moved most of the generic logic to the core (mtd_uboot.c) so that 
> > > > > > it
> > > > > >   can be reused by other parts of U-Boot without depending on 
> > > > > > anything
> > > > > >   else than the MTD core itself.
> > > > > > * Removed the "#ifdef CONFIG_MTD" around mtd_probe_devices() calls 
> > > > > > now
> > > > > >   that the code is in the core.
> > > > > > * Created an helper for partitions deletion (as there is one to
> > > > > >   parse/create partition objects).
> > > > > > * Enhanced a bit the text in Kconfig about deprecating mtdparts.
> > > > > > * Fixed checkpatch.pl warnings in the mtdparts driver.
> > > > > > * Drop "cmd: mtdparts: try to probe the MTD devices as a fallback" 
> > > > > > to
> > > > > >   actually deprecate the command.
> > > >
> > > > [...]
> > > >
> > > > > > Miquel Raynal (7):
> > > > > >   mtd: uclass: add probe function
> > > > > >   mtd: mtdpart: add a generic mtdparts-like parser
> > > > > >   mtd: uboot: search for an equivalent MTD name with the mtdids
> > > > > >   mtd: mtdpart: implement proper partition handling
> > > > > >   cmd: mtd: add 'mtd' command
> > > > > >   cmd: ubi: clean the partition handling
> > > > > >   cmd: mtdparts: describe as legacy
> > > > >
> > > > > I didn't find this mtdparts fallback change[1] in v10? does this
> > > > > fallback issue fixed differently.
> > > > >
> > > > > [1] 
> > > > > https://github.com/openedev/u-boot-amarula/commit/9edbc2be512c9bd572884c53b5f54b583e897e9b
> > > >
> > > > Indeed, I dropped this patch on Boris advice: if we want to deprecate
> 

[U-Boot] [PATCH v3] cmd: usb_mass_storage: add protection for block_dev

2018-09-28 Thread Patrick Delaunay
Check the value of block_dev before to use this pointer.
This patch solves problem for the command "ums 0 ubi 0"
when ubifs is previously mounted; in this case the function
blk_get_device_part_str("ubi 0") don't return error
but return block_dev = NULL and then data abort.

Signed-off-by: Patrick Delaunay 
---
I check and the issue is still present on U-Boot v2018.09,
on my board stm32mp1 (with NAND device and UBI volume):

STM32MP> ubi part UBI
STM32MP> ubifsmount ubi0:boot
STM32MP> ums 0 ubi 0
data abort
pc : []  lr : []
reloc pc : []lr : []
sp : fdc3e460  ip : fdc3e518 fp : fdcf06a8
r10: fdcf06b8  r9 : fdc4eed8 r8 : 
r7 : ffce3d84  r6 : fdcf0740 r5 : fdcf0740  r4 : ffce3d88
r3 :   r2 :  r1 : 003a  r0 : 
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Code: f04f4628 9b06fd2a bf082800 0800f04f (f5b3695b) Resetting CPU ...

Even If the command is invalid (ums not allowed on ubi device),
the data abort can be avoid by this patch.

To reproduce the issue you need to have a ubifs  already mounted,
for example with the command:
ubi part UBI
ubifsmount ubi0:boot

I investigate the point, the call stack before the crash is
caused by the ubi support in
./disk/part.c =  blk_get_device_part_str()

Some part of code here are under CONFIG_CMD_UBIFS with the comment :
"ubi goes through a mtd, rathen then through a regular block device"

So the the function return a pointer to disk_partition_t :
   info->type = BOOT_PART_TYPE
   info->name =  "UBI"
but without block device information !
   *dev_desc = NULL

So the issue occurs because, when the ubifs volume is mounted,
The code in  cmd/usb_mass_storage.c

static int ums_init(const char *devtype, const char *devnums_part_str) { ...
  for (;;) {
...
 partnum = blk_get_device_part_str(devtype, devnum_part_str,
_dev, , 1);

// With devnum_part_str  = "ubi 0"
// This function don't return a error and return a  valid partnum
// So the function continue until block_dev = NULL is used .
 if (partnum < 0)
goto cleanup;

/* Check if the argument is in legacy format. If yes,
 * expose all partitions by setting the partnum = 0
 * e.g. ums 0 mmc 0
 */
 if (!strchr(devnum_part_str, ':'))
 partnum = 0;

 /* f_mass_storage.c assumes SECTOR_SIZE sectors */
 if (block_dev->blksz != SECTOR_SIZE)
goto cleanup;

=> crash occur here (on my board) because block_dev = NULL



Changes in v3:
- Reword commit message

Changes in v2:
- Rebase on master branch

 cmd/usb_mass_storage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/usb_mass_storage.c b/cmd/usb_mass_storage.c
index 0d55114..a90f7bb 100644
--- a/cmd/usb_mass_storage.c
+++ b/cmd/usb_mass_storage.c
@@ -84,7 +84,7 @@ static int ums_init(const char *devtype, const char 
*devnums_part_str)
partnum = 0;
 
/* f_mass_storage.c assumes SECTOR_SIZE sectors */
-   if (block_dev->blksz != SECTOR_SIZE)
+   if (!block_dev || block_dev->blksz != SECTOR_SIZE)
goto cleanup;
 
ums_new = realloc(ums, (ums_count + 1) * sizeof(*ums));
-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2] uclass: Use uclass_foreach_dev() macro instead of open coding

2018-09-28 Thread Liviu Dudau
Use the uclass_foreach_dev() macro instead of the open coded version.

Signed-off-by: Liviu Dudau 
---
Changelog:
 - v2: Find more places where the open coded version exists and
   replace them with the macro

 drivers/core/dump.c   |  2 +-
 drivers/core/uclass.c | 18 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/core/dump.c b/drivers/core/dump.c
index d7cdb1475d..9068084404 100644
--- a/drivers/core/dump.c
+++ b/drivers/core/dump.c
@@ -89,7 +89,7 @@ void dm_dump_uclass(void)
printf("uclass %d: %s\n", id, uc->uc_drv->name);
if (list_empty(>dev_head))
continue;
-   list_for_each_entry(dev, >dev_head, uclass_node) {
+   uclass_foreach_dev(dev, uc) {
dm_display_line(dev, i);
i++;
}
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 3113d6a56b..d90bdde54e 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -180,7 +180,7 @@ int dev_get_uclass_index(struct udevice *dev, struct uclass 
**ucp)
if (list_empty(>dev_head))
return -ENODEV;
 
-   list_for_each_entry(iter, >dev_head, uclass_node) {
+   uclass_foreach_dev(iter, uc) {
if (iter == dev) {
if (ucp)
*ucp = uc;
@@ -205,7 +205,7 @@ int uclass_find_device(enum uclass_id id, int index, struct 
udevice **devp)
if (list_empty(>dev_head))
return -ENODEV;
 
-   list_for_each_entry(dev, >dev_head, uclass_node) {
+   uclass_foreach_dev(dev, uc) {
if (!index--) {
*devp = dev;
return 0;
@@ -259,7 +259,7 @@ int uclass_find_device_by_name(enum uclass_id id, const 
char *name,
if (ret)
return ret;
 
-   list_for_each_entry(dev, >dev_head, uclass_node) {
+   uclass_foreach_dev(dev, uc) {
if (!strncmp(dev->name, name, strlen(name))) {
*devp = dev;
return 0;
@@ -284,7 +284,7 @@ int uclass_find_device_by_seq(enum uclass_id id, int 
seq_or_req_seq,
if (ret)
return ret;
 
-   list_for_each_entry(dev, >dev_head, uclass_node) {
+   uclass_foreach_dev(dev, uc) {
debug("   - %d %d '%s'\n", dev->req_seq, dev->seq, dev->name);
if ((find_req_seq ? dev->req_seq : dev->seq) ==
seq_or_req_seq) {
@@ -312,7 +312,7 @@ int uclass_find_device_by_of_offset(enum uclass_id id, int 
node,
if (ret)
return ret;
 
-   list_for_each_entry(dev, >dev_head, uclass_node) {
+   uclass_foreach_dev(dev, uc) {
if (dev_of_offset(dev) == node) {
*devp = dev;
return 0;
@@ -337,7 +337,7 @@ int uclass_find_device_by_ofnode(enum uclass_id id, ofnode 
node,
if (ret)
return ret;
 
-   list_for_each_entry(dev, >dev_head, uclass_node) {
+   uclass_foreach_dev(dev, uc) {
log(LOGC_DM, LOGL_DEBUG_CONTENT, "  - checking %s\n",
dev->name);
if (ofnode_equal(dev_ofnode(dev), node)) {
@@ -372,7 +372,7 @@ static int uclass_find_device_by_phandle(enum uclass_id id,
if (ret)
return ret;
 
-   list_for_each_entry(dev, >dev_head, uclass_node) {
+   uclass_foreach_dev(dev, uc) {
uint phandle;
 
phandle = dev_read_phandle(dev);
@@ -399,7 +399,7 @@ int uclass_get_device_by_driver(enum uclass_id id,
if (ret)
return ret;
 
-   list_for_each_entry(dev, >dev_head, uclass_node) {
+   uclass_foreach_dev(dev, uc) {
if (dev->driver == find_drv)
return uclass_get_device_tail(dev, 0, devp);
}
@@ -499,7 +499,7 @@ int uclass_get_device_by_phandle_id(enum uclass_id id, uint 
phandle_id,
if (ret)
return ret;
 
-   list_for_each_entry(dev, >dev_head, uclass_node) {
+   uclass_foreach_dev(dev, uc) {
uint phandle;
 
phandle = dev_read_phandle(dev);
-- 
2.18.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2] video: Add support for Arm's Mali Display Processors

2018-09-28 Thread Liviu Dudau
Add support for Arm Mali Display Processors DP500, DP550 and DP650.
Only one layer is being used to display the console or boot logo,
even if more layers are supported in the hardware.

Signed-off-by: Liviu Dudau 
---
Changelog:
  - v2: Added MAINTAINERS entry and fixed checkpatch warnings.

 MAINTAINERS |   6 +
 drivers/video/Kconfig   |   8 +
 drivers/video/Makefile  |   1 +
 drivers/video/mali_dp.c | 405 
 4 files changed, 420 insertions(+)
 create mode 100644 drivers/video/mali_dp.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 112e41d2c3..fe08365ca8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -449,6 +449,12 @@ F: cmd/log.c
 F: test/log/log_test.c
 F: test/py/tests/test_log.py
 
+MALI DISPLAY PROCESSORS
+M: Liviu Dudau 
+S: Supported
+T: git git://github.com/ARM-software/u-boot.git
+F: drivers/video/mali_dp.c
+
 MICROBLAZE
 M: Michal Simek 
 S: Maintained
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 5d932072a8..ccf7cf83ed 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -497,6 +497,14 @@ config VIDEO_FSL_DCU_MAX_FB_SIZE_MB
 
 source "drivers/video/rockchip/Kconfig"
 
+config VIDEO_ARM_MALIDP
+   bool "Enable Arm Mali Display Processor support"
+   depends on DM_VIDEO && OF_CONTROL
+   select VEXPRESS_CLK
+   help
+ This enables support for Arm Ltd Mali Display Processors from
+ the DP500, DP550 and DP650 family.
+
 config VIDEO_SANDBOX_SDL
bool "Enable sandbox video console using SDL"
depends on SANDBOX
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 4c130e179d..e19e6dad1f 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_NXP_TDA19988) += tda19988.o
 obj-$(CONFIG_PXA_LCD) += pxa_lcd.o
 obj-$(CONFIG_S6E8AX0) += s6e8ax0.o
 obj-$(CONFIG_SCF0403_LCD) += scf0403_lcd.o
+obj-$(CONFIG_VIDEO_ARM_MALIDP) += mali_dp.o
 obj-$(CONFIG_VIDEO_BCM2835) += bcm2835.o
 obj-$(CONFIG_VIDEO_BROADWELL_IGD) += broadwell_igd.o
 obj-$(CONFIG_VIDEO_COREBOOT) += coreboot.o
diff --git a/drivers/video/mali_dp.c b/drivers/video/mali_dp.c
new file mode 100644
index 00..71151a87aa
--- /dev/null
+++ b/drivers/video/mali_dp.c
@@ -0,0 +1,405 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2016-2018 ARM Ltd.
+ * Author: Liviu Dudau 
+ *
+ */
+#define DEBUG
+#include 
+#include 
+#include 
+#ifdef CONFIG_DISPLAY
+#include 
+#endif
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define MALIDP_CORE_ID 0x0018
+#define MALIDP_REG_BG_COLOR0x0044
+#define MALIDP_LAYER_LV1   0x0100
+#define MALIDP_DC_STATUS   0xc000
+#define MALIDP_DC_CONTROL  0xc010
+#define MALIDP_DC_CFG_VALID0xc014
+
+/* offsets inside the modesetting register block */
+#define MALIDP_H_INTERVALS 0x
+#define MALIDP_V_INTERVALS 0x0004
+#define MALIDP_SYNC_CONTROL0x0008
+#define MALIDP_HV_ACTIVESIZE   0x000c
+#define MALIDP_OUTPUT_DEPTH0x001c
+
+/* offsets inside the layer register block */
+#define MALIDP_LAYER_FORMAT0x
+#define MALIDP_LAYER_CONTROL   0x0004
+#define MALIDP_LAYER_IN_SIZE   0x000c
+#define MALIDP_LAYER_CMP_SIZE  0x0010
+#define MALIDP_LAYER_STRIDE0x0018
+#define MALIDP_LAYER_PTR_LOW   0x0024
+#define MALIDP_LAYER_PTR_HIGH  0x0028
+
+/* offsets inside the IRQ control blocks */
+#define MALIDP_REG_MASKIRQ 0x0008
+#define MALIDP_REG_CLEARIRQ0x000c
+
+#define M1BITS 0x0001
+#define M2BITS 0x0003
+#define M4BITS 0x000f
+#define M8BITS 0x00ff
+#define M10BITS0x03ff
+#define M12BITS0x0fff
+#define M13BITS0x1fff
+#define M16BITS0x
+#define M17BITS0x1
+
+#define MALIDP_H_FRONTPORCH(x) (((x) & M12BITS) << 0)
+#define MALIDP_H_BACKPORCH(x)  (((x) & M10BITS) << 16)
+#define MALIDP_V_FRONTPORCH(x) (((x) & M12BITS) << 0)
+#define MALIDP_V_BACKPORCH(x)  (((x) & M8BITS) << 16)
+#define MALIDP_H_SYNCWIDTH(x)  (((x) & M10BITS) << 0)
+#define MALIDP_V_SYNCWIDTH(x)  (((x) & M8BITS) << 16)
+#define MALIDP_H_ACTIVE(x) (((x) & M13BITS) << 0)
+#define MALIDP_V_ACTIVE(x) (((x) & M13BITS) << 16)
+
+#define MALIDP_CMP_V_SIZE(x)   (((x) & M13BITS) << 16)
+#define MALIDP_CMP_H_SIZE(x)   (((x) & M13BITS) << 0)
+
+#define MALIDP_IN_V_SIZE(x)(((x) & M13BITS) << 16)
+#define MALIDP_IN_H_SIZE(x)(((x) & M13BITS) << 0)
+
+#define MALIDP_DC_CM_CONTROL(x)((x) & M1BITS) << 16, 1 << 16
+#define MALIDP_DC_STATUS_GET_CM(reg) (((reg) >> 16) & M1BITS)
+
+#define MALIDP_FORMAT_ARGB 0x08
+#define MALIDP_DEFAULT_BG_R 0x0
+#define MALIDP_DEFAULT_BG_G 0x0
+#define MALIDP_DEFAULT_BG_B 0x0
+
+#define MALIDP_PRODUCT_ID(core_id) ((u32)(core_id) >> 16)
+
+#define MALIDP500  0x500
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct malidp_priv {
+   phys_addr_t base_addr;
+   phys_addr_t dc_status_addr;
+   phys_addr_t dc_control_addr;
+   phys_addr_t cval_addr;
+   struct udevice 

Re: [U-Boot] [PATCH 4/5] net: ftgmac100: add support for Aspeed SoC

2018-09-28 Thread Cédric Le Goater
Hello Simon,

On 9/27/18 3:41 PM, Simon Glass wrote:
> Hi Cedric,
> 
> On 10 September 2018 at 07:21, Cédric Le Goater  wrote:
>> The Faraday ftgmac100 MAC controllers as found on the Aspeed SoCs have
>> some slight differences in the HW interface (End-Of-Rx/Tx-Ring
>> bits). Also include the Aspeed clock enablement.
>>
>> Signed-off-by: Cédric Le Goater 
>> ---
>>  drivers/net/ftgmac100.h |  5 +++
>>  drivers/net/ftgmac100.c | 72 +
>>  2 files changed, 71 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/ftgmac100.h b/drivers/net/ftgmac100.h
>> index 9a789e4d5bee..b8f99ddf48bc 100644
>> --- a/drivers/net/ftgmac100.h
>> +++ b/drivers/net/ftgmac100.h
>> @@ -129,6 +129,11 @@ struct ftgmac100 {
>>  #define FTGMAC100_DMAFIFOS_RXDMA_REQ   BIT(30)
>>  #define FTGMAC100_DMAFIFOS_TXDMA_REQ   BIT(31)
>>
>> +/*
>> + * Feature Register
>> + */
>> +#define FTGMAC100_REVR_NEW_MDIOBIT(31)
>> +
>>  /*
>>   * Receive buffer size register
>>   */
>> diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
>> index 8d7bf5b9b351..3df48a82c1ad 100644
>> --- a/drivers/net/ftgmac100.c
>> +++ b/drivers/net/ftgmac100.c
>> @@ -27,6 +27,8 @@
>>  /* PKTBUFSTX/PKTBUFSRX must both be power of 2 */
>>  #define PKTBUFSTX  4
>>
>> +#define FTGMAC100_ASPEED_NR_CLKS   2
>> +
>>  struct ftgmac100_data {
>> phys_addr_t iobase;
>>
>> @@ -40,6 +42,11 @@ struct ftgmac100_data {
> 
> Comments on struct and members

ok.

> 
>> struct mii_dev *bus;
>> u32 phy_mode;
>> u32 max_speed;
>> +
>> +   struct clk clks[FTGMAC100_ASPEED_NR_CLKS];
>> +   u32 rxdes0_edorr_mask;
>> +   u32 txdes0_edotr_mask;
>> +   bool is_aspeed;
>>  };
>>
>>  /*
>> @@ -115,9 +122,15 @@ static int ftgmac100_mdio_write(struct mii_dev *bus, 
>> int phy_addr, int dev_addr,
>>
>>  static int ftgmac100_mdio_init(struct ftgmac100_data *priv, int dev_id)
>>  {
>> +   struct ftgmac100 *ftgmac100 = (struct ftgmac100 *)priv->iobase;
>> struct mii_dev *bus;
>> int ret;
>>
>> +   if (priv->is_aspeed) {
> 
> Perhaps call this old_mdio_if ?

Well, this feature is related to the Aspeed socs. The old MDIO interface is used
by default so I think we don't have to force the value below. 

However, we can imagine selecting the mdio interface, new or old, through a DT 
property. I will follow your suggestion then.  
>> +   /* This driver supports the old MDIO interface */
>> +   clrbits_le32(>revr, FTGMAC100_REVR_NEW_MDIO);
>> +   };
>> +
>> bus = mdio_alloc();
>> if (!bus)
>> return -ENOMEM;
>> @@ -246,13 +259,13 @@ static int ftgmac100_start(struct udevice *dev)
>> priv->txdes[i].txdes3 = 0;
>> priv->txdes[i].txdes0 = 0;
>> }
>> -   priv->txdes[PKTBUFSTX - 1].txdes0 = FTGMAC100_TXDES0_EDOTR;
>> +   priv->txdes[PKTBUFSTX - 1].txdes0 = priv->txdes0_edotr_mask;
>>
>> for (i = 0; i < PKTBUFSRX; i++) {
>> priv->rxdes[i].rxdes3 = (unsigned int)net_rx_packets[i];
>> priv->rxdes[i].rxdes0 = 0;
>> }
>> -   priv->rxdes[PKTBUFSRX - 1].rxdes0 = FTGMAC100_RXDES0_EDORR;
>> +   priv->rxdes[PKTBUFSRX - 1].rxdes0 = priv->rxdes0_edorr_mask;
>>
>> /* transmit ring */
>> writel((u32)priv->txdes, >txr_badr);
>> @@ -378,7 +391,7 @@ static int ftgmac100_send(struct udevice *dev, void 
>> *packet, int length)
>> flush_dcache_range(data_start, data_end);
>>
>> /* only one descriptor on TXBUF */
>> -   curr_des->txdes0 &= FTGMAC100_TXDES0_EDOTR;
>> +   curr_des->txdes0 &= priv->txdes0_edotr_mask;
>> curr_des->txdes0 |= FTGMAC100_TXDES0_FTS |
>> FTGMAC100_TXDES0_LTS |
>> FTGMAC100_TXDES0_TXBUF_SIZE(length) |
>> @@ -409,8 +422,11 @@ static int ftgmac100_write_hwaddr(struct udevice *dev)
>>
>>  static int ftgmac100_ofdata_to_platdata(struct udevice *dev)
>>  {
>> +   struct ftgmac100_data *priv = dev_get_priv(dev);
>> struct eth_pdata *pdata = dev_get_platdata(dev);
>> const char *phy_mode;
>> +   int ret;
>> +   int i;
>>
>> pdata->iobase = devfdt_get_addr(dev);
>> pdata->phy_interface = -1;
>> @@ -424,13 +440,39 @@ static int ftgmac100_ofdata_to_platdata(struct udevice 
>> *dev)
>>
>> pdata->max_speed = dev_read_u32_default(dev, "max-speed", 0);
>>
>> +   if (device_is_compatible(dev, "aspeed,ast2500-mac")) {
> 
> Should use dev_get_driver_data() here.

OK. I see.

> 
>> +   priv->rxdes0_edorr_mask = BIT(30);
>> +   priv->txdes0_edotr_mask = BIT(30);
>> +   priv->is_aspeed = true;
>> +   } else {
>> +   priv->rxdes0_edorr_mask = BIT(15);
>> +   priv->txdes0_edotr_mask = BIT(15);
>> +   }
>> +
>> +   if (priv->is_aspeed) {
>> +   for (i = 0; i < FTGMAC100_ASPEED_NR_CLKS; 

[U-Boot] [PATCH v2] video: Add support for NXP's TDA19988 HDMI encoder

2018-09-28 Thread Liviu Dudau
Add support for the NXP TDA19988 HDMI encoder as used on the Juno
development board from Arm.

Signed-off-by: Liviu Dudau 
---
Changelog:
  - v2: Added MAINTAINERS entry and fixed checkpatch warnings.

 MAINTAINERS  |   5 +
 drivers/video/Kconfig|   8 +
 drivers/video/Makefile   |   1 +
 drivers/video/tda19988.c | 653 +++
 4 files changed, 667 insertions(+)
 create mode 100644 drivers/video/tda19988.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 11fc404167..112e41d2c3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -598,6 +598,11 @@ S: Maintained
 F: drivers/spmi/
 F: include/spmi/
 
+TDA19988 HDMI ENCODER
+M: Liviu Dudau 
+S: Maintained
+F: drivers/video/tda19988.c
+
 TI SYSTEM SECURITY
 M: Andrew F. Davis 
 S: Supported
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index ed0b21f2a7..5d932072a8 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -431,6 +431,14 @@ config DISPLAY
   The devices provide a simple interface to start up the display,
   read display information and enable it.
 
+config NXP_TDA19988
+   bool "Enable NXP TDA19988 support"
+   depends on DISPLAY
+   default n
+   help
+ This enables support for the NXP TDA19988 HDMI encoder. This encoder
+ will convert RGB data streams into HDMI-encoded signals.
+
 config ATMEL_HLCD
bool "Enable ATMEL video support using HLCDC"
depends on DM_VIDEO
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 0f41a23193..4c130e179d 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o
 obj-$(CONFIG_LD9040) += ld9040.o
 obj-$(CONFIG_LG4573) += lg4573.o
 obj-$(CONFIG_LOGICORE_DP_TX) += logicore_dp_tx.o
+obj-$(CONFIG_NXP_TDA19988) += tda19988.o
 obj-$(CONFIG_PXA_LCD) += pxa_lcd.o
 obj-$(CONFIG_S6E8AX0) += s6e8ax0.o
 obj-$(CONFIG_SCF0403_LCD) += scf0403_lcd.o
diff --git a/drivers/video/tda19988.c b/drivers/video/tda19988.c
new file mode 100644
index 00..01ed6193ea
--- /dev/null
+++ b/drivers/video/tda19988.c
@@ -0,0 +1,653 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2018 Liviu Dudau 
+ *
+ * Based on the Linux driver, (C) 2012 Texas Instruments
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * TDA19988 uses paged registers. We encode the page# in the upper
+ * bits of the register#. It also means that reads/writes to a register
+ * have to ensure that the register's page is selected as the current
+ * page.
+ */
+#define REG(page, addr)(((page) << 8) | (addr))
+#define REG2ADDR(reg)  ((reg) & 0xff)
+#define REG2PAGE(reg)  (((reg) >> 8) & 0xff)
+
+/* register for setting current page */
+#define REG_CURRENT_PAGE   0xff
+
+/* Page 00h: General Control */
+#define REG_VERSION_LSBREG(0x00, 0x00) /* read */
+#define REG_MAIN_CNTRL0REG(0x00, 0x01) /* read/write */
+#define  MAIN_CNTRL0_SRBIT(0)
+#define  MAIN_CNTRL0_DECS  BIT(1)
+#define  MAIN_CNTRL0_DEHS  BIT(2)
+#define  MAIN_CNTRL0_CECS  BIT(3)
+#define  MAIN_CNTRL0_CEHS  BIT(4)
+#define  MAIN_CNTRL0_SCALERBIT(7)
+#define REG_VERSION_MSBREG(0x00, 0x02) /* read */
+#define REG_SOFTRESET  REG(0x00, 0x0a) /* write */
+#define  SOFTRESET_AUDIO   BIT(0)
+#define  SOFTRESET_I2C_MASTER  BIT(1)
+#define REG_DDC_DISABLEREG(0x00, 0x0b) /* read/write */
+#define REG_I2C_MASTER REG(0x00, 0x0d) /* read/write */
+#define  I2C_MASTER_DIS_MM BIT(0)
+#define  I2C_MASTER_DIS_FILT   BIT(1)
+#define  I2C_MASTER_APP_STRT_LAT BIT(2)
+#define REG_FEAT_POWERDOWN REG(0x00, 0x0e) /* read/write */
+#define  FEAT_POWERDOWN_PREFILTBIT(0)
+#define  FEAT_POWERDOWN_CSCBIT(1)
+#define  FEAT_POWERDOWN_SPDIF  BIT(3)
+#define REG_INT_FLAGS_0REG(0x00, 0x0f) /* read/write */
+#define REG_INT_FLAGS_1REG(0x00, 0x10) /* read/write */
+#define REG_INT_FLAGS_2REG(0x00, 0x11) /* read/write */
+#define  INT_FLAGS_2_EDID_BLK_RD  BIT(1)
+#define REG_ENA_VP_0   REG(0x00, 0x18) /* read/write */
+#define REG_ENA_VP_1   REG(0x00, 0x19) /* read/write */
+#define REG_ENA_VP_2   REG(0x00, 0x1a) /* read/write */
+#define REG_ENA_AP REG(0x00, 0x1e) /* read/write */
+#define REG_VIP_CNTRL_0REG(0x00, 0x20) /* write */
+#define  VIP_CNTRL_0_MIRR_ABIT(7)
+#define  VIP_CNTRL_0_SWAP_A(x) (((x) & 7) << 4)
+#define  VIP_CNTRL_0_MIRR_BBIT(3)
+#define  VIP_CNTRL_0_SWAP_B(x) (((x) & 7) << 0)
+#define REG_VIP_CNTRL_1REG(0x00, 0x21) /* write */
+#define  VIP_CNTRL_1_MIRR_CBIT(7)
+#define  VIP_CNTRL_1_SWAP_C(x) (((x) & 7) << 4)
+#define  VIP_CNTRL_1_MIRR_DBIT(3)
+#define  VIP_CNTRL_1_SWAP_D(x) (((x) & 7) << 0)

[U-Boot] [PATCH v2] i2c: Add support for the Arm's Versatile Express I2C controller.

2018-09-28 Thread Liviu Dudau
The Arm Versatile Express I2C controller is a simple register-based
controller that uses a register to control the state of the SCL and
SDA lines. Add support for it.

Signed-off-by: Liviu Dudau 
Reviewed-by: Heiko Schocher 
---
Changelog:
  - v2: Added MAINTAINERS entry and fixed checkpatch warnings.

 MAINTAINERS |   1 +
 drivers/i2c/Kconfig |   7 +
 drivers/i2c/Makefile|   1 +
 drivers/i2c/i2c-versatile.c | 280 
 4 files changed, 289 insertions(+)
 create mode 100644 drivers/i2c/i2c-versatile.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 1aa68e8135..11fc404167 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -291,6 +291,7 @@ M:  Liviu Dudau 
 S: Maintained
 T: git git://github.com/ARM-software/u-boot.git
 F: drivers/clk/clk_vexpress_osc.c
+F: drivers/i2c/i2c-versatile.c
 F: drivers/misc/vexpress_config.c
 N: vexpress
 
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index ae3b501555..1ef22e6bcd 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -416,6 +416,13 @@ config SYS_I2C_UNIPHIER_F
  Support for UniPhier FIFO-builtin I2C controller driver.
  This I2C controller is used on PH1-Pro4 or newer UniPhier SoCs.
 
+config SYS_I2C_VERSATILE
+   bool "Arm Ltd Versatile I2C bus driver"
+   depends on DM_I2C && (TARGET_VEXPRESS_CA15_TC2 || 
TARGET_VEXPRESS64_JUNO)
+   help
+ Add support for the Arm Ltd Versatile Express I2C driver. The I2C host
+ controller is present in the development boards manufactured by Arm 
Ltd.
+
 config SYS_I2C_MVTWSI
bool "Marvell I2C driver"
depends on DM_I2C
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index f2cbe78c53..d3637bcd8d 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_SYS_I2C_STM32F7) += stm32f7_i2c.o
 obj-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o
 obj-$(CONFIG_SYS_I2C_UNIPHIER) += i2c-uniphier.o
 obj-$(CONFIG_SYS_I2C_UNIPHIER_F) += i2c-uniphier-f.o
+obj-$(CONFIG_SYS_I2C_VERSATILE) += i2c-versatile.o
 obj-$(CONFIG_SYS_I2C_ZYNQ) += zynq_i2c.o
 obj-$(CONFIG_TEGRA186_BPMP_I2C) += tegra186_bpmp_i2c.o
 
diff --git a/drivers/i2c/i2c-versatile.c b/drivers/i2c/i2c-versatile.c
new file mode 100644
index 00..f523844204
--- /dev/null
+++ b/drivers/i2c/i2c-versatile.c
@@ -0,0 +1,280 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2018 Arm Ltd.
+ * Author: Liviu Dudau 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define I2C_CONTROL_REG0x00
+#define I2C_SET_REG0x00
+#define I2C_CLEAR_REG  0x04
+
+#define SCLBIT(0)
+#define SDABIT(1)
+
+struct versatile_i2c_priv {
+   phys_addr_t base;
+   u32 delay;
+};
+
+static inline void versatile_sda_set(struct versatile_i2c_priv *priv, u8 state)
+{
+   writel(SDA, priv->base + (state ? I2C_SET_REG : I2C_CLEAR_REG));
+   udelay(priv->delay);
+}
+
+static inline int versatile_sda_get(struct versatile_i2c_priv *priv)
+{
+   int v = !!(readl(priv->base + I2C_CONTROL_REG) & SDA);
+
+   udelay(priv->delay);
+   return v;
+}
+
+static inline void versatile_scl_set(struct versatile_i2c_priv *priv, u8 state)
+{
+   writel(SCL, priv->base + (state ? I2C_SET_REG : I2C_CLEAR_REG));
+   udelay(priv->delay);
+}
+
+static inline int versatile_scl_get(struct versatile_i2c_priv *priv)
+{
+   int v = !!(readl(priv->base + I2C_CONTROL_REG) & SCL);
+
+   udelay(priv->delay);
+   return v;
+}
+
+/* start: SDA goes from high to low while SCL is high */
+static void versatile_i2c_start(struct versatile_i2c_priv *priv)
+{
+   udelay(priv->delay);
+   versatile_sda_set(priv, 1);
+   versatile_scl_set(priv, 1);
+   versatile_sda_set(priv, 0);
+}
+
+/* stop: SDA goes from low to high while SCL is high */
+static void versatile_i2c_stop(struct versatile_i2c_priv *priv)
+{
+   versatile_scl_set(priv, 0);
+   versatile_sda_set(priv, 0);
+   versatile_scl_set(priv, 1);
+   versatile_sda_set(priv, 1);
+}
+
+/* read a bit from the SDA line (data or ACK/NACK) */
+static u8 versatile_i2c_read_bit(struct versatile_i2c_priv *priv)
+{
+   versatile_scl_set(priv, 0);
+   versatile_sda_set(priv, 1);
+   versatile_scl_set(priv, 1);
+   udelay(priv->delay);
+   return (u8)versatile_sda_get(priv);
+}
+
+/* write a bit on the SDA line */
+static void versatile_i2c_write_bit(struct versatile_i2c_priv *priv, u8 bit)
+{
+   versatile_scl_set(priv, 0);
+   versatile_sda_set(priv, bit);
+   versatile_scl_set(priv, 1);
+   udelay(priv->delay);
+}
+
+/* send a reset sequence of 9 clocks with SDA high */
+static void versatile_i2c_reset_bus(struct versatile_i2c_priv *priv)
+{
+   int i;
+
+   for (i = 0; i < 9; i++)
+   versatile_i2c_write_bit(priv, 1);
+
+   versatile_i2c_stop(priv);
+}
+
+/* write byte without start/stop 

[U-Boot] [PATCH v3] misc: Add support for the Arm Versatile Express config bus

2018-09-28 Thread Liviu Dudau
Add support for the Arm Versatile Express config bus that is
being used for exposing various subsystems via a generic
configuration bus. This driver adds support for generating
transactions on this configuration bus and can be used by
other drivers to abstract the communication with the actual
function providers.

Signed-off-by: Liviu Dudau 
Reviewed-by: Heiko Schocher 
---

Changelog:
 - v3: Added MAINTAINERS entry and Reviewed-by tag
 - v2: removed #define DEBUG line leftover

 MAINTAINERS|   7 ++
 drivers/misc/Kconfig   |   8 +++
 drivers/misc/Makefile  |   1 +
 drivers/misc/vexpress_config.c | 128 +
 4 files changed, 144 insertions(+)
 create mode 100644 drivers/misc/vexpress_config.c

diff --git a/MAINTAINERS b/MAINTAINERS
index ea21d59f1e..613d7b29a0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -286,6 +286,13 @@ F: arch/arm/mach-uniphier/
 F: configs/uniphier_*_defconfig
 N: uniphier
 
+ARM VERSATILE EXPRESS DRIVERS
+M: Liviu Dudau 
+S: Maintained
+T: git git://github.com/ARM-software/u-boot.git
+F: drivers/misc/vexpress_config.c
+N: vexpress
+
 ARM ZYNQ
 M: Michal Simek 
 S: Maintained
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index bfa5c91687..78dc9264f9 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -41,6 +41,14 @@ config ROCKCHIP_EFUSE
  extended (by porting the read function from the Linux kernel sources)
  to support other recent Rockchip devices.
 
+config VEXPRESS_CONFIG
+   bool "Enable support for Arm Versatile Express config bus"
+   depends on MISC
+   help
+ If you say Y here, you will get support for accessing the
+ configuration bus on the Arm Versatile Express boards via
+ a sysreg driver.
+
 config CMD_CROS_EC
bool "Enable crosec command"
depends on CROS_EC
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index da4666fdfc..50b52f9aa5 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -55,4 +55,5 @@ obj-$(CONFIG_STM32MP_FUSE) += stm32mp_fuse.o
 obj-$(CONFIG_SYS_DPAA_QBMAN) += fsl_portals.o
 obj-$(CONFIG_GDSYS_IOEP) += gdsys_ioep.o
 obj-$(CONFIG_GDSYS_RXAUI_CTRL) += gdsys_rxaui_ctrl.o
+obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress_config.o
 obj-$(CONFIG_MPC83XX_SERDES) += mpc83xx_serdes.o
diff --git a/drivers/misc/vexpress_config.c b/drivers/misc/vexpress_config.c
new file mode 100644
index 00..9f5baa5288
--- /dev/null
+++ b/drivers/misc/vexpress_config.c
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Arm Ltd
+ * Author: Liviu Dudau 
+ *
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define SYS_CFGDATA0xa0
+
+#define SYS_CFGCTRL0xa4
+#define SYS_CFGCTRL_START  BIT(31)
+#define SYS_CFGCTRL_WRITE  BIT(30)
+
+#define SYS_CFGSTAT0xa8
+#define SYS_CFGSTAT_ERRBIT(1)
+#define SYS_CFGSTAT_COMPLETE   BIT(0)
+
+struct vexpress_config_sysreg {
+   phys_addr_t addr;
+   u32 site;
+};
+
+static int vexpress_config_exec(struct vexpress_config_sysreg *syscfg,
+   bool write, void *buf, int size)
+{
+   u32 cmd, status, tries = 100;
+
+   cmd = (*(u32 *)buf) | SYS_CFGCTRL_START | (syscfg->site << 16);
+
+   if (!write) {
+   /* write a canary in the data register for reads */
+   writel(0xdeadbeef, syscfg->addr + SYS_CFGDATA);
+   } else {
+   cmd |= SYS_CFGCTRL_WRITE;
+   writel(((u32 *)buf)[1], syscfg->addr + SYS_CFGDATA);
+   }
+   writel(0, syscfg->addr + SYS_CFGSTAT);
+   writel(cmd, syscfg->addr + SYS_CFGCTRL);
+
+   /* completion of command takes ages, go to sleep (150us) */
+   do {
+   udelay(150);
+   status = readl(syscfg->addr + SYS_CFGSTAT);
+   if (status & SYS_CFGSTAT_ERR)
+   return -EFAULT;
+   } while (--tries && !(status & SYS_CFGSTAT_COMPLETE));
+
+   if (!tries)
+   return -ETIMEDOUT;
+
+   if (!write)
+   (*(u32 *)buf) = readl(syscfg->addr + SYS_CFGDATA);
+
+   return 0;
+}
+
+static int vexpress_config_read(struct udevice *dev,
+   int offset, void *buf, int size)
+{
+   struct vexpress_config_sysreg *priv = dev_get_uclass_priv(dev);
+
+   if (size != sizeof(u32))
+   return -EINVAL;
+
+   return vexpress_config_exec(priv, false, buf, size);
+}
+
+static int vexpress_config_write(struct udevice *dev,
+int offset, const void *buf, int size)
+{
+   struct vexpress_config_sysreg *priv = dev_get_uclass_priv(dev);
+
+   if (size != sizeof(u32) * 2)
+   return -EINVAL;
+
+   return vexpress_config_exec(priv, true, (void *)buf, size);
+}
+
+static struct misc_ops vexpress_config_ops = {
+   .read = 

Re: [U-Boot] [PATCH 2/5] net: re-add support for the Faraday ftgmac100 controller

2018-09-28 Thread Cédric Le Goater
Hello Simon,

On 9/27/18 3:41 PM, Simon Glass wrote:
> Hi Cedric,
> 
> On 10 September 2018 at 07:21, Cédric Le Goater  wrote:
>> The driver is based on the previous one and adds the same support for
>> the Faraday ftgmac100 controller with MAC and MDIO bus support for
>> RGMII/RMII modes.
>>
>> Driver model support was added as well as some enhancements and fixes.
>>
>> Signed-off-by: Cédric Le Goater 
>> ---
>>  drivers/net/ftgmac100.h | 242 
>>  drivers/net/ftgmac100.c | 493 
>>  drivers/net/Kconfig |   8 +
>>  drivers/net/Makefile|   1 +
>>  4 files changed, 744 insertions(+)
>>  create mode 100644 drivers/net/ftgmac100.h
>>  create mode 100644 drivers/net/ftgmac100.c
> 
> Reviewed-by: Simon Glass 
> 
> Various minor comments below.
> 
>>
>> diff --git a/drivers/net/ftgmac100.h b/drivers/net/ftgmac100.h
>> new file mode 100644
>> index ..9a789e4d5bee
>> --- /dev/null
>> +++ b/drivers/net/ftgmac100.h
>> @@ -0,0 +1,242 @@
>> +/* SPDX-License-Identifier: GPL-2.0+ */
>> +/*
>> + * Faraday FTGMAC100 Ethernet
>> + *
>> + * (C) Copyright 2010 Faraday Technology
>> + * Po-Yu Chuang 
>> + *
>> + * (C) Copyright 2010 Andes Technology
>> + * Macpaul Lin 
>> + */
>> +
>> +#ifndef __FTGMAC100_H
>> +#define __FTGMAC100_H
>> +
>> +/* The registers offset table of ftgmac100 */
>> +struct ftgmac100 {
>> +   unsigned intisr;/* 0x00 */
>> +   unsigned intier;/* 0x04 */
>> +   unsigned intmac_madr;   /* 0x08 */
>> +   unsigned intmac_ladr;   /* 0x0c */
>> +   unsigned intmaht0;  /* 0x10 */
>> +   unsigned intmaht1;  /* 0x14 */
>> +   unsigned inttxpd;   /* 0x18 */
>> +   unsigned intrxpd;   /* 0x1c */
>> +   unsigned inttxr_badr;   /* 0x20 */
>> +   unsigned intrxr_badr;   /* 0x24 */
>> +   unsigned inthptxpd; /* 0x28 */
>> +   unsigned inthptxpd_badr;/* 0x2c */
>> +   unsigned intitc;/* 0x30 */
>> +   unsigned intaptc;   /* 0x34 */
>> +   unsigned intdblac;  /* 0x38 */
>> +   unsigned intdmafifos;   /* 0x3c */
>> +   unsigned intrevr;   /* 0x40 */
>> +   unsigned intfear;   /* 0x44 */
>> +   unsigned inttpafcr; /* 0x48 */
>> +   unsigned intrbsr;   /* 0x4c */
>> +   unsigned intmaccr;  /* 0x50 */
>> +   unsigned intmacsr;  /* 0x54 */
>> +   unsigned inttm; /* 0x58 */
>> +   unsigned intresv1;  /* 0x5c */ /* not defined in spec */
>> +   unsigned intphycr;  /* 0x60 */
>> +   unsigned intphydata;/* 0x64 */
>> +   unsigned intfcr;/* 0x68 */
>> +   unsigned intbpr;/* 0x6c */
>> +   unsigned intwolcr;  /* 0x70 */
>> +   unsigned intwolsr;  /* 0x74 */
>> +   unsigned intwfcrc;  /* 0x78 */
>> +   unsigned intresv2;  /* 0x7c */ /* not defined in spec */
>> +   unsigned intwfbm1;  /* 0x80 */
>> +   unsigned intwfbm2;  /* 0x84 */
>> +   unsigned intwfbm3;  /* 0x88 */
>> +   unsigned intwfbm4;  /* 0x8c */
>> +   unsigned intnptxr_ptr;  /* 0x90 */
>> +   unsigned inthptxr_ptr;  /* 0x94 */
>> +   unsigned intrxr_ptr;/* 0x98 */
>> +   unsigned intresv3;  /* 0x9c */ /* not defined in spec */
>> +   unsigned inttx; /* 0xa0 */
>> +   unsigned inttx_mcol_scol;   /* 0xa4 */
>> +   unsigned inttx_ecol_fail;   /* 0xa8 */
>> +   unsigned inttx_lcol_und;/* 0xac */
>> +   unsigned intrx; /* 0xb0 */
>> +   unsigned intrx_bc;  /* 0xb4 */
>> +   unsigned intrx_mc;  /* 0xb8 */
>> +   unsigned intrx_pf_aep;  /* 0xbc */
>> +   unsigned intrx_runt;/* 0xc0 */
>> +   unsigned intrx_crcer_ftl;   /* 0xc4 */
>> +   unsigned intrx_col_lost;/* 0xc8 */
>> +};
>> +
>> +/*
>> + * Interrupt status register & interrupt enable register
>> + */
>> +#define FTGMAC100_INT_RPKT_BUF BIT(0)
>> +#define FTGMAC100_INT_RPKT_FIFOBIT(1)
>> +#define FTGMAC100_INT_NO_RXBUF BIT(2)
>> +#define FTGMAC100_INT_RPKT_LOSTBIT(3)
>> +#define FTGMAC100_INT_XPKT_ETH BIT(4)
>> +#define FTGMAC100_INT_XPKT_FIFOBIT(5)
>> +#define FTGMAC100_INT_NO_NPTXBUF   BIT(6)
>> +#define FTGMAC100_INT_XPKT_LOSTBIT(7)
>> +#define FTGMAC100_INT_AHB_ERR  BIT(8)
>> +#define FTGMAC100_INT_PHYSTS_CHG   BIT(9)
>> +#define FTGMAC100_INT_NO_HPTXBUF   BIT(10)
>> +
>> +/*
>> + * Interrupt timer control register
>> + */
>> +#define FTGMAC100_ITC_RXINT_CNT(x) 

Re: [U-Boot] [PATCH 01/48] mpc83xx: Introduce ARCH_MPC830*

2018-09-28 Thread Bin Meng
Hi Mario,

On Fri, Sep 28, 2018 at 5:59 PM Mario Six  wrote:
>
> Replace CONFIG_MPC830* with proper CONFIG_ARCH_MPC830* Kconfig options.
>
> Signed-off-by: Mario Six 
> ---
>  arch/powerpc/cpu/mpc83xx/Kconfig | 17 +
>  arch/powerpc/cpu/mpc83xx/spd_sdram.c |  2 +-
>  arch/powerpc/cpu/mpc83xx/speed.c | 38 
> ++--
>  arch/powerpc/include/asm/arch-mpc83xx/gpio.h |  2 +-
>  arch/powerpc/include/asm/fsl_lbc.h   |  2 +-
>  arch/powerpc/include/asm/global_data.h   |  6 ++---
>  arch/powerpc/include/asm/immap_83xx.h| 10 
>  arch/powerpc/include/asm/mpc8xxx_spi.h   |  2 +-
>  board/keymile/km83xx/km83xx.c|  2 +-
>  drivers/qe/qe.c  |  2 +-
>  drivers/ram/mpc83xx_sdram.c  |  4 +--
>  include/configs/MPC8308RDB.h |  2 --
>  include/configs/hrcon.h  |  2 --
>  include/configs/km/km8309-common.h   |  2 --
>  include/configs/km/km83xx-common.h   |  2 +-
>  include/configs/mpc8308_p1m.h|  2 --
>  include/configs/strider.h|  2 --
>  include/linux/immap_qe.h |  2 +-
>  include/mpc83xx.h| 24 +-
>  19 files changed, 66 insertions(+), 59 deletions(-)
>

One generic comments, shouldn't we call these CONFIG_SOC_XXX? Arch
means architecture, but they are all PowerPC architecture..

Regards,
Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] spi: Add support for the Aspeed ast2500 SPI controllers

2018-09-28 Thread Cédric Le Goater
Hello Simon,


The Aspeed AST2500 FMC controller can handle SPI flash and NOR flash memory,
and the Aspeed AST2500 SPI Flash Controllers only SPI. If there is some 
misunderstanding on this driver, it might come from the fact it is closer 
to a SPI-NOR driver like we have in Linux, than a generic SPI driver. 
The stm32 SPI driver is somewhat similar.

Should we move it under drivers/mtd/spi/ maybe ? 

Nevertheless, I think I can improve the dependency on the spi_flash driver
and probably remove the aspeed_spi_flash struct. 


On 9/27/18 3:41 PM, Simon Glass wrote:
> Hi Cedric,
> 
> On 10 September 2018 at 07:16, Cédric Le Goater  wrote:
>> The Aspeed AST2500 SoC comes with three static memory controllers, all
>> with a similar interface :
>>
>>  * Firmware SPI Memory Controller (FMC)
>>. BMC firmware
>>. 3 chip select pins (CE0 ~ CE2)
>>. supports SPI type flash memory (CE0 ~ CE1)
>>. CE2 can be of NOR type flash but this is not supported by the
>>  driver
>>
>>  * SPI Flash Controller (SPI1 and SPI2)
>>. host firmware
>>. 2 chip select pins (CE0 ~ CE1)
>>
>> Each controller has a defined AHB window for its registers and another
>> AHB window on which all the flash devices are mapped. Each device is
>> assigned a memory range through a set of registers called the Segment
>> Address Registers.
>>
>> Devices are controlled using two different modes: the USER command
>> mode or the READ/WRITE command mode. When in USER command mode,
>> accesses to the AHB window of the SPI flash device are translated into
>> SPI command transfers. When in READ/WRITE command mode, the HW
>> generates the SPI commands depending on the setting of the CE control
>> register.
>>
>> The following driver supports the FMC and the SPI controllers with the
>> attached SPI flash devices. When the controller is probed, the driver
>> performs a read timing calibration using specific DMA control
>> registers (FMC only). The driver's primary goal is to support the
>> first device of the FMC controller on which reside U-Boot but it
>> should support the other controllers also.
>>
>> The Aspeed FMC controller automatically detects at boot time if a
>> flash device is in 4BYTE address mode and self configures to use the
>> appropriate address width. This can be a problem for the U-Boot SPI
>> Flash layer which only supports 3 byte addresses. In such a case, a
>> warning is emitted and the address width is fixed when sent on the
>> bus.
>>
>> Signed-off-by: Cédric Le Goater 
>> ---
>>  arch/arm/include/asm/arch-aspeed/spi.h | 114 
>>  drivers/spi/aspeed_spi.c   | 788 +
>>  drivers/spi/Kconfig|   8 +
>>  drivers/spi/Makefile   |   1 +
>>  4 files changed, 911 insertions(+)
>>  create mode 100644 arch/arm/include/asm/arch-aspeed/spi.h
>>  create mode 100644 drivers/spi/aspeed_spi.c
>>
>> diff --git a/arch/arm/include/asm/arch-aspeed/spi.h 
>> b/arch/arm/include/asm/arch-aspeed/spi.h
>> new file mode 100644
>> index ..9e952933e1f1
>> --- /dev/null
>> +++ b/arch/arm/include/asm/arch-aspeed/spi.h
>> @@ -0,0 +1,114 @@
>> +// SPDX-License-Identifier: GPL-2.0+
>> +/*
>> + * Copyright (c) 2018, IBM Corporation.
>> + */
>> +
>> +#ifndef _ASM_ARCH_ASPEED_SPI_H
>> +#define _ASM_ARCH_ASPEED_SPI_H
>> +
>> +/* CE Type Setting Register */
>> +#define CONF_ENABLE_W2 BIT(18)
>> +#define CONF_ENABLE_W1 BIT(17)
>> +#define CONF_ENABLE_W0 BIT(16)
>> +#define CONF_FLASH_TYPE2   4
>> +#define CONF_FLASH_TYPE1   2   /* Hardwired to SPI */
>> +#define CONF_FLASH_TYPE0   0   /* Hardwired to SPI */
>> +#define  CONF_FLASH_TYPE_NOR   0x0
>> +#define  CONF_FLASH_TYPE_SPI   0x2
>> +
>> +/* CE Control Register */
>> +#define CTRL_EXTENDED2 BIT(2)  /* 32 bit addressing for SPI 
>> */
>> +#define CTRL_EXTENDED1 BIT(1)  /* 32 bit addressing for SPI 
>> */
>> +#define CTRL_EXTENDED0 BIT(0)  /* 32 bit addressing for SPI 
>> */
>> +
>> +/* Interrupt Control and Status Register */
>> +#define INTR_CTRL_DMA_STATUS   BIT(11)
>> +#define INTR_CTRL_CMD_ABORT_STATUS BIT(10)
>> +#define INTR_CTRL_WRITE_PROTECT_STATUS BIT(9)
>> +#define INTR_CTRL_DMA_EN   BIT(3)
>> +#define INTR_CTRL_CMD_ABORT_EN BIT(2)
>> +#define INTR_CTRL_WRITE_PROTECT_EN BIT(1)
>> +
>> +/* CEx Control Register */
>> +#define CE_CTRL_IO_MODE_MASK   GENMASK(30, 28)
>> +#define CE_CTRL_IO_DUAL_DATA   BIT(29)
>> +#define CE_CTRL_IO_DUAL_ADDR_DATA  (BIT(29) | BIT(28))
>> +#define CE_CTRL_CMD_SHIFT  16
>> +#define CE_CTRL_CMD_MASK   0xff
>> +#define CE_CTRL_CMD(cmd)   \
>> +   (((cmd) & CE_CTRL_CMD_MASK) << CE_CTRL_CMD_SHIFT)
>> +#define CE_CTRL_DUMMY_HIGH_SHIFT   14
>> +#define CE_CTRL_CLOCK_FREQ_SHIFT   8
>> 

Re: [U-Boot] [PATCH] arm: socfpga: stratix10: Add generic FPGA reconfig mailbox API for S10

2018-09-28 Thread Ang, Chee Hong
On Thu, 2018-09-27 at 22:39 +0200, Marek Vasut wrote:
> On 09/27/2018 08:37 AM, Ang, Chee Hong wrote:
> > 
> > On Thu, 2018-09-27 at 08:21 +0200, Marek Vasut wrote:
> > > 
> > > On 09/27/2018 07:08 AM, Ang, Chee Hong wrote:
> > > > 
> > > > 
> > > > On Wed, 2018-09-26 at 16:53 +0200, Marek Vasut wrote:
> > > > > 
> > > > > 
> > > > > On 09/26/2018 11:03 AM, chee.hong@intel.com wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > From: "Ang, Chee Hong" 
> > > > > > 
> > > > > > Add a generic mailbox API for FPGA reconfig status which
> > > > > > can be
> > > > > > called by others. This new function accepts 2 different
> > > > > > mailbox
> > > > > > commands: CONFIG_STATUS or RECONFIG_STATUS.
> > > > > What "others" can call this ?
> > > > This is a common function used to check the readiness of the
> > > > FPGA.
> > > > FPGA configuration drivers will need to call this to make sure
> > > > the FPGA configuration is successfully completed and running.
> > > > These FPGA configuration drivers will be submitted soon after
> > > > this
> > > > patch.
> > > So this should be in drivers/fpga/ ?
> > Yes. There is a FPGA configuration driver under this folder. Will
> > submit soon.
> > > 
> > > 
> > > Also, don't add dead code, just submit this alongside the user of
> > > this code.
> > The reason I try to get this common function upstream is because my
> > colleague is trying to upstream socfpga dwmac driver which also
> > need to
> > call this function to check whether the soft Ip running on FPGA for
> > the
> > dwmac driver is up and running.
> SoCFPGA dwmac support is already upstream. Can you explain why it
> needs
> to query the FPGA at all ? Is the whole dwmac in the FPGA ? Or is the
> dwmac just routed through FPGA ?
dwmac driver need to call this function to access PCS (MAC PHY) which
is routed through FPGA.
> 
> > 
> > If I bundle this code alongside with my
> > FPGA configuration driver, it might take longer time to get into
> > the
> > mainline. So this common function is blocking other to upstream
> > his/her
> > code.
> I'm not really fond of accepting dead code, on which code I didn't
> even
> see and design that's unclear depends.
I understand. Can I submit another FPGA driver patchsets and refer this
patch as the dependency ? The FPGA driver patchsets is the user of the
common function.
> 
> > 
> > > 
> > > > 
> > > > > 
> > > > > > 
> > > > > > Signed-off-by: Ang, Chee Hong 
> > > > > > ---
> > > > > >  arch/arm/mach-socfpga/include/mach/mailbox_s10.h |  3 +-
> > > > > >  arch/arm/mach-socfpga/mailbox_s10.c  | 48
> > > > > > 
> > > > > >  2 files changed, 50 insertions(+), 1 deletion(-)
> > > > > > 
> > > > > > diff --git a/arch/arm/mach-
> > > > > > socfpga/include/mach/mailbox_s10.h
> > > > > > b/arch/arm/mach-socfpga/include/mach/mailbox_s10.h
> > > > > > index 81a609d..660df35 100644
> > > > > > --- a/arch/arm/mach-socfpga/include/mach/mailbox_s10.h
> > > > > > +++ b/arch/arm/mach-socfpga/include/mach/mailbox_s10.h
> > > > > > @@ -140,5 +140,6 @@ int mbox_qspi_open(void);
> > > > > >  #endif
> > > > > >  
> > > > > >  int mbox_reset_cold(void);
> > > > > > -
> > > > > > +int mbox_get_fpga_config_status(u32 cmd);
> > > > > > +int mbox_get_fpga_config_status_psci(u32 cmd);
> > > > > >  #endif /* _MAILBOX_S10_H_ */
> > > > > > diff --git a/arch/arm/mach-socfpga/mailbox_s10.c
> > > > > > b/arch/arm/mach-
> > > > > > socfpga/mailbox_s10.c
> > > > > > index 0d906c3..345485c 100644
> > > > > > --- a/arch/arm/mach-socfpga/mailbox_s10.c
> > > > > > +++ b/arch/arm/mach-socfpga/mailbox_s10.c
> > > > > > @@ -342,6 +342,54 @@ int mbox_reset_cold(void)
> > > > > >     return 0;
> > > > > >  }
> > > > > >  
> > > > > > +/* Accepted commands: CONFIG_STATUS or RECONFIG_STATUS */
> > > > > > +static __always_inline int
> > > > > > mbox_get_fpga_config_status_common(u32
> > > > > > cmd)
> > > > > Why __always_inline ?
> > > > This function is needed in 2 sections. Our u-boot run in normal
> > > > code
> > > > section and '__secure' section which mainly used for PSCI
> > > > services.
> > > > Refer to the 'mbox_get_fpga_config_status()' and
> > > > 'mbox_get_fpga_config_status_psci()' below. These 2 functions
> > > > run
> > > > in 2
> > > > different sections and they need to call this function.
> > > But why does this need to be __always_inline ? The compiler can
> > > decide
> > > what's best.
> > This is dangerous. Let me explain in more details why we need this,
> > '__secure' section and normal '.code' section exist in different
> > time.
> > '.code' section no longer valid once u-boot boot to OS, but
> > '__secure'
> > section still exist after booting to OS because OS need to call
> > PSCI
> > services to achieve certain things. We need to make sure both
> > sections
> > contain the full code, therefore we need to enforce the compiler to
> > duplicate this piece of code to both sections as well. 
> How does the __always_inline help with that ?

Re: [U-Boot] [PATCH v3 0/4] Add Rock960 and Ficus 96Board support

2018-09-28 Thread Daniel Lezcano
On 27/09/2018 21:02, Manivannan Sadhasivam wrote:
> This patchset adds support for Rock960 and Ficus 96Boards from Vamrs.
> Since both boards share most of the configurations, a common Rock960
> family support is added with common support and the actual boards are
> based on this.
> 
> The previous version of the patchseries were adding Rock960 [1] and
> Ficus [2] board support individually, but this series fuses them
> together based on the common board support as per Linux kernel.
> 
> [1] https://patchwork.ozlabs.org/cover/963239/
> [2] https://lists.denx.de/pipermail/u-boot/2018-August/339059.html
> 
> This patchseries has been tested on Rock960 v1.2 board and expecting
> Ezequiel to do the testing for Ficus.
> 
> PS: I have explicitly removed the previous Ack's for the Ficus board
> since there has been a heavy modification done on these patches.


With this series I was able to boot the rock960 board (4GB/32GB) and
tftp load a kernel following the instructions given in the documentation.

Tested-by: Daniel Lezcano 


> Manivannan Sadhasivam (4):
>   arm: dts: rockchip: add some common pin-settings to rk3399
>   rockchip: rk3399: Add common Rock960 family from Vamrs
>   rockchip: rk3399: Add Rock960 CE board support
>   rockchip: rk3399: Add Ficus EE board support
> 
>  arch/arm/dts/Makefile |2 +
>  arch/arm/dts/rk3399-ficus.dts |   78 +
>  arch/arm/dts/rk3399-rock960.dts   |   45 +
>  arch/arm/dts/rk3399-rock960.dtsi  |  506 ++
>  .../arm/dts/rk3399-sdram-lpddr3-2GB-1600.dtsi | 1536 +
>  arch/arm/dts/rk3399.dtsi  |   55 +-
>  arch/arm/mach-rockchip/rk3399/Kconfig |   26 +
>  board/vamrs/rock960_rk3399/Kconfig|   15 +
>  board/vamrs/rock960_rk3399/MAINTAINERS|6 +
>  board/vamrs/rock960_rk3399/Makefile   |6 +
>  board/vamrs/rock960_rk3399/README |  152 ++
>  board/vamrs/rock960_rk3399/rock960-rk3399.c   |   50 +
>  configs/ficus-rk3399_defconfig|   71 +
>  configs/rock960-rk3399_defconfig  |   69 +
>  include/configs/rock960_rk3399.h  |   15 +
>  15 files changed, 2626 insertions(+), 6 deletions(-)
>  create mode 100644 arch/arm/dts/rk3399-ficus.dts
>  create mode 100644 arch/arm/dts/rk3399-rock960.dts
>  create mode 100644 arch/arm/dts/rk3399-rock960.dtsi
>  create mode 100644 arch/arm/dts/rk3399-sdram-lpddr3-2GB-1600.dtsi
>  create mode 100644 board/vamrs/rock960_rk3399/Kconfig
>  create mode 100644 board/vamrs/rock960_rk3399/MAINTAINERS
>  create mode 100644 board/vamrs/rock960_rk3399/Makefile
>  create mode 100644 board/vamrs/rock960_rk3399/README
>  create mode 100644 board/vamrs/rock960_rk3399/rock960-rk3399.c
>  create mode 100644 configs/ficus-rk3399_defconfig
>  create mode 100644 configs/rock960-rk3399_defconfig
>  create mode 100644 include/configs/rock960_rk3399.h
> 


-- 
  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/7] drivers: spi: cf_spi: migrate to DM and DT

2018-09-28 Thread Angelo Dureghello
Hi Simon,

On Thu, Sep 27, 2018 at 06:41:37AM -0700, Simon Glass wrote:
> Hi Angelo,
> 
> On 26 September 2018 at 11:53, Angelo Dureghello  wrote:
> > Hi Simon,
> >
> > thanks for the review.
> >
> > On Tue, Sep 25, 2018 at 10:42:08PM -0700, Simon Glass wrote:
> >> Hi Angelo,
> >>
> >> On 20 September 2018 at 15:07, Angelo Dureghello  wrote:
> >> > This patch converts cf_spi.c to DM and to read driver
> >> > platform data from flat devicetree.
> >> >
> >> > ---
> >> > Changes from v1:
> >> > - split into 2 patches
> >> >
> >> > Signed-off-by: Angelo Dureghello 
> >> > ---
> >> >  drivers/spi/Kconfig |  18 +-
> >> >  drivers/spi/cf_spi.c| 495 
> >> >  include/dm/platform_data/spi_coldfire.h |  25 ++
> >> >  3 files changed, 369 insertions(+), 169 deletions(-)
> >> >  create mode 100644 include/dm/platform_data/spi_coldfire.h
> >> >
> >>
> >> Good to see this.
> >>
> >> > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> >> > index dcd719ff0a..974c5bbed8 100644
> >> > --- a/drivers/spi/Kconfig
> >> > +++ b/drivers/spi/Kconfig
> >> > @@ -80,6 +80,12 @@ config CADENCE_QSPI
> >> >   used to access the SPI NOR flash on platforms embedding this
> >> >   Cadence IP core.
> >> >
> >> > +config CF_SPI
> >> > +bool "ColdFire SPI driver"
> >> > +help
> >> > +  Enable the ColdFire SPI driver. This driver can be used on
> >> > +  some m68k SoCs.
> >> > +
> >> >  config DESIGNWARE_SPI
> >> > bool "Designware SPI driver"
> >> > help
> >> > @@ -244,18 +250,18 @@ config ZYNQMP_GQSPI
> >> >
> >> >  endif # if DM_SPI
> >> >
> >> > -config SOFT_SPI
> >> > -   bool "Soft SPI driver"
> >> > -   help
> >> > -Enable Soft SPI driver. This driver is to use GPIO simulate
> >> > -the SPI protocol.
> >>
> >> How come this is changing? That should be a separate patch.
> >>
> > I just respected Kconfig alphabetical order, SOFT_SPI is just moved after.
> 
> OK, well I do think this should be in a separate patch.
> 
this is done, ready into a v2

> >
> >> > -
> >> >  config CF_SPI
> >> > bool "ColdFire SPI driver"
> >> > help
> >> >   Enable the ColdFire SPI driver. This driver can be used on
> >> >   some m68k SoCs.
> >> >
> >> > +config SOFT_SPI
> >> > +   bool "Soft SPI driver"
> >> > +   help
> >> > +Enable Soft SPI driver. This driver is to use GPIO simulate
> >> > +the SPI protocol.
> >> > +
> >> >  config FSL_ESPI
> >> > bool "Freescale eSPI driver"
> >> > help
> >> > diff --git a/drivers/spi/cf_spi.c b/drivers/spi/cf_spi.c
> >> > index 522631cbbf..11a11f79c4 100644
> >> > --- a/drivers/spi/cf_spi.c
> >> > +++ b/drivers/spi/cf_spi.c
> >> > @@ -6,16 +6,27 @@
> >> >   *
> >> >   * Copyright (C) 2004-2009 Freescale Semiconductor, Inc.
> >> >   * TsiChung Liew (tsi-chung.l...@freescale.com)
> >> > + *
> >> > + * Support for device model:
> >> > + * Copyright (C) 2018 Angelo Dureghello 
> >> > + *
> >> >   */
> >> >
> >> >  #include 
> >> > +#include 
> >> > +#include 
> >> >  #include 
> >> >  #include 
> >> >  #include 
> >> > +#include 
> >> >
> >> > -struct cf_spi_slave {
> >> > +struct coldfire_spi_priv {
> >> > +#ifndef CONFIG_DM_SPI
> >> > struct spi_slave slave;
> >> > +#endif
> >> > +   struct dspi *regs;
> >> > uint baudrate;
> >> > +   int mode;
> >> > int charbit;
> >> >  };
> >> >
> >> > @@ -38,14 +49,14 @@ DECLARE_GLOBAL_DATA_PTR;
> >> >  #define SPI_MODE_MOD   0x0020
> >> >  #define SPI_DBLRATE0x0010
> >> >
> >> > -static inline struct cf_spi_slave *to_cf_spi_slave(struct spi_slave 
> >> > *slave)
> >> > -{
> >> > -   return container_of(slave, struct cf_spi_slave, slave);
> >> > -}
> >> > +/* Default values */
> >> > +#define MCF_DSPI_DEFAULT_SCK_FREQ  1000
> >> > +#define MCF_DSPI_MAX_CHIPSELECTS   4
> >> > +#define MCF_DSPI_MODE  0
> >> >
> >> > -static void cfspi_init(void)
> >> > +static void __spi_init(struct coldfire_spi_priv *cfspi)
> >> >  {
> >> > -   volatile dspi_t *dspi = (dspi_t *) MMAP_DSPI;
> >> > +   struct dspi *dspi = cfspi->regs;
> >> >
> >> > cfspi_port_conf();  /* port configuration */
> >> >
> >> > @@ -56,125 +67,32 @@ static void cfspi_init(void)
> >> >
> >> > /* Default setting in platform configuration */
> >> >  #ifdef CONFIG_SYS_DSPI_CTAR0
> >> > -   dspi->ctar[0] = CONFIG_SYS_DSPI_CTAR0;
> >> > +   writel(CONFIG_SYS_DSPI_CTAR0, >ctar[0]);
> >>
> >> What is going on here? I think these CONFIG options are addresses? If
> >> so, they should be read from the DT, not a CONFIG.
> >>
> >
> > These are just default settings for each channel (bus), actually coming
> > from the include/configs/boardxxx.h. Their speed an mode bitfields are
> > rewritten later, with values coming from devicetree.
> > Some driver #define the default value inside the driver itself, in 

[U-Boot] [PATCH 41/48] powerpc: Migrate HIGH_BATS to Kconfig

2018-09-28 Thread Mario Six
Migrate the CONFIG_HIGH_BATS variable to Kconfig.

Signed-off-by: Mario Six 
---
 arch/powerpc/Kconfig  | 6 ++
 configs/MPC8313ERDB_33_defconfig  | 1 +
 configs/MPC8313ERDB_66_defconfig  | 1 +
 configs/MPC8313ERDB_NAND_33_defconfig | 1 +
 configs/MPC8313ERDB_NAND_66_defconfig | 1 +
 configs/MPC8315ERDB_defconfig | 1 +
 configs/MPC8323ERDB_defconfig | 1 +
 configs/MPC832XEMDS_ATM_defconfig | 1 +
 configs/MPC832XEMDS_HOST_33_defconfig | 1 +
 configs/MPC832XEMDS_HOST_66_defconfig | 1 +
 configs/MPC832XEMDS_SLAVE_defconfig   | 1 +
 configs/MPC832XEMDS_defconfig | 1 +
 configs/MPC8349EMDS_PCI64_defconfig   | 1 +
 configs/MPC8349EMDS_SDRAM_defconfig   | 1 +
 configs/MPC8349EMDS_SLAVE_defconfig   | 1 +
 configs/MPC8349EMDS_defconfig | 1 +
 configs/MPC8349ITXGP_defconfig| 1 +
 configs/MPC8349ITX_LOWBOOT_defconfig  | 1 +
 configs/MPC8349ITX_defconfig  | 1 +
 configs/MPC837XEMDS_HOST_defconfig| 1 +
 configs/MPC837XEMDS_defconfig | 1 +
 configs/MPC837XERDB_defconfig | 1 +
 configs/MPC8610HPCD_defconfig | 1 +
 configs/MPC8641HPCN_36BIT_defconfig   | 1 +
 configs/MPC8641HPCN_defconfig | 1 +
 configs/TQM834x_defconfig | 1 +
 configs/caddy2_defconfig  | 1 +
 configs/ids8313_defconfig | 1 +
 configs/kmcoge5ne_defconfig   | 1 +
 configs/kmopti2_defconfig | 1 +
 configs/kmsupx5_defconfig | 1 +
 configs/kmtegr1_defconfig | 1 +
 configs/kmtepr2_defconfig | 1 +
 configs/kmvect1_defconfig | 1 +
 configs/sbc8349_PCI_33_defconfig  | 1 +
 configs/sbc8349_PCI_66_defconfig  | 1 +
 configs/sbc8349_defconfig | 1 +
 configs/sbc8641d_defconfig| 1 +
 configs/suvd3_defconfig   | 1 +
 configs/tuge1_defconfig   | 1 +
 configs/tuxx1_defconfig   | 1 +
 configs/ve8313_defconfig  | 1 +
 configs/vme8349_defconfig | 1 +
 configs/xpedite517x_defconfig | 1 +
 include/configs/MPC8313ERDB_NAND.h| 2 --
 include/configs/MPC8313ERDB_NOR.h | 2 --
 include/configs/MPC8315ERDB.h | 1 -
 include/configs/MPC8323ERDB.h | 1 -
 include/configs/MPC832XEMDS.h | 2 --
 include/configs/MPC8349EMDS.h | 1 -
 include/configs/MPC8349EMDS_SDRAM.h   | 1 -
 include/configs/MPC8349ITX.h  | 1 -
 include/configs/MPC837XEMDS.h | 1 -
 include/configs/MPC837XERDB.h | 2 --
 include/configs/MPC8610HPCD.h | 1 -
 include/configs/MPC8641HPCN.h | 1 -
 include/configs/TQM834x.h | 2 --
 include/configs/caddy2.h  | 2 --
 include/configs/ids8313.h | 1 -
 include/configs/kmcoge5ne.h   | 2 --
 include/configs/kmeter1.h | 2 --
 include/configs/kmopti2.h | 2 --
 include/configs/kmsupx5.h | 2 --
 include/configs/kmtegr1.h | 2 --
 include/configs/kmtepr2.h | 2 --
 include/configs/kmvect1.h | 2 --
 include/configs/sbc8349.h | 2 --
 include/configs/sbc8641d.h| 1 -
 include/configs/suvd3.h   | 2 --
 include/configs/tuge1.h   | 2 --
 include/configs/tuxx1.h   | 2 --
 include/configs/ve8313.h  | 2 --
 include/configs/vme8349.h | 2 --
 include/configs/xpedite517x.h | 1 -
 74 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8faef0ba9f..351449a43e 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -38,6 +38,12 @@ config MPC8xx
 
 endchoice
 
+config HIGH_BATS
+   bool "Enable high BAT registers"
+   help
+ Enable BATs (block address translation registers) 4-7 on machines
+ that support them.
+
 source "arch/powerpc/cpu/mpc83xx/Kconfig"
 source "arch/powerpc/cpu/mpc85xx/Kconfig"
 source "arch/powerpc/cpu/mpc86xx/Kconfig"
diff --git a/configs/MPC8313ERDB_33_defconfig b/configs/MPC8313ERDB_33_defconfig
index 715640eecc..3cf8f53531 100644
--- a/configs/MPC8313ERDB_33_defconfig
+++ b/configs/MPC8313ERDB_33_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE00
 CONFIG_SYS_CLK_FREQ=
 CONFIG_MPC83xx=y
+CONFIG_HIGH_BATS=y
 CONFIG_TARGET_MPC8313ERDB_NOR=y
 CONFIG_SYSTEM_PLL_FACTOR_5_1=y
 CONFIG_CORE_PLL_RATIO_2_1=y
diff --git a/configs/MPC8313ERDB_66_defconfig b/configs/MPC8313ERDB_66_defconfig
index 14e38a990e..d5ed946c34 100644
--- a/configs/MPC8313ERDB_66_defconfig
+++ b/configs/MPC8313ERDB_66_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE00
 CONFIG_SYS_CLK_FREQ=6667
 CONFIG_MPC83xx=y
+CONFIG_HIGH_BATS=y
 CONFIG_TARGET_MPC8313ERDB_NOR=y
 CONFIG_CORE_PLL_RATIO_2_1=y
 CONFIG_PCI_HOST_MODE_ENABLE=y
diff --git a/configs/MPC8313ERDB_NAND_33_defconfig 
b/configs/MPC8313ERDB_NAND_33_defconfig
index 08fa4ed817..55e0f529cf 100644
--- 

[U-Boot] [PATCH 38/48] mpc83xx: Get rid of CONFIG_83XX_CLKIN

2018-09-28 Thread Mario Six
MPC83xx uses CONFIG_83XX_CLKIN instead of CONFIG_SYS_CLK_FREQ to set the
system clock. To migrate the architecture, we can replace
CONFIG_83XX_CLKIN with CONFIG_SYS_CLK_FREQ.

To do this
* replace all occurrences of CONFIG_83XX_CLKIN with CONFIG_SYS_CLK_FREQ
* set CONFIG_SYS_CLK_FREQ to the old value of CONFIG_83XX_CLKIN in all
  MPC83xx config files

Signed-off-by: Mario Six 
---
 Kconfig |  2 +-
 arch/powerpc/cpu/mpc83xx/speed.c|  4 ++--
 arch/powerpc/cpu/mpc83xx/spl_minimal.c  |  2 +-
 board/freescale/mpc8349emds/MAINTAINERS |  1 +
 board/freescale/mpc837xerdb/MAINTAINERS |  1 +
 board/tqc/tqm834x/pci.c |  2 +-
 configs/MPC8308RDB_defconfig|  1 +
 configs/MPC8313ERDB_33_defconfig|  1 +
 configs/MPC8313ERDB_66_defconfig|  1 +
 configs/MPC8313ERDB_NAND_33_defconfig   |  1 +
 configs/MPC8313ERDB_NAND_66_defconfig   |  1 +
 configs/MPC8315ERDB_defconfig   |  1 +
 configs/MPC8323ERDB_defconfig   |  1 +
 configs/MPC832XEMDS_ATM_defconfig   |  1 +
 configs/MPC832XEMDS_HOST_33_defconfig   |  1 +
 configs/MPC832XEMDS_HOST_66_defconfig   |  1 +
 configs/MPC832XEMDS_SLAVE_defconfig |  1 +
 configs/MPC832XEMDS_defconfig   |  1 +
 configs/MPC8349EMDS_SDRAM_defconfig |  1 +
 configs/MPC8349EMDS_SLAVE_defconfig | 22 ++
 configs/MPC8349EMDS_defconfig   |  1 +
 configs/MPC8349ITXGP_defconfig  |  2 ++
 configs/MPC8349ITX_LOWBOOT_defconfig|  1 +
 configs/MPC8349ITX_defconfig|  1 +
 configs/MPC837XEMDS_HOST_defconfig  |  1 +
 configs/MPC837XEMDS_defconfig   |  1 +
 configs/MPC837XERDB_SLAVE_defconfig | 31 +++
 configs/MPC837XERDB_defconfig   |  2 ++
 configs/TQM834x_defconfig   |  1 +
 configs/caddy2_defconfig|  1 +
 configs/hrcon_defconfig |  1 +
 configs/hrcon_dh_defconfig  |  1 +
 configs/ids8313_defconfig   |  1 +
 configs/kmcoge5ne_defconfig |  1 +
 configs/kmeter1_defconfig   |  1 +
 configs/kmopti2_defconfig   |  1 +
 configs/kmsupx5_defconfig   |  1 +
 configs/kmtegr1_defconfig   |  1 +
 configs/kmtepr2_defconfig   |  1 +
 configs/kmvect1_defconfig   |  1 +
 configs/mpc8308_p1m_defconfig   |  1 +
 configs/sbc8349_PCI_33_defconfig|  1 +
 configs/sbc8349_PCI_66_defconfig|  1 +
 configs/sbc8349_defconfig   |  1 +
 configs/strider_con_defconfig   |  1 +
 configs/strider_con_dp_defconfig|  1 +
 configs/strider_cpu_defconfig   |  1 +
 configs/strider_cpu_dp_defconfig|  1 +
 configs/suvd3_defconfig |  1 +
 configs/tuge1_defconfig |  1 +
 configs/tuxx1_defconfig |  1 +
 configs/ve8313_defconfig|  1 +
 configs/vme8349_defconfig   |  1 +
 include/configs/MPC8308RDB.h|  6 --
 include/configs/MPC8313ERDB_NAND.h  | 17 +
 include/configs/MPC8313ERDB_NOR.h   | 15 +--
 include/configs/MPC8315ERDB.h   |  6 --
 include/configs/MPC8323ERDB.h   |  9 -
 include/configs/MPC832XEMDS.h   | 13 -
 include/configs/MPC8349EMDS.h   | 19 ++-
 include/configs/MPC8349EMDS_SDRAM.h | 19 ++-
 include/configs/MPC8349ITX.h|  7 ---
 include/configs/MPC837XEMDS.h   | 13 -
 include/configs/MPC837XERDB.h   | 14 --
 include/configs/TQM834x.h   |  3 ---
 include/configs/caddy2.h| 11 ---
 include/configs/hrcon.h |  6 --
 include/configs/ids8313.h   |  3 ---
 include/configs/kmeter1.h   |  7 ---
 include/configs/mpc8308_p1m.h   |  6 --
 include/configs/sbc8349.h   | 16 
 include/configs/strider.h   |  6 --
 include/configs/ve8313.h|  4 
 include/configs/vme8349.h   |  9 -
 74 files changed, 113 insertions(+), 208 deletions(-)
 create mode 100644 configs/MPC8349EMDS_SLAVE_defconfig
 create mode 100644 configs/MPC837XERDB_SLAVE_defconfig

diff --git a/Kconfig b/Kconfig
index 1aadf5dd2d..bef0547ba8 100644
--- a/Kconfig
+++ b/Kconfig
@@ -464,7 +464,7 @@ config SYS_TEXT_BASE
 
 
 config SYS_CLK_FREQ
-   depends on ARC || ARCH_SUNXI
+   depends on ARC || ARCH_SUNXI || MPC83xx
int "CPU clock frequency"
help
  TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index 668ed27862..e870a23103 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -137,8 +137,8 @@ int get_clocks(void)
clkin_div = ((im->clk.spmr & SPMR_CKID) >> 

[U-Boot] [PATCH 45/48] tqm834x: Expand CONFIG_SYS_OR_TIMING_FLASH macro

2018-09-28 Thread Mario Six
We want to normalize all BR/OR config lines as much as possible.

The TQM834x board uses CONFIG_SYS_OR_TIMING_FLASH in a OR definition,
which we want to remove. But CONFIG_SYS_OR_TIMING_FLASH is also used
outside of the config file.

Replace these usages with the definition of the variable, so we can
remove the variable in the next patch.

Signed-off-by: Mario Six 
---
 board/tqc/tqm834x/tqm834x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c
index 7c92f4f54c..c75251e132 100644
--- a/board/tqc/tqm834x/tqm834x.c
+++ b/board/tqc/tqm834x/tqm834x.c
@@ -235,8 +235,8 @@ static int detect_num_flash_banks(void)
debug("Number of flash banks detected: %d\n", 
cfi_flash_num_flash_banks);
 
/* set OR0 and BR0 */
-   set_lbc_or(0, CONFIG_SYS_OR_TIMING_FLASH |
-  (-(total_size) & OR_GPCM_AM));
+   set_lbc_or(0, OR_GPCM_CSNT | OR_GPCM_ACS_DIV4 | OR_GPCM_SCY_5 |
+  OR_GPCM_TRLX | (-(total_size) & OR_GPCM_AM));
set_lbc_br(0, (CONFIG_SYS_FLASH_BASE & BR_BA) |
   (BR_MS_GPCM | BR_PS_32 | BR_V));
 
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 39/48] mpc83xx: Kconfig: Migrate HRCW to Kconfig

2018-09-28 Thread Mario Six
The HRCW (hardware reset configuration word) is a constant that must be
hard-coded into the boot loader image. So, it must be available at
compile time, and cannot be migrated to the DT mechanism, but has to be
kept in Kconfig.

Configuration of this crucial variable should still be somewhat
comfortable. Hence, make its fields configurable in Kconfig, and
assemble the final value from these.

Signed-off-by: Mario Six 
---
 arch/powerpc/cpu/mpc83xx/Kconfig|  69 +++
 arch/powerpc/cpu/mpc83xx/hrcw/Kconfig   | 816 
 arch/powerpc/cpu/mpc83xx/hrcw/hrcw.h|  37 ++
 arch/powerpc/cpu/mpc83xx/start.S|   2 +
 board/freescale/mpc8315erdb/MAINTAINERS |   1 +
 board/freescale/mpc8349emds/MAINTAINERS |   1 +
 board/freescale/mpc8349itx/mpc8349itx.c |   2 +
 board/freescale/mpc837xemds/MAINTAINERS |   1 +
 configs/MPC8308RDB_defconfig|   7 +
 configs/MPC8313ERDB_33_defconfig|   8 +
 configs/MPC8313ERDB_66_defconfig|   7 +
 configs/MPC8313ERDB_NAND_33_defconfig   |   7 +
 configs/MPC8313ERDB_NAND_66_defconfig   |   6 +
 configs/MPC8315ERDB_defconfig   |   8 +
 configs/MPC8323ERDB_defconfig   |   6 +
 configs/MPC832XEMDS_ATM_defconfig   |   6 +
 configs/MPC832XEMDS_HOST_33_defconfig   |   6 +
 configs/MPC832XEMDS_HOST_66_defconfig   |   6 +
 configs/MPC832XEMDS_SLAVE_defconfig |   3 +
 configs/MPC832XEMDS_defconfig   |   6 +
 configs/MPC8349EMDS_PCI64_defconfig |  32 ++
 configs/MPC8349EMDS_SDRAM_defconfig |  10 +
 configs/MPC8349EMDS_SLAVE_defconfig |  12 +-
 configs/MPC8349EMDS_defconfig   |  10 +
 configs/MPC8349ITXGP_defconfig  |  10 +
 configs/MPC8349ITX_LOWBOOT_defconfig|  10 +
 configs/MPC8349ITX_defconfig|   9 +
 configs/MPC837XEMDS_HOST_defconfig  |  10 +
 configs/MPC837XEMDS_SLAVE_defconfig |  33 ++
 configs/MPC837XEMDS_defconfig   |  10 +
 configs/MPC837XERDB_SLAVE_defconfig |   7 +
 configs/MPC837XERDB_defconfig   |  10 +
 configs/TQM834x_defconfig   |   9 +
 configs/caddy2_defconfig|  10 +
 configs/hrcon_defconfig |   6 +
 configs/hrcon_dh_defconfig  |   6 +
 configs/ids8313_defconfig   |   3 +
 configs/kmcoge5ne_defconfig |   9 +
 configs/kmeter1_defconfig   |   9 +
 configs/kmopti2_defconfig   |   4 +
 configs/kmsupx5_defconfig   |   4 +
 configs/kmtegr1_defconfig   |   5 +
 configs/kmtepr2_defconfig   |   4 +
 configs/kmvect1_defconfig   |   5 +
 configs/mpc8308_p1m_defconfig   |   5 +
 configs/sbc8349_PCI_33_defconfig|  10 +
 configs/sbc8349_PCI_66_defconfig|  10 +
 configs/sbc8349_defconfig   |  10 +
 configs/strider_con_defconfig   |   5 +
 configs/strider_con_dp_defconfig|   5 +
 configs/strider_cpu_defconfig   |   5 +
 configs/strider_cpu_dp_defconfig|   5 +
 configs/suvd3_defconfig |   4 +
 configs/tuge1_defconfig |   4 +
 configs/tuxx1_defconfig |   4 +
 configs/ve8313_defconfig|   7 +
 configs/vme8349_defconfig   |  10 +
 include/configs/MPC8308RDB.h|  32 --
 include/configs/MPC8313ERDB_NAND.h  |  38 --
 include/configs/MPC8313ERDB_NOR.h   |  40 --
 include/configs/MPC8315ERDB.h   |  34 --
 include/configs/MPC8323ERDB.h   |  24 -
 include/configs/MPC832XEMDS.h   |  37 --
 include/configs/MPC8349EMDS.h   |  86 
 include/configs/MPC8349EMDS_SDRAM.h |  86 
 include/configs/MPC8349ITX.h|  39 --
 include/configs/MPC837XEMDS.h   |  42 --
 include/configs/MPC837XERDB.h   |  40 --
 include/configs/TQM834x.h   |  35 --
 include/configs/caddy2.h|  41 --
 include/configs/hrcon.h |  32 --
 include/configs/ids8313.h   |  21 -
 include/configs/kmcoge5ne.h |  19 -
 include/configs/kmeter1.h   |  19 -
 include/configs/kmopti2.h   |  22 -
 include/configs/kmsupx5.h   |  22 -
 include/configs/kmtegr1.h   |  22 -
 include/configs/kmtepr2.h   |  22 -
 include/configs/kmvect1.h   |  22 -
 include/configs/mpc8308_p1m.h   |  32 --
 include/configs/sbc8349.h   |  71 ---
 include/configs/strider.h   |  32 --
 include/configs/suvd3.h |  22 -
 include/configs/tuge1.h |  22 -
 include/configs/tuxx1.h |  22 -
 include/configs/ve8313.h|  19 -
 include/configs/vme8349.h   |  43 --
 87 files changed, 1325 insertions(+), 1039 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc83xx/hrcw/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/hrcw/hrcw.h
 create mode 100644 configs/MPC8349EMDS_PCI64_defconfig
 create mode 100644 

[U-Boot] [PATCH 44/48] mpc83xx: Normalize BR/OR option lines

2018-09-28 Thread Mario Six
All BR/OR option lines should have the same layout to make them easier
to migrate to Kconfig. This includes using the same option macros
everywhere.

The normalize the lines,
* replace function macros with their results, and
* replace hardcoded hex values with standard macros

Signed-off-by: Mario Six 
---
 include/configs/MPC8308RDB.h|  6 +++---
 include/configs/MPC8313ERDB_NAND.h  |  4 ++--
 include/configs/MPC8313ERDB_NOR.h   |  4 ++--
 include/configs/MPC8323ERDB.h   |  2 +-
 include/configs/MPC832XEMDS.h   |  6 +++---
 include/configs/MPC8349EMDS.h   |  2 +-
 include/configs/MPC8349EMDS_SDRAM.h |  2 +-
 include/configs/MPC8349ITX.h|  2 +-
 include/configs/MPC837XEMDS.h   |  2 +-
 include/configs/MPC837XERDB.h   |  2 +-
 include/configs/caddy2.h|  2 +-
 include/configs/hrcon.h |  4 ++--
 include/configs/ids8313.h   | 10 +-
 include/configs/kmcoge5ne.h | 12 ++--
 include/configs/kmeter1.h   |  8 
 include/configs/kmopti2.h   |  8 
 include/configs/kmsupx5.h   |  6 +++---
 include/configs/kmtegr1.h   |  6 +++---
 include/configs/kmtepr2.h   |  8 
 include/configs/kmvect1.h   |  8 
 include/configs/mpc8308_p1m.h   |  2 +-
 include/configs/sbc8349.h   |  4 ++--
 include/configs/strider.h   |  4 ++--
 include/configs/suvd3.h |  8 
 include/configs/tuge1.h |  6 +++---
 include/configs/tuxx1.h |  8 
 include/configs/vme8349.h   |  2 +-
 27 files changed, 69 insertions(+), 69 deletions(-)

diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h
index 313cf0e909..cc2a8afd30 100644
--- a/include/configs/MPC8308RDB.h
+++ b/include/configs/MPC8308RDB.h
@@ -183,7 +183,7 @@
| BR_PS_16  /* 16 bit port */ \
| BR_MS_GPCM/* MSEL = GPCM */ \
| BR_V) /* valid */
-#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+#define CONFIG_SYS_OR0_PRELIM  (OR_AM_8MB \
| OR_UPM_XAM \
| OR_GPCM_CSNT \
| OR_GPCM_ACS_DIV2 \
@@ -209,7 +209,7 @@
| BR_PS_8   /* 8 bit Port */ \
| BR_MS_FCM /* MSEL = FCM */ \
| BR_V) /* valid */
-#define CONFIG_SYS_OR1_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \
+#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB \
| OR_FCM_CSCT \
| OR_FCM_CST \
| OR_FCM_CHT \
@@ -228,7 +228,7 @@
| BR_MS_GPCM/* MSEL = GPCM */ \
| BR_V) /* valid */
/* 0xF801 */
-#define CONFIG_SYS_OR2_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_VSC7385_SIZE) \
+#define CONFIG_SYS_OR2_PRELIM  (OR_AM_128KB \
| OR_GPCM_CSNT \
| OR_GPCM_XACS \
| OR_GPCM_SCY_15 \
diff --git a/include/configs/MPC8313ERDB_NAND.h 
b/include/configs/MPC8313ERDB_NAND.h
index c969f8d044..0e743ea069 100644
--- a/include/configs/MPC8313ERDB_NAND.h
+++ b/include/configs/MPC8313ERDB_NAND.h
@@ -262,7 +262,7 @@
| BR_MS_GPCM/* MSEL = GPCM */ \
| BR_V) /* valid */
/* 0xFA000801 */
-#define CONFIG_SYS_OR3_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_BCSR_SIZE) \
+#define CONFIG_SYS_OR3_PRELIM  (OR_AM_32KB \
| OR_GPCM_CSNT \
| OR_GPCM_ACS_DIV2 \
| OR_GPCM_XACS \
@@ -283,7 +283,7 @@
| BR_PS_8   /* 8 bit port */ \
| BR_MS_GPCM/* MSEL = GPCM */ \
| BR_V) /* valid */
-#define CONFIG_SYS_OR2_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_VSC7385_SIZE) \
+#define CONFIG_SYS_OR2_PRELIM  (OR_AM_128KB \
| OR_GPCM_CSNT \
| OR_GPCM_XACS \
| OR_GPCM_SCY_15 \
diff --git a/include/configs/MPC8313ERDB_NOR.h 
b/include/configs/MPC8313ERDB_NOR.h
index 866ac8faf2..c1bf62e405 100644
--- a/include/configs/MPC8313ERDB_NOR.h
+++ b/include/configs/MPC8313ERDB_NOR.h
@@ -230,7 +230,7 @@
| BR_MS_GPCM/* MSEL = GPCM */ \
| BR_V) /* valid */

[U-Boot] [PATCH 46/48] mpc83xx: Simplify BR,OR lines

2018-09-28 Thread Mario Six
Re-format all BR,OR #define lines into single lines. This makes them
harder to read, but accessible to semi-automatic replacement.

Signed-off-by: Mario Six 
---
 include/configs/MPC8308RDB.h| 46 +---
 include/configs/MPC8313ERDB_NAND.h  | 67 ---
 include/configs/MPC8313ERDB_NOR.h   | 66 --
 include/configs/MPC8315ERDB.h   | 34 --
 include/configs/MPC8323ERDB.h   | 17 ++---
 include/configs/MPC832XEMDS.h   | 70 -
 include/configs/MPC8349EMDS.h   | 32 -
 include/configs/MPC8349EMDS_SDRAM.h | 45 +---
 include/configs/MPC8349ITX.h| 60 ---
 include/configs/MPC837XEMDS.h   | 52 ++-
 include/configs/MPC837XERDB.h   | 48 +++--
 include/configs/TQM834x.h   | 19 ++
 include/configs/caddy2.h| 32 +
 include/configs/hrcon.h | 32 -
 include/configs/ids8313.h   | 47 ++---
 include/configs/kmcoge5ne.h | 55 +++--
 include/configs/kmeter1.h   | 40 ++---
 include/configs/kmopti2.h   | 53 
 include/configs/kmsupx5.h   | 43 ++-
 include/configs/kmtegr1.h   | 37 ++--
 include/configs/kmtepr2.h   | 57 +++---
 include/configs/kmvect1.h   | 46 +++-
 include/configs/mpc8308_p1m.h   | 40 ++---
 include/configs/sbc8349.h   | 18 ++
 include/configs/strider.h   | 31 
 include/configs/suvd3.h | 46 +++-
 include/configs/tuge1.h | 43 ++-
 include/configs/tuxx1.h | 60 +++
 include/configs/ve8313.h| 64 +++--
 include/configs/vme8349.h   | 32 +
 30 files changed, 304 insertions(+), 1028 deletions(-)

diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h
index cc2a8afd30..51e00da62a 100644
--- a/include/configs/MPC8308RDB.h
+++ b/include/configs/MPC8308RDB.h
@@ -178,19 +178,9 @@
 #define CONFIG_SYS_FLASH_SIZE  8 /* FLASH size is 8M */
 #define CONFIG_SYS_FLASH_PROTECTION1 /* Use h/w Flash protection. */
 
-/* Window base at flash base */
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-   | BR_PS_16  /* 16 bit port */ \
-   | BR_MS_GPCM/* MSEL = GPCM */ \
-   | BR_V) /* valid */
-#define CONFIG_SYS_OR0_PRELIM  (OR_AM_8MB \
-   | OR_UPM_XAM \
-   | OR_GPCM_CSNT \
-   | OR_GPCM_ACS_DIV2 \
-   | OR_GPCM_XACS \
-   | OR_GPCM_SCY_15 \
-   | OR_GPCM_TRLX_SET \
-   | OR_GPCM_EHTR_SET)
+/* FLASH */
+#define CONFIG_SYS_BR0_PRELIM  (0xFE00 | BR_PS_16 | BR_MS_GPCM | BR_V)
+#define CONFIG_SYS_OR0_PRELIM  (OR_AM_8MB | OR_UPM_XAM | OR_GPCM_CSNT | 
OR_GPCM_ACS_DIV2 | OR_GPCM_XACS | OR_GPCM_SCY_15 | OR_GPCM_TRLX_SET | 
OR_GPCM_EHTR_SET)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */
 /* 127 64KB sectors and 8 8KB top sectors per device */
@@ -204,18 +194,9 @@
  */
 #define CONFIG_SYS_NAND_BASE   0xE060  /* 0xE060 */
 #define CONFIG_SYS_NAND_WINDOW_SIZE(32 * 1024) /* 0x8000 */
-#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_NAND_BASE \
-   | BR_DECC_CHK_GEN   /* Use HW ECC */ \
-   | BR_PS_8   /* 8 bit Port */ \
-   | BR_MS_FCM /* MSEL = FCM */ \
-   | BR_V) /* valid */
-#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB \
-   | OR_FCM_CSCT \
-   | OR_FCM_CST \
-   | OR_FCM_CHT \
-   | OR_FCM_SCY_1 \
-   | OR_FCM_TRLX \
-   | OR_FCM_EHTR)
+/* NAND */
+#define CONFIG_SYS_BR1_PRELIM  (0xE060 | BR_DECC_CHK_GEN   | BR_PS_8 | 
BR_MS_FCM | BR_V)
+#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB | OR_FCM_CSCT | OR_FCM_CST | 
OR_FCM_CHT | OR_FCM_SCY_1 | OR_FCM_TRLX | OR_FCM_EHTR)
/* 0x8396 */
 
 #ifdef CONFIG_VSC7385_ENET
@@ -223,18 +204,9 @@
/* VSC7385 Base address on CS2 */
 #define CONFIG_SYS_VSC7385_BASE0xF000
 #define CONFIG_SYS_VSC7385_SIZE(128 * 1024) /* 

[U-Boot] [PATCH 43/48] mpc83xx: Migrate LBLAW_* to Kconfig

2018-09-28 Thread Mario Six
The LBLAW_* values determine the window configuration of the memory
controller. Hence, they must be known at compile time, and cannot be
implemented in the DT mechanism.

Configuration of this crucial variable should still be somewhat
comfortable. Hence, make its fields configurable in Kconfig, and
assemble the final value from these.

Signed-off-by: Mario Six 
---
 arch/powerpc/cpu/mpc83xx/Kconfig   |   1 +
 arch/powerpc/cpu/mpc83xx/cpu_init.c|   2 +
 arch/powerpc/cpu/mpc83xx/lblaw/Kconfig | 519 +
 arch/powerpc/cpu/mpc83xx/lblaw/lblaw.h |  55 
 arch/powerpc/cpu/mpc83xx/spl_minimal.c |   2 +
 configs/MPC8308RDB_defconfig   |  12 +
 configs/MPC8313ERDB_33_defconfig   |  16 +
 configs/MPC8313ERDB_66_defconfig   |  16 +
 configs/MPC8313ERDB_NAND_33_defconfig  |  17 ++
 configs/MPC8313ERDB_NAND_66_defconfig  |  17 ++
 configs/MPC8315ERDB_defconfig  |   8 +
 configs/MPC8323ERDB_defconfig  |   4 +
 configs/MPC832XEMDS_ATM_defconfig  |  12 +
 configs/MPC832XEMDS_HOST_33_defconfig  |  12 +
 configs/MPC832XEMDS_HOST_66_defconfig  |  12 +
 configs/MPC832XEMDS_SLAVE_defconfig|  12 +
 configs/MPC832XEMDS_defconfig  |  12 +
 configs/MPC8349EMDS_PCI64_defconfig|   8 +
 configs/MPC8349EMDS_SDRAM_defconfig|  12 +
 configs/MPC8349EMDS_SLAVE_defconfig|   8 +
 configs/MPC8349EMDS_defconfig  |   8 +
 configs/MPC8349ITXGP_defconfig |  12 +
 configs/MPC8349ITX_LOWBOOT_defconfig   |  12 +
 configs/MPC8349ITX_defconfig   |  12 +
 configs/MPC837XEMDS_HOST_defconfig |  12 +
 configs/MPC837XEMDS_SLAVE_defconfig|  12 +
 configs/MPC837XEMDS_defconfig  |  12 +
 configs/MPC837XERDB_SLAVE_defconfig|  12 +
 configs/MPC837XERDB_defconfig  |  12 +
 configs/TQM834x_defconfig  |  10 +
 configs/caddy2_defconfig   |   8 +
 configs/hrcon_defconfig|   8 +
 configs/hrcon_dh_defconfig |   8 +
 configs/ids8313_defconfig  |  17 ++
 configs/kmcoge5ne_defconfig|  12 +
 configs/kmeter1_defconfig  |  12 +
 configs/kmopti2_defconfig  |  16 +
 configs/kmsupx5_defconfig  |  12 +
 configs/kmtegr1_defconfig  |  12 +
 configs/kmtepr2_defconfig  |  16 +
 configs/kmvect1_defconfig  |  16 +
 configs/mpc8308_p1m_defconfig  |  12 +
 configs/sbc8349_PCI_33_defconfig   |   4 +
 configs/sbc8349_PCI_66_defconfig   |   4 +
 configs/sbc8349_defconfig  |   4 +
 configs/strider_con_defconfig  |   8 +
 configs/strider_con_dp_defconfig   |   8 +
 configs/strider_cpu_defconfig  |   8 +
 configs/strider_cpu_dp_defconfig   |   8 +
 configs/suvd3_defconfig|  16 +
 configs/tuge1_defconfig|  12 +
 configs/tuxx1_defconfig|  16 +
 configs/ve8313_defconfig   |   9 +
 configs/vme8349_defconfig  |   8 +
 include/configs/MPC8308RDB.h   |  10 -
 include/configs/MPC8313ERDB_NAND.h |  18 --
 include/configs/MPC8313ERDB_NOR.h  |  18 --
 include/configs/MPC8315ERDB.h  |  10 -
 include/configs/MPC8323ERDB.h  |   3 -
 include/configs/MPC832XEMDS.h  |   8 -
 include/configs/MPC8349EMDS.h  |   6 -
 include/configs/MPC8349EMDS_SDRAM.h|   8 -
 include/configs/MPC8349ITX.h   |  10 -
 include/configs/MPC837XEMDS.h  |  10 -
 include/configs/MPC837XERDB.h  |  12 -
 include/configs/TQM834x.h  |  11 -
 include/configs/caddy2.h   |   4 -
 include/configs/hrcon.h|   6 -
 include/configs/ids8313.h  |  12 -
 include/configs/kmcoge5ne.h|  10 -
 include/configs/kmeter1.h  |  10 -
 include/configs/kmopti2.h  |  13 -
 include/configs/kmsupx5.h  |  11 -
 include/configs/kmtegr1.h  |   9 -
 include/configs/kmtepr2.h  |  13 -
 include/configs/kmvect1.h  |  13 -
 include/configs/mpc8308_p1m.h  |   9 -
 include/configs/sbc8349.h  |   7 -
 include/configs/strider.h  |   6 -
 include/configs/suvd3.h|  13 -
 include/configs/tuge1.h|  11 -
 include/configs/tuxx1.h|  16 -
 include/configs/ve8313.h   |   9 -
 include/configs/vme8349.h  |   4 -
 scripts/config_whitelist.txt   |  16 -
 85 files changed, 1125 insertions(+), 316 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc83xx/lblaw/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/lblaw/lblaw.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index f7f625aea1..8c84196b97 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -284,6 +284,7 @@ config ARCH_MPC837X
 
 source "arch/powerpc/cpu/mpc83xx/hrcw/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/bats/Kconfig"

[U-Boot] [PATCH 35/48] MPC837XERDB: Remove CONFIG_MPC837XERDB

2018-09-28 Thread Mario Six
CONFIG_MPC837XERDB is unused, and TARGET_MPC837XERDB could replace it.

Hence, get rid of CONFIG_MPC837XERDB.

Signed-off-by: Mario Six 
---
 include/configs/MPC837XERDB.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h
index 40824be21e..f924883da3 100644
--- a/include/configs/MPC837XERDB.h
+++ b/include/configs/MPC837XERDB.h
@@ -12,7 +12,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001 /* E300 family */
-#define CONFIG_MPC837XERDB 1
 
 #define CONFIG_HWCONFIG
 
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 36/48] mpc83xx: Migrate legacy PCI options to Kconfig

2018-09-28 Thread Mario Six
The MPC83xx include files contain some settings of the PCI subsystem.

Migrate these to Kconfig until a proper DM PCI driver exists.

Signed-off-by: Mario Six 
---
 arch/powerpc/cpu/mpc83xx/Kconfig| 26 ++
 board/freescale/mpc8349emds/pci.c   | 12 ++--
 configs/MPC8349EMDS_SDRAM_defconfig |  1 +
 configs/MPC8349EMDS_defconfig   |  1 +
 configs/sbc8349_PCI_33_defconfig|  1 +
 configs/sbc8349_PCI_66_defconfig|  1 +
 configs/vme8349_defconfig   |  1 +
 include/configs/MPC8349EMDS.h   | 11 ++-
 include/configs/MPC8349EMDS_SDRAM.h | 11 ++-
 include/configs/TQM834x.h   |  2 +-
 include/configs/caddy2.h|  8 
 include/configs/sbc8349.h   | 10 +-
 include/configs/vme8349.h   | 10 +-
 13 files changed, 44 insertions(+), 51 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 0ce1aad6d0..bd4e5c14a9 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -215,6 +215,32 @@ config ARCH_MPC8360
 config ARCH_MPC837X
bool
 
+menu "Legacy options"
+
+if ARCH_MPC8349
+
+#TODO(mario@gdsys.cc): Remove when mpc83xx PCI has been converted to DM/DT
+choice
+   prompt "PMC slot configuration"
+
+config PCI_ALL_PCI1
+   bool "All PMC slots on PCI1"
+
+config PCI_ONE_PCI1
+   bool "First PMC1 on PCI1"
+
+config PCI_TWO_PCI1
+   bool "First two PMC1 on PCI1"
+
+endchoice
+
+config PCI_64BIT
+   bool "PMC2 is 64bit"
+
+endif
+
+endmenu
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/board/freescale/mpc8349emds/pci.c 
b/board/freescale/mpc8349emds/pci.c
index a2feda855f..005190ed87 100644
--- a/board/freescale/mpc8349emds/pci.c
+++ b/board/freescale/mpc8349emds/pci.c
@@ -77,11 +77,11 @@ void pib_init(void)
i2c_write(0x26, 0x6, 1, , 1);
val8 = 0x34;
i2c_write(0x26, 0x7, 1, , 1);
-#if defined(PCI_64BIT)
+#if defined(CONFIG_PCI_64BIT)
val8 = 0xf4;/* PMC2:PCI1/64-bit */
-#elif defined(PCI_ALL_PCI1)
+#elif defined(CONFIG_PCI_ALL_PCI1)
val8 = 0xf3;/* PMC1:PCI1 PMC2:PCI1 PMC3:PCI1 */
-#elif defined(PCI_ONE_PCI1)
+#elif defined(CONFIG_PCI_ONE_PCI1)
val8 = 0xf9;/* PMC1:PCI1 PMC2:PCI2 PMC3:PCI2 */
 #else
val8 = 0xf5;/* PMC1:PCI1 PMC2:PCI1 PMC3:PCI2 */
@@ -98,11 +98,11 @@ void pib_init(void)
i2c_write(0x27, 0x3, 1, , 1);
asm("eieio");
 
-#if defined(PCI_64BIT)
+#if defined(CONFIG_PCI_64BIT)
printf("PCI1: 64-bit on PMC2\n");
-#elif defined(PCI_ALL_PCI1)
+#elif defined(CONFIG_PCI_ALL_PCI1)
printf("PCI1: 32-bit on PMC1, PMC2, PMC3\n");
-#elif defined(PCI_ONE_PCI1)
+#elif defined(CONFIG_PCI_ONE_PCI1)
printf("PCI1: 32-bit on PMC1\n");
printf("PCI2: 32-bit on PMC2, PMC3\n");
 #else
diff --git a/configs/MPC8349EMDS_SDRAM_defconfig 
b/configs/MPC8349EMDS_SDRAM_defconfig
index 8ec8740839..4da9774f07 100644
--- a/configs/MPC8349EMDS_SDRAM_defconfig
+++ b/configs/MPC8349EMDS_SDRAM_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE00
 CONFIG_MPC83xx=y
 CONFIG_TARGET_MPC8349EMDS_SDRAM=y
+CONFIG_PCI_ONE_PCI1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
diff --git a/configs/MPC8349EMDS_defconfig b/configs/MPC8349EMDS_defconfig
index 27bd949981..9f6dc44fea 100644
--- a/configs/MPC8349EMDS_defconfig
+++ b/configs/MPC8349EMDS_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE00
 CONFIG_MPC83xx=y
 CONFIG_TARGET_MPC8349EMDS=y
+CONFIG_PCI_ONE_PCI1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
diff --git a/configs/sbc8349_PCI_33_defconfig b/configs/sbc8349_PCI_33_defconfig
index 01a6c260dd..decfc94f6b 100644
--- a/configs/sbc8349_PCI_33_defconfig
+++ b/configs/sbc8349_PCI_33_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFF80
 CONFIG_MPC83xx=y
 CONFIG_TARGET_SBC8349=y
+CONFIG_PCI_64BIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="PCI_33M"
diff --git a/configs/sbc8349_PCI_66_defconfig b/configs/sbc8349_PCI_66_defconfig
index 30bb7c366f..d29a6b51f9 100644
--- a/configs/sbc8349_PCI_66_defconfig
+++ b/configs/sbc8349_PCI_66_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFF80
 CONFIG_MPC83xx=y
 CONFIG_TARGET_SBC8349=y
+CONFIG_PCI_64BIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="PCI_66M"
diff --git a/configs/vme8349_defconfig b/configs/vme8349_defconfig
index dae53cf238..8b46074884 100644
--- a/configs/vme8349_defconfig
+++ b/configs/vme8349_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFFF0
 CONFIG_MPC83xx=y
 CONFIG_TARGET_VME8349=y
+CONFIG_PCI_64BIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
diff --git a/include/configs/MPC8349EMDS.h 

[U-Boot] [PATCH 34/48] MPC837XEMDS: Remove CONFIG_MPC837XEMDS

2018-09-28 Thread Mario Six
CONFIG_MPC837XEMDS is unused, and TARGET_MPC837XEMDS could replace it.

Hence, get rid of CONFIG_MPC837XEMDS.

Signed-off-by: Mario Six 
---
 include/configs/MPC837XEMDS.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h
index ea009eb094..c693486d04 100644
--- a/include/configs/MPC837XEMDS.h
+++ b/include/configs/MPC837XEMDS.h
@@ -11,7 +11,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001 /* E300 family */
-#define CONFIG_MPC837XEMDS 1 /* MPC837XEMDS board specific */
 
 /*
  * System Clock Setup
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 40/48] mpc83xx: pcie: Read the clock from registers

2018-09-28 Thread Mario Six
The MPC83xx DM timer driver disables arch.pciexp*_clk, and uses
clk_get_rate instead. But the legacy MPC83xx PCIe driver still uses
arch.pciexp*_clk for the clock.

Hence, read the PCIe clock from the registers in the legacy MPC83xx PCIe
driver.

Signed-off-by: Mario Six 
---
 arch/powerpc/cpu/mpc83xx/pcie.c | 39 ---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/pcie.c b/arch/powerpc/cpu/mpc83xx/pcie.c
index d3f979f3c4..b500ddd3f3 100644
--- a/arch/powerpc/cpu/mpc83xx/pcie.c
+++ b/arch/powerpc/cpu/mpc83xx/pcie.c
@@ -174,6 +174,41 @@ static void mpc83xx_pcie_register_hose(int bus, struct 
pci_region *reg,
 
 #endif /* CONFIG_83XX_GENERIC_PCIE_REGISTER_HOSES */
 
+int get_pcie_clk(int index)
+{
+   volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
+   u32 pci_sync_in;
+   u8 spmf;
+   u8 clkin_div;
+   u32 sccr;
+   u32 csb_clk;
+   u32 testval;
+
+   clkin_div = ((im->clk.spmr & SPMR_CKID) >> SPMR_CKID_SHIFT);
+   sccr = im->clk.sccr;
+   pci_sync_in = CONFIG_SYS_CLK_FREQ / (1 + clkin_div);
+   spmf = (im->clk.spmr & SPMR_SPMF) >> SPMR_SPMF_SHIFT;
+   csb_clk = pci_sync_in * (1 + clkin_div) * spmf;
+
+   if (index)
+   testval = (sccr & SCCR_PCIEXP2CM) >> SCCR_PCIEXP2CM_SHIFT;
+   else
+   testval = (sccr & SCCR_PCIEXP1CM) >> SCCR_PCIEXP1CM_SHIFT;
+
+   switch (testval) {
+   case 0:
+   return 0;
+   case 1:
+   return csb_clk;
+   case 2:
+   return csb_clk / 2;
+   case 3:
+   return csb_clk / 3;
+   }
+
+   return 0;
+}
+
 static void mpc83xx_pcie_init_bus(int bus, struct pci_region *reg)
 {
immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
@@ -269,11 +304,9 @@ static void mpc83xx_pcie_init_bus(int bus, struct 
pci_region *reg)
/* Hose configure header is memory-mapped */
hose_cfg_base = (void *)pex;
 
-   get_clocks();
/* Configure the PCIE controller core clock ratio */
out_le32(hose_cfg_base + PEX_GCLK_RATIO,
-   (((bus ? gd->arch.pciexp2_clk : gd->arch.pciexp1_clk)
-   / 100) * 16) / 333);
+   ((get_pcie_clk(bus) / 100) * 16) / 333);
udelay(100);
 
/* Do Type 1 bridge configuration */
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 27/48] ve8313: Merge BR/OR settings

2018-09-28 Thread Mario Six
The ve8313 has the option of either configuring the eLBC (enhanced local system 
bus) such that

* NOR flash is the first memory bank, and NAND flash is the second memory bank, 
or
* NAND flash is the first memory bank, and NOR flash is the second memory bank,

by using CONFIG_SYS_NOR_{BR,OR}_PRELIM and
CONFIG_SYS_NAND_{BR,OR}_PRELIM for defining
CONFIG_SYS_{BR,OR}{0,1}_PRELIM.

After Kconfig migration, replacing some lines in the defconfig will have
the same effect.

Hence, we will not create distinct ve8313_{NOR,NAND} configs for such a
small change.

Instead, fix the current default (NOR first, NAND second), and unroll
the  CONFIG_SYS_NAND_{BR,OR}_PRELIM options. This will ease the Kconfig
migration

Signed-off-by: Mario Six 
---
 include/configs/ve8313.h | 39 +++
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/include/configs/ve8313.h b/include/configs/ve8313.h
index dfbebee6b2..deac6a9e60 100644
--- a/include/configs/ve8313.h
+++ b/include/configs/ve8313.h
@@ -118,18 +118,6 @@
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* display empty sectors */
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE  /* buffer up multiple bytes */
 
-#define CONFIG_SYS_NOR_BR_PRELIM   (CONFIG_SYS_FLASH_BASE \
-   | BR_PS_16  /* 16 bit */ \
-   | BR_MS_GPCM/* MSEL = GPCM */ \
-   | BR_V) /* valid */
-#define CONFIG_SYS_NOR_OR_PRELIM   (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
-   | OR_GPCM_CSNT \
-   | OR_GPCM_ACS_DIV4 \
-   | OR_GPCM_SCY_5 \
-   | OR_GPCM_TRLX_SET \
-   | OR_GPCM_EAD)
-   /* 0xfe000c55 */
-
 #define CONFIG_SYS_LBLAWBAR0_PRELIMCONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_32MB)
 
@@ -175,24 +163,35 @@
 #define CONFIG_NAND_FSL_ELBC 1
 #define CONFIG_SYS_NAND_BLOCK_SIZE 16384
 
-#define CONFIG_SYS_NAND_BR_PRELIM  (CONFIG_SYS_NAND_BASE \
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE \
+   | BR_PS_16  /* 16 bit */ \
+   | BR_MS_GPCM/* MSEL = GPCM */ \
+   | BR_V) /* valid */
+#define CONFIG_SYS_OR0_PRELIM (OR_AM_32MB \
+   | OR_GPCM_CSNT \
+   | OR_GPCM_ACS_DIV4 \
+   | OR_GPCM_SCY_5 \
+   | OR_GPCM_TRLX_SET \
+   | OR_GPCM_EAD)
+   /* 0xfe000c55 */
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_NAND_BASE \
| BR_PS_8   \
| BR_DECC_CHK_GEN   \
| BR_MS_FCM \
| BR_V) /* valid */
/* 0x61000c21 */
-#define CONFIG_SYS_NAND_OR_PRELIM  (OR_AM_32KB \
+#define CONFIG_SYS_OR1_PRELIM (OR_AM_32KB \
| OR_FCM_BCTLD \
| OR_FCM_CHT \
| OR_FCM_SCY_2 \
| OR_FCM_RST \
-   | OR_FCM_TRLX)
-   /* 0x90ac */
+   | OR_FCM_TRLX) /* 0x90ac */
 
-#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NOR_BR_PRELIM
-#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NOR_OR_PRELIM
-#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NAND_BR_PRELIM
-#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM
+/* Still needed for spl_minimal.c */
+#define CONFIG_SYS_NAND_BR_PRELIM CONFIG_SYS_BR1_PRELIM
+#define CONFIG_SYS_NAND_OR_PRELIM CONFIG_SYS_OR1_PRELIM
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIMCONFIG_SYS_NAND_BASE
 #define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_32KB)
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 37/48] mpc83xx: Replace CONFIG_83XX_CLKIN in calculations

2018-09-28 Thread Mario Six
CONFIG_SYS_CLK_FREQ is the standard way to set the system clock
frequency. On MPC83xx, CONFIG_83XX_CLKIN is used for this purpose.
Hence, the obvious way is to replace CONFIG_83XX_CLKIN with
CONFIG_SYS_CLK_FREQ.

A few MPC83xx boards use the CONFIG_83XX_CLKIN variable for computing
CONFIG_SYS_NS16550_CLK. This makes it harder to replace
CONFIG_83XX_CLKIN.

But the value of the multiplicator can be read from the SPMR register.

Hence, replace the static calculations with a call to a new get_bus_freq
function, as other architectures do.

Signed-off-by: Mario Six 
---
 arch/powerpc/cpu/mpc83xx/spl_minimal.c | 8 
 include/configs/MPC8315ERDB.h  | 2 +-
 include/configs/ids8313.h  | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/spl_minimal.c 
b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
index 746f1febba..3315ee05e1 100644
--- a/arch/powerpc/cpu/mpc83xx/spl_minimal.c
+++ b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
@@ -89,3 +89,11 @@ void puts(const char *str)
while (*str)
putc(*str++);
 }
+
+ulong get_bus_freq(ulong dummy)
+{
+   volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
+   u8 spmf = (im->clk.spmr & SPMR_SPMF) >> SPMR_SPMF_SHIFT;
+
+   return CONFIG_83XX_CLKIN * spmf;
+}
diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index dd60ce8538..8466e867bb 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -274,7 +274,7 @@
  */
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE1
-#define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 2)
+#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0))
 
 #define CONFIG_SYS_BAUDRATE_TABLE  \
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index 6a222e9757..b371b3b1ba 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -315,7 +315,7 @@
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
 #define CONFIG_SYS_NS16550_COM1(CONFIG_SYS_IMMR + 0x4500)
 #define CONFIG_SYS_NS16550_COM2(CONFIG_SYS_IMMR + 0x4600)
-#define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 2)
+#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0))
 
 #define CONFIG_HAS_FSL_DR_USB
 #define CONFIG_SYS_SCCR_USBDRCM3
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 26/48] mpc8315erdb: Merge BR/OR settings

2018-09-28 Thread Mario Six
The mpc8315erdb has the option of either configuring the eLBC (enhanced
local system bus) such that

* NOR flash is the first memory bank, and NAND flash is the second
  memory bank, or
* NAND flash is the first memory bank, and NOR flash is the second
  memory bank,

by using CONFIG_SYS_NOR_{BR,OR}_PRELIM and
CONFIG_SYS_NAND_{BR,OR}_PRELIM for defining
CONFIG_SYS_{BR,OR}{0,1}_PRELIM.

After Kconfig migration, replacing some lines in the defconfig will have
the same effect.

Hence, we will not create distinct ve8313_{NOR,NAND} configs for such a small 
change.

Instead, fix the current default (NOR first, NAND second), and unroll
the CONFIG_SYS_NAND_{BR,OR}_PRELIM options. This will ease the Kconfig
migration.

Signed-off-by: Mario Six 
---
 include/configs/MPC8315ERDB.h | 40 +++-
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index 64967f6798..7607704411 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -194,20 +194,6 @@
 #define CONFIG_SYS_LBLAWBAR0_PRELIMCONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_8MB)
 
-#define CONFIG_SYS_NOR_BR_PRELIM   (CONFIG_SYS_FLASH_BASE \
-   | BR_PS_16  /* 16 bit port */ \
-   | BR_MS_GPCM/* MSEL = GPCM */ \
-   | BR_V) /* valid */
-#define CONFIG_SYS_NOR_OR_PRELIM   (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
-   | OR_UPM_XAM \
-   | OR_GPCM_CSNT \
-   | OR_GPCM_ACS_DIV2 \
-   | OR_GPCM_XACS \
-   | OR_GPCM_SCY_15 \
-   | OR_GPCM_TRLX_SET \
-   | OR_GPCM_EHTR_SET \
-   | OR_GPCM_EAD)
-
 #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */
 /* 127 64KB sectors and 8 8KB top sectors per device */
 #define CONFIG_SYS_MAX_FLASH_SECT  135
@@ -239,13 +225,26 @@
 #define CONFIG_SYS_NAND_U_BOOT_OFFS  16384
 #define CONFIG_SYS_NAND_U_BOOT_RELOC 0x0001
 
-#define CONFIG_SYS_NAND_BR_PRELIM  (CONFIG_SYS_NAND_BASE \
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE \
+   | BR_PS_16  /* 16 bit port */ \
+   | BR_MS_GPCM/* MSEL = GPCM */ \
+   | BR_V) /* valid */
+#define CONFIG_SYS_OR0_PRELIM (OR_AM_8MB \
+   | OR_UPM_XAM \
+   | OR_GPCM_CSNT \
+   | OR_GPCM_ACS_DIV2 \
+   | OR_GPCM_XACS \
+   | OR_GPCM_SCY_15 \
+   | OR_GPCM_TRLX_SET \
+   | OR_GPCM_EHTR_SET \
+   | OR_GPCM_EAD)
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_NAND_BASE \
| BR_DECC_CHK_GEN   /* Use HW ECC */ \
| BR_PS_8   /* 8 bit port */ \
| BR_MS_FCM /* MSEL = FCM */ \
| BR_V) /* valid */
-#define CONFIG_SYS_NAND_OR_PRELIM  \
-   (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \
+#define CONFIG_SYS_OR1_PRELIM \
+   (OR_AM_32KB \
| OR_FCM_CSCT \
| OR_FCM_CST \
| OR_FCM_CHT \
@@ -254,10 +253,9 @@
| OR_FCM_EHTR)
/* 0x8396 */
 
-#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NOR_BR_PRELIM
-#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NOR_OR_PRELIM
-#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NAND_BR_PRELIM
-#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM
+/* Still needed for spl_minimal.c */
+#define CONFIG_SYS_NAND_BR_PRELIM CONFIG_SYS_BR1_PRELIM
+#define CONFIG_SYS_NAND_OR_PRELIM CONFIG_SYS_OR1_PRELIM
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIMCONFIG_SYS_NAND_BASE
 #define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_32KB)
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 29/48] MPC8349ITX: Migrate to CONFIG_TARGET_MPC8349ITX

2018-09-28 Thread Mario Six
Use the proper CONFIG_TARGET_MPC8349ITX Kconfig option to replace the
CONFIG_MPC8349ITX ad-hoc config option.

Signed-off-by: Mario Six 
---
 board/freescale/mpc8349itx/mpc8349itx.c | 2 +-
 configs/MPC8349ITX_LOWBOOT_defconfig| 1 -
 configs/MPC8349ITX_defconfig| 1 -
 include/configs/MPC8349ITX.h| 4 ++--
 4 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/board/freescale/mpc8349itx/mpc8349itx.c 
b/board/freescale/mpc8349itx/mpc8349itx.c
index 3bdec1c400..d90553384f 100644
--- a/board/freescale/mpc8349itx/mpc8349itx.c
+++ b/board/freescale/mpc8349itx/mpc8349itx.c
@@ -152,7 +152,7 @@ int dram_init(void)
 
 int checkboard(void)
 {
-#ifdef CONFIG_MPC8349ITX
+#ifdef CONFIG_TARGET_MPC8349ITX
puts("Board: Freescale MPC8349E-mITX\n");
 #else
puts("Board: Freescale MPC8349E-mITX-GP\n");
diff --git a/configs/MPC8349ITX_LOWBOOT_defconfig 
b/configs/MPC8349ITX_LOWBOOT_defconfig
index d740908290..acc7eb5b5a 100644
--- a/configs/MPC8349ITX_LOWBOOT_defconfig
+++ b/configs/MPC8349ITX_LOWBOOT_defconfig
@@ -4,7 +4,6 @@ CONFIG_MPC83xx=y
 CONFIG_TARGET_MPC8349ITX=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="MPC8349ITX"
 CONFIG_BOOTDELAY=6
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs 
ip=mpc8349emitx:eth0:off console=ttyS0,115200"
diff --git a/configs/MPC8349ITX_defconfig b/configs/MPC8349ITX_defconfig
index 03f20c39ae..e2b52bfee4 100644
--- a/configs/MPC8349ITX_defconfig
+++ b/configs/MPC8349ITX_defconfig
@@ -4,7 +4,6 @@ CONFIG_MPC83xx=y
 CONFIG_TARGET_MPC8349ITX=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="MPC8349ITX"
 CONFIG_BOOTDELAY=6
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs 
ip=mpc8349emitx:eth0:off console=ttyS0,115200"
diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h
index 1b247a3a3e..76386979fb 100644
--- a/include/configs/MPC8349ITX.h
+++ b/include/configs/MPC8349ITX.h
@@ -54,7 +54,7 @@
  * On-board devices
  */
 
-#ifdef CONFIG_MPC8349ITX
+#ifdef CONFIG_TARGET_MPC8349ITX
 /* The CF card interface on the back of the board */
 #define CONFIG_COMPACT_FLASH
 #define CONFIG_VSC7385_ENET/* VSC7385 ethernet support */
@@ -646,7 +646,7 @@ boards, we say we have two, but don't display a message if 
we find only one. */
/* U-Boot image on TFTP server */
 #define CONFIG_UBOOTPATH   "u-boot.bin"
 
-#ifdef CONFIG_MPC8349ITX
+#ifdef CONFIG_TARGET_MPC8349ITX
 #define CONFIG_FDTFILE "mpc8349emitx.dtb"
 #else
 #define CONFIG_FDTFILE "mpc8349emitxgp.dtb"
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 47/48] sbc8349: Remove SDRAM functionality

2018-09-28 Thread Mario Six
The MPC8349EMDS configuration was the basis for the sbc8349, so it also
contains its SDRAM option.

Since
* the SDRAM has to be soldered onto the board,
* the sbc8349 never used the support, and
* the support never worked (see previous patch fixing it),

we can assume that the support on the sbc8349 is an artifact created by
copying the MPC8349EMDS config wholesome.

Hence, instead of creating a separate sbc8349 config that supports
SDRAM, we can remove the SDRAM option for this board.

Should it be needed in the future, it can be copied from the new
MPC8349EMDS_SDRAM board.

Signed-off-by: Mario Six 
---
 include/configs/sbc8349.h | 67 ---
 1 file changed, 67 deletions(-)

diff --git a/include/configs/sbc8349.h b/include/configs/sbc8349.h
index 07241559f6..406b7ba63e 100644
--- a/include/configs/sbc8349.h
+++ b/include/configs/sbc8349.h
@@ -145,73 +145,6 @@
 
 #undef CONFIG_SYS_LB_SDRAM /* if board has SDRAM on local bus */
 
-#ifdef CONFIG_SYS_LB_SDRAM
-/* Local bus BR2, OR2 definition for SDRAM if soldered on the board*/
-/*
- * Base Register 2 and Option Register 2 configure SDRAM.
- * The SDRAM base address, CONFIG_SYS_LBC_SDRAM_BASE, is 0xf000.
- *
- * For BR2, need:
- *Base address of 0xf000 = BR[0:16] =     0
- *port-size = 32-bits = BR2[19:20] = 11
- *no parity checking = BR2[21:22] = 00
- *SDRAM for MSEL = BR2[24:26] = 011
- *Valid = BR[31] = 1
- *
- * 04812   16   20   24   28
- *     0001 1000 0110 0001 = F0001861
- */
-
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_LBC_SDRAM_BASE \
-   | BR_PS_32 \
-   | BR_MS_SDRAM \
-   | BR_V)
-   /* 0xF0001861 */
-/*
- * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64.
- *
- * For OR2, need:
- *64MB mask for AM, OR2[0:7] =  1100
- * XAM, OR2[17:18] = 11
- *9 columns OR2[19-21] = 010
- *13 rows   OR2[23-25] = 100
- *EAD set for extra time OR[31] = 1
- *
- * 04812   16   20   24   28
- *  1100   0110 1001  0001 = FC006901
- */
-
-#define CONFIG_SYS_OR2_PRELIM  (OR_AM_64MB \
-   | OR_SDRAM_XAM \
-   | ((9 - OR_SDRAM_MIN_COLS) << OR_SDRAM_COLS_SHIFT) \
-   | ((13 - OR_SDRAM_MIN_ROWS) << OR_SDRAM_ROWS_SHIFT) \
-   | OR_SDRAM_EAD)
-   /* 0xFC006901 */
-
-   /* LB sdram refresh timer, about 6us */
-#define CONFIG_SYS_LBC_LSRT0x3200
-   /* LB refresh timer prescal, 266MHz/32 */
-#define CONFIG_SYS_LBC_MRTPR   0x2000
-
-#define CONFIG_SYS_LBC_LSDMR_COMMON(LSDMR_RFEN \
-   | LSDMR_BSMA1516 \
-   | LSDMR_RFCR8 \
-   | LSDMR_PRETOACT6 \
-   | LSDMR_ACTTORW3 \
-   | LSDMR_BL8 \
-   | LSDMR_WRC3 \
-   | LSDMR_CL3)
-
-/*
- * SDRAM Controller configuration sequence.
- */
-#define CONFIG_SYS_LBC_LSDMR_1 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_PCHALL)
-#define CONFIG_SYS_LBC_LSDMR_2 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH)
-#define CONFIG_SYS_LBC_LSDMR_3 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH)
-#define CONFIG_SYS_LBC_LSDMR_4 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_MRW)
-#define CONFIG_SYS_LBC_LSDMR_5 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_NORMAL)
-#endif
-
 /*
  * Serial Port
  */
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 33/48] MPC8315ERDB: Remove CONFIG_MPC8315ERDB

2018-09-28 Thread Mario Six
CONFIG_MPC8315ERDB is unused, and TARGET_MPC8315ERDB could replace it.

Hence, get rid of CONFIG_MPC8315ERDB.

Signed-off-by: Mario Six 
---
 include/configs/MPC8315ERDB.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index 7607704411..dd60ce8538 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -22,7 +22,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001 /* E300 family */
-#define CONFIG_MPC8315ERDB 1 /* MPC8315ERDB board specific */
 
 /*
  * System Clock Setup
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 28/48] MPC832XEMDS: Migrate to CONFIG_TARGET_MPC832XEMDS

2018-09-28 Thread Mario Six
Use the proper CONFIG_TARGET_MPC832XEMDS Kconfig option to replace the
CONFIG_MPC832XEMDS ad-hoc config option.

Signed-off-by: Mario Six 
---
 board/freescale/common/pq-mds-pib.c | 6 +++---
 include/configs/MPC832XEMDS.h   | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/board/freescale/common/pq-mds-pib.c 
b/board/freescale/common/pq-mds-pib.c
index d152a7821f..ae66039857 100644
--- a/board/freescale/common/pq-mds-pib.c
+++ b/board/freescale/common/pq-mds-pib.c
@@ -36,7 +36,7 @@ int pib_init(void)
i2c_write(0x26, 0x6, 1, , 1);
val8 = 0x34;
i2c_write(0x26, 0x7, 1, , 1);
-#if defined(CONFIG_MPC832XEMDS)
+#if defined(CONFIG_TARGET_MPC832XEMDS)
val8 = 0xf9;/* PMC2, PMC3 slot to PCI bus */
 #else
val8 = 0xf3;/* PMC1, PMC2, PMC3 slot to PCI bus */
@@ -55,7 +55,7 @@ int pib_init(void)
 
eieio();
 
-#if defined(CONFIG_MPC832XEMDS)
+#if defined(CONFIG_TARGET_MPC832XEMDS)
printf("PCI 32bit bus on PMC2 \n");
 #else
printf("PCI 32bit bus on PMC1 & PMC2 \n");
@@ -76,7 +76,7 @@ int pib_init(void)
eieio();
 
printf("QOC3 ATM card on PMC0\n");
-#elif defined(CONFIG_MPC832XEMDS)
+#elif defined(CONFIG_TARGET_MPC832XEMDS)
val8 = 0;
i2c_write(0x26, 0x7, 1, , 1);
val8 = 0xf7;
diff --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h
index ff8692e9ca..a4047513d8 100644
--- a/include/configs/MPC832XEMDS.h
+++ b/include/configs/MPC832XEMDS.h
@@ -11,7 +11,6 @@
  */
 #define CONFIG_E3001   /* E300 family */
 #define CONFIG_QE  1   /* Has QE */
-#define CONFIG_MPC832XEMDS 1   /* MPC832XEMDS board specific */
 
 /*
  * System Clock Setup
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 30/48] hrcom: Migrate to CONFIG_TARGET_HRCON

2018-09-28 Thread Mario Six
Use the proper CONFIG_TARGET_HRCON Kconfig option to replace
the CONFIG_HRCON ad-hoc config option.

Signed-off-by: Mario Six 
---
 board/gdsys/common/Makefile  | 2 +-
 board/gdsys/mpc8308/Makefile | 2 +-
 include/configs/hrcon.h  | 1 -
 include/gdsys_fpga.h | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile
index 698ea3b02b..91d446741c 100644
--- a/board/gdsys/common/Makefile
+++ b/board/gdsys/common/Makefile
@@ -10,7 +10,7 @@ obj-$(CONFIG_IO64) += miiphybb.o
 obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o ch7301.o
 obj-$(CONFIG_DLVISION_10G) += osd.o dp501.o
 obj-$(CONFIG_CONTROLCENTERD) += dp501.o
-obj-$(CONFIG_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o fanctrl.o
+obj-$(CONFIG_TARGET_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o 
fanctrl.o
 obj-$(CONFIG_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o ch7301.o
 obj-$(CONFIG_STRIDER) += fanctrl.o
 obj-$(CONFIG_STRIDER_CON) += osd.o
diff --git a/board/gdsys/mpc8308/Makefile b/board/gdsys/mpc8308/Makefile
index 60d2232573..f29376fc9e 100644
--- a/board/gdsys/mpc8308/Makefile
+++ b/board/gdsys/mpc8308/Makefile
@@ -4,5 +4,5 @@
 # Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
 
 obj-y := mpc8308.o sdram.o
-obj-$(CONFIG_HRCON) += hrcon.o
+obj-$(CONFIG_TARGET_HRCON) += hrcon.o
 obj-$(CONFIG_STRIDER) += strider.o
diff --git a/include/configs/hrcon.h b/include/configs/hrcon.h
index da0b0f5014..bcf5692578 100644
--- a/include/configs/hrcon.h
+++ b/include/configs/hrcon.h
@@ -13,7 +13,6 @@
  */
 #define CONFIG_E3001 /* E300 family */
 #define CONFIG_MPC83xx 1 /* MPC83xx family */
-#define CONFIG_HRCON   1 /* HRCON board specific */
 
 #define CONFIG_SYS_FSL_ESDHC_ADDR  CONFIG_SYS_MPC83xx_ESDHC_ADDR
 
diff --git a/include/gdsys_fpga.h b/include/gdsys_fpga.h
index db4424d3f8..e9fb4b88b5 100644
--- a/include/gdsys_fpga.h
+++ b/include/gdsys_fpga.h
@@ -161,7 +161,7 @@ struct ihs_fpga {
 };
 #endif
 
-#if defined(CONFIG_HRCON) || defined(CONFIG_STRIDER_CON_DP)
+#if defined(CONFIG_TARGET_HRCON) || defined(CONFIG_STRIDER_CON_DP)
 struct ihs_fpga {
u16 reflection_low; /* 0x */
u16 versions;   /* 0x0002 */
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 31/48] strider: Migrate to CONFIG_TARGET_STRIDER

2018-09-28 Thread Mario Six
Use the proper CONFIG_TARGET_STRIDER Kconfig option to replace the
CONFIG_STRIDER ad-hoc config option.

Signed-off-by: Mario Six 
---
 board/gdsys/common/Makefile  | 4 ++--
 board/gdsys/mpc8308/Makefile | 2 +-
 include/configs/strider.h| 1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile
index 91d446741c..aa1219a2e2 100644
--- a/board/gdsys/common/Makefile
+++ b/board/gdsys/common/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o ch7301.o
 obj-$(CONFIG_DLVISION_10G) += osd.o dp501.o
 obj-$(CONFIG_CONTROLCENTERD) += dp501.o
 obj-$(CONFIG_TARGET_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o 
fanctrl.o
-obj-$(CONFIG_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o ch7301.o
-obj-$(CONFIG_STRIDER) += fanctrl.o
+obj-$(CONFIG_TARGET_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o 
ch7301.o
+obj-$(CONFIG_TARGET_STRIDER) += fanctrl.o
 obj-$(CONFIG_STRIDER_CON) += osd.o
 obj-$(CONFIG_STRIDER_CON_DP) += osd.o
diff --git a/board/gdsys/mpc8308/Makefile b/board/gdsys/mpc8308/Makefile
index f29376fc9e..dc579479f9 100644
--- a/board/gdsys/mpc8308/Makefile
+++ b/board/gdsys/mpc8308/Makefile
@@ -5,4 +5,4 @@
 
 obj-y := mpc8308.o sdram.o
 obj-$(CONFIG_TARGET_HRCON) += hrcon.o
-obj-$(CONFIG_STRIDER) += strider.o
+obj-$(CONFIG_TARGET_STRIDER) += strider.o
diff --git a/include/configs/strider.h b/include/configs/strider.h
index 9a025b255f..121edd7745 100644
--- a/include/configs/strider.h
+++ b/include/configs/strider.h
@@ -13,7 +13,6 @@
  */
 #define CONFIG_E3001 /* E300 family */
 #define CONFIG_MPC83xx 1 /* MPC83xx family */
-#define CONFIG_STRIDER 1 /* STRIDER board specific */
 
 #define CONFIG_SYS_FSL_ESDHC_ADDR  CONFIG_SYS_MPC83xx_ESDHC_ADDR
 
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 32/48] MPC8313ERDB: Remove CONFIG_MPC8313ERDB

2018-09-28 Thread Mario Six
CONFIG_MPC8313ERDB is unused, and
TARGET_MPC8313ERDB_NAND/TARGET_MPC8313ERDB_NOR Kconfig could replace it.

Hence, get rid of CONFIG_MPC8313ERDB.

Signed-off-by: Mario Six 
---
 include/configs/MPC8313ERDB_NAND.h | 1 -
 include/configs/MPC8313ERDB_NOR.h  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/include/configs/MPC8313ERDB_NAND.h 
b/include/configs/MPC8313ERDB_NAND.h
index e17c632f3a..d8d8c8e68a 100644
--- a/include/configs/MPC8313ERDB_NAND.h
+++ b/include/configs/MPC8313ERDB_NAND.h
@@ -13,7 +13,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001
-#define CONFIG_MPC8313ERDB 1
 
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
diff --git a/include/configs/MPC8313ERDB_NOR.h 
b/include/configs/MPC8313ERDB_NOR.h
index 8d8482d00f..03420a181c 100644
--- a/include/configs/MPC8313ERDB_NOR.h
+++ b/include/configs/MPC8313ERDB_NOR.h
@@ -13,7 +13,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001
-#define CONFIG_MPC8313ERDB 1
 
 #ifndef CONFIG_SYS_MONITOR_BASE
 #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE/* start of 
monitor */
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 21/48] mpc83xx: Make distinct caddy2 config

2018-09-28 Thread Mario Six
vme8349.h contains two separate boards: The vme8349 itself, and the
caddy2 board. The caddy2 board is chosen by setting certain config
variables. Create a proper config file for the caddy2 board to make
Kconfig migration easier.

Signed-off-by: Mario Six 
---
 arch/powerpc/cpu/mpc83xx/Kconfig |   4 +
 board/esd/vme8349/Kconfig|  13 +
 board/esd/vme8349/vme8349.c  |   8 +-
 configs/caddy2_defconfig |   3 +-
 drivers/pci/pci_auto.c   |   3 +-
 drivers/pci/pci_auto_old.c   |   3 +-
 include/configs/caddy2.h | 544 +++
 7 files changed, 570 insertions(+), 8 deletions(-)
 create mode 100644 include/configs/caddy2.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index ede98c70da..65f4583ffe 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -24,6 +24,10 @@ config TARGET_VME8349
bool "Support vme8349"
select ARCH_MPC8349
 
+config TARGET_CADDY2
+   bool "Support caddy2"
+   select ARCH_MPC8349
+
 config TARGET_MPC8308RDB
bool "Support MPC8308RDB"
select ARCH_MPC8308
diff --git a/board/esd/vme8349/Kconfig b/board/esd/vme8349/Kconfig
index b8d9432dcc..ef2af40f7e 100644
--- a/board/esd/vme8349/Kconfig
+++ b/board/esd/vme8349/Kconfig
@@ -10,3 +10,16 @@ config SYS_CONFIG_NAME
default "vme8349"
 
 endif
+
+if TARGET_CADDY2
+
+config SYS_BOARD
+   default "vme8349"
+
+config SYS_VENDOR
+   default "esd"
+
+config SYS_CONFIG_NAME
+   default "caddy2"
+
+endif
diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c
index 45ad3a83ee..a46d0b6da6 100644
--- a/board/esd/vme8349/vme8349.c
+++ b/board/esd/vme8349/vme8349.c
@@ -60,7 +60,7 @@ int dram_init(void)
 
 int checkboard(void)
 {
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
puts("Board: esd VME-CADDY/2\n");
 #else
puts("Board: esd VME-CPU/8349\n");
@@ -69,7 +69,7 @@ int checkboard(void)
return 0;
 }
 
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
 int board_eth_init(bd_t *bis)
 {
return pci_eth_init(bis);
@@ -102,7 +102,7 @@ int misc_init_r()
  * Provide SPD values for spd_sdram(). Both boards (VME-CADDY/2
  * and VME-CADDY/2) have different SDRAM configurations.
  */
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
 #define SMALL_RAM  0xff
 #define LARGE_RAM  0x00
 #else
@@ -165,7 +165,7 @@ static spd_eeprom_t default_spd_eeprom = {
SPD_VAL(0x7e, 0x1d),/* 63 */
{ 'e', 's', 'd', '-', 'g', 'm', 'b', 'h' },
SPD_VAL(0x00, 0x00),/* 72 */
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
{ "vme-caddy/2 ram   " }
 #else
{ "vme-cpu/2 ram " }
diff --git a/configs/caddy2_defconfig b/configs/caddy2_defconfig
index 4367ed0e6c..1dc30c39dd 100644
--- a/configs/caddy2_defconfig
+++ b/configs/caddy2_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFFF0
 CONFIG_MPC83xx=y
-CONFIG_TARGET_VME8349=y
+CONFIG_TARGET_CADDY2=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="CADDY2"
 CONFIG_BOOTDELAY=6
 CONFIG_MISC_INIT_R=y
 CONFIG_HUSH_PARSER=y
diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index f5e46842bf..1a3bf70834 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -359,7 +359,8 @@ int dm_pciauto_config_device(struct udevice *dev)
  PCI_DEV(dm_pci_get_bdf(dev)));
break;
 #endif
-#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) && \
+   !defined(CONFIG_TARGET_CADDY2)
case PCI_CLASS_BRIDGE_OTHER:
/*
 * The host/PCI bridge 1 seems broken in 8349 - it presents
diff --git a/drivers/pci/pci_auto_old.c b/drivers/pci/pci_auto_old.c
index 6ab1b3b43f..b566705c9d 100644
--- a/drivers/pci/pci_auto_old.c
+++ b/drivers/pci/pci_auto_old.c
@@ -376,7 +376,8 @@ int pciauto_config_device(struct pci_controller *hose, 
pci_dev_t dev)
  PCI_DEV(dev));
break;
 #endif
-#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) && \
+   !defined(CONFIG_TARGET_CADDY2)
case PCI_CLASS_BRIDGE_OTHER:
/*
 * The host/PCI bridge 1 seems broken in 8349 - it presents
diff --git a/include/configs/caddy2.h b/include/configs/caddy2.h
new file mode 100644
index 00..4f2466eecf
--- /dev/null
+++ b/include/configs/caddy2.h
@@ -0,0 +1,544 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * esd vme8349 U-Boot configuration file
+ * Copyright (c) 2008, 2009 esd gmbh Hannover Germany
+ *
+ * (C) Copyright 2006-2010
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * reinhard.a...@esd-electronics.de
+ * Based on the MPC8349EMDS config.
+ */
+
+/*
+ * vme8349 board configuration file.

[U-Boot] [PATCH 24/48] mpc83xx: Make distinct MPC8349EMDS_SDRAM board

2018-09-28 Thread Mario Six
The MPC8349EMDS config file contains config options to enable SDRAM
support. To keep this ability after the Kconfig migration, create a new
MPC8349EMDS_SDRAM board that enables the SDRAM support.

Signed-off-by: Mario Six 
---
 arch/powerpc/cpu/mpc83xx/Kconfig|   8 +
 board/freescale/mpc8349emds/Kconfig |  13 +
 configs/MPC8349EMDS_SDRAM_defconfig |  24 ++
 include/configs/MPC8349EMDS_SDRAM.h | 739 
 4 files changed, 784 insertions(+)
 create mode 100644 configs/MPC8349EMDS_SDRAM_defconfig
 create mode 100644 include/configs/MPC8349EMDS_SDRAM.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 65f4583ffe..0ce1aad6d0 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -67,6 +67,14 @@ config TARGET_MPC8349EMDS
select SYS_FSL_DDR_BE
select SYS_FSL_HAS_DDR2
 
+config TARGET_MPC8349EMDS_SDRAM
+   bool "Support MPC8349EMDS_SDRAM"
+   select ARCH_MPC8349
+   select BOARD_EARLY_INIT_F
+   select SYS_FSL_DDR
+   select SYS_FSL_DDR_BE
+   select SYS_FSL_HAS_DDR2
+
 config TARGET_MPC8349ITX
bool "Support MPC8349ITX"
select ARCH_MPC8349
diff --git a/board/freescale/mpc8349emds/Kconfig 
b/board/freescale/mpc8349emds/Kconfig
index 51f0b34f39..d154118079 100644
--- a/board/freescale/mpc8349emds/Kconfig
+++ b/board/freescale/mpc8349emds/Kconfig
@@ -10,3 +10,16 @@ config SYS_CONFIG_NAME
default "MPC8349EMDS"
 
 endif
+
+if TARGET_MPC8349EMDS_SDRAM
+
+config SYS_BOARD
+   default "mpc8349emds"
+
+config SYS_VENDOR
+   default "freescale"
+
+config SYS_CONFIG_NAME
+   default "MPC8349EMDS_SDRAM"
+
+endif
diff --git a/configs/MPC8349EMDS_SDRAM_defconfig 
b/configs/MPC8349EMDS_SDRAM_defconfig
new file mode 100644
index 00..8ec8740839
--- /dev/null
+++ b/configs/MPC8349EMDS_SDRAM_defconfig
@@ -0,0 +1,24 @@
+CONFIG_PPC=y
+CONFIG_SYS_TEXT_BASE=0xFE00
+CONFIG_MPC83xx=y
+CONFIG_TARGET_MPC8349EMDS_SDRAM=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_BOOTDELAY=6
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_DATE=y
+# CONFIG_MMC is not set
+CONFIG_MTD_NOR_FLASH=y
+CONFIG_PHY_MARVELL=y
+CONFIG_NETDEVICES=y
+CONFIG_TSEC_ENET=y
+# CONFIG_PCI is not set
+CONFIG_SYS_NS16550=y
+CONFIG_SPI=y
+CONFIG_MPC8XXX_SPI=y
+CONFIG_OF_LIBFDT=y
diff --git a/include/configs/MPC8349EMDS_SDRAM.h 
b/include/configs/MPC8349EMDS_SDRAM.h
new file mode 100644
index 00..2ceed48ff3
--- /dev/null
+++ b/include/configs/MPC8349EMDS_SDRAM.h
@@ -0,0 +1,739 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2006-2010
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ */
+
+/*
+ * mpc8349emds board configuration file
+ *
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_E3001   /* E300 Family */
+
+#define CONFIG_PCI_66M
+#ifdef CONFIG_PCI_66M
+#define CONFIG_83XX_CLKIN  6600/* in Hz */
+#else
+#define CONFIG_83XX_CLKIN  3300/* in Hz */
+#endif
+
+#ifdef CONFIG_PCISLAVE
+#define CONFIG_83XX_PCICLK /* in Hz */
+#endif /* CONFIG_PCISLAVE */
+
+#ifndef CONFIG_SYS_CLK_FREQ
+#ifdef CONFIG_PCI_66M
+#define CONFIG_SYS_CLK_FREQ6600
+#define HRCWL_CSB_TO_CLKIN HRCWL_CSB_TO_CLKIN_4X1
+#else
+#define CONFIG_SYS_CLK_FREQ3300
+#define HRCWL_CSB_TO_CLKIN HRCWL_CSB_TO_CLKIN_8X1
+#endif
+#endif
+
+#define CONFIG_SYS_IMMR0xE000
+
+#undef CONFIG_SYS_DRAM_TEST/* memory test, takes time */
+#define CONFIG_SYS_MEMTEST_START   0x  /* memtest region */
+#define CONFIG_SYS_MEMTEST_END 0x0010
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_DDR_ECC /* support DDR ECC function */
+#define CONFIG_DDR_ECC_CMD /* use DDR ECC user commands */
+#define CONFIG_SPD_EEPROM  /* use SPD EEPROM for DDR setup*/
+
+/*
+ * SYS_FSL_DDR2 is selected in Kconfig to use unified DDR driver
+ * unselect it to use old spd_sdram.c
+ */
+#define CONFIG_SYS_SPD_BUS_NUM 0
+#define SPD_EEPROM_ADDRESS10x52
+#define SPD_EEPROM_ADDRESS20x51
+#define CONFIG_DIMM_SLOTS_PER_CTLR 2
+#define CONFIG_CHIP_SELECTS_PER_CTRL   (2 * CONFIG_DIMM_SLOTS_PER_CTLR)
+#define CONFIG_ECC_INIT_VIA_DDRCONTROLLER
+#define CONFIG_MEM_INIT_VALUE  0xDeadBeef
+
+/*
+ * 32-bit data path mode.
+ *
+ * Please note that using this mode for devices with the real density of 64-bit
+ * effectively reduces the amount of available memory due to the effect of
+ * wrapping around while translating address to row/columns, for example in the
+ * 256MB module the upper 128MB get aliased with contents of the lower
+ * 128MB); normally this define should be used for devices with real 32-bit
+ * data path.
+ */
+#undef CONFIG_DDR_32BIT
+
+#define CONFIG_SYS_DDR_BASE

  1   2   >