Re: [U-Boot] [PATCH 3/3] marvell: armada385: Add the Turris Omnia board

2017-06-09 Thread Marek Behún
On Sun, 28 May 2017 21:17:25 +0200
Pavel Machek  wrote:

> Should the path be .../cz.nic/... (lowercase)?

The name of the association is conventionally uppercase, and as I have
seen other board categories in U-Boot using uppercase letters
(AndesTech, BuR, CarMedialLab, Marvell, ...), I thought I should use
such for CZ.NIC too.

Should I change that?

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


Re: [U-Boot] [PATCH 3/3] marvell: armada385: Add the Turris Omnia board

2017-05-28 Thread Andreas Färber
Hi Pavel,

Am 28.05.2017 um 21:17 schrieb Pavel Machek:
>> Signed-off-by: Marek Behun 
[...]
>> +++ b/arch/arm/dts/armada-385-turris-omnia.dts
>> @@ -0,0 +1,428 @@
>> +/*
>> + * Device Tree file for the Turris Omnia
>> + *
>> + * Copyright (C) 2014 Marvell
>> + *
>> + * Marek Behun  
> There should be > at end of line.
> 
>> + * Gregory CLEMENT 
> 
> And if you want to claim copyright, you should also specify years...
> 
>> + * This file is dual-licensed: you can use it either under the terms
>> + * of the GPL or the X11 license, at your option. Note that this dual
>> + * licensing only applies to this file, and not this project as a
>> + * whole.
>> + *
>> + *  a) This file is licensed under the terms of the GNU General Public
>> + * License version 2.  This program is licensed "as is" without
>> + * any warranty of any kind, whether express or implied.
>> + *
>> + * Or, alternatively,
>> + *
>> + *  b) Permission is hereby granted, free of charge, to any person
>> + * obtaining a copy of this software and associated documentation
>> + * files (the "Software"), to deal in the Software without
>> + * restriction, including without limitation the rights to use,
>> + * copy, modify, merge, publish, distribute, sublicense, and/or
>> + * sell copies of the Software, and to permit persons to whom the
>> + * Software is furnished to do so, subject to the following
>> + * conditions:
>> + *
>> + * The above copyright notice and this permission notice shall be
>> + * included in all copies or substantial portions of the Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
>> + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
>> + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
>> + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>> + * OTHER DEALINGS IN THE SOFTWARE.
>> + */
> 
> We normally use spdx license tags in u-boot.

.dts files are imported from Linux, so neither the license text nor the
copyrights should be changed. The kernel file does not have the > bug,
so there's rather a workflow problem here...

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm/boot/dts/armada-385-turris-omnia.dts

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] marvell: armada385: Add the Turris Omnia board

2017-05-28 Thread Pavel Machek
Hi!


> Signed-off-by: Marek Behun 
> ---
>  arch/arm/dts/armada-385-turris-omnia.dts | 428 
> +++
>  arch/arm/mach-mvebu/Kconfig  |   7 +
>  board/CZ.NIC/turris_omnia/Makefile   |   7 +
>  board/CZ.NIC/turris_omnia/kwbimage.cfg   |  12 +
>  board/CZ.NIC/turris_omnia/turris_omnia.c | 364 ++
>  configs/turris_omnia_defconfig   |  59 +
>  include/configs/turris_omnia.h   | 181 +
>  7 files changed, 1058 insertions(+)
>  create mode 100644 arch/arm/dts/armada-385-turris-omnia.dts
>  create mode 100644 board/CZ.NIC/turris_omnia/Makefile
>  create mode 100644 board/CZ.NIC/turris_omnia/kwbimage.cfg
>  create mode 100644 board/CZ.NIC/turris_omnia/turris_omnia.c

Should the path be .../cz.nic/... (lowercase)?

> +++ b/arch/arm/dts/armada-385-turris-omnia.dts
> @@ -0,0 +1,428 @@
> +/*
> + * Device Tree file for the Turris Omnia
> + *
> + * Copyright (C) 2014 Marvell
> + *
> + * Marek Behun  at end of line.

> + * Gregory CLEMENT 

And if you want to claim copyright, you should also specify years...

> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *
> + *  a) This file is licensed under the terms of the GNU General Public
> + * License version 2.  This program is licensed "as is" without
> + * any warranty of any kind, whether express or implied.
> + *
> + * Or, alternatively,
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + * obtaining a copy of this software and associated documentation
> + * files (the "Software"), to deal in the Software without
> + * restriction, including without limitation the rights to use,
> + * copy, modify, merge, publish, distribute, sublicense, and/or
> + * sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following
> + * conditions:
> + *
> + * The above copyright notice and this permission notice shall be
> + * included in all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + */

We normally use spdx license tags in u-boot.
Pavel
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] marvell: armada385: Add the Turris Omnia board

2017-05-18 Thread Stefan Roese

Hi Marek,

On 13.05.2017 11:54, Andreas Färber wrote:




+/* Default boot environment. */
+#define CONFIG_BOOTCOMMAND \
+   "i2c dev 1; " \
+   "i2c read 0x2a 0x9 1 0x00F0; "\
+   "setexpr.b rescue *0x00F0; "  \
+   "if test $rescue -ge 1; then "\
+   "echo BOOT RESCUE; "  \
+   "run rescueboot; "\
+   "else "   \
+   "echo BOOT eMMC FS; " \
+   "run mmcboot; "   \
+   "fi"
+
+/* Keep device tree and initrd in lower memory so the kernel can access them */
+#define CONFIG_EXTRA_ENV_SETTINGS  \
+   "fdt_high=0x1000\0"   \
+   "initrd_high=0x1000\0"\
+   "ethact=neta2\0"  \
+   "mmcboot=setenv bootargs \"$bootargs cfg80211.freg=$regdomain\"; " \
+   "ext4load mmc 0 0x0100 boot/zImage; " \
+   "ext4load mmc 0 0x0200 boot/dtb; " \
+   "bootz 0x0100 - 0x0200\0" \
+   "rescueboot=i2c mw 0x2a.1 0x3 0x1c 1; " \
+   "i2c mw 0x2a.1 0x4 0x1c 1; " \
+   "mw.l 0x0100 0x00ff000c; " \
+   "i2c write 0x0100 0x2a.1 0x5 4 -s; " \
+   "setenv bootargs \"$bootargs omniarescue=$rescue\"; " \
+   "sf probe; " \
+   "sf read 0x100 0x10 0x70; " \
+   "bootz 0x100\0" \
+   "bootargs=earlyprintk console=ttyS0,115200 rootfstype=ext4 " \
+   "rootdelay=2 root=b301 rootflags=subvol=@,commit=5 rw\0"


These env settings are very old-style. Please use the distro macros.
That means among others defining kernel_addr_r=0x0100,
fdt_addr_r=0x0200 and ramdisk_addr_r and use the standardized boot
commands instead of hardcoding mmcboot here. Then also USB, mSATA and
network boot should be supported, and it abstracts the filesystem, plus
it adds UEFI support.

Selecting the distro defaults from the defconfig should also obsolete
requiring ext4 in this config, among others.


Apart from addressing all other comments from Andreas, yes please
switch to using the distro defaults and configurations. Take
a look at this patch from Patrick, this should give you an idea:

https://patchwork.ozlabs.org/patch/760587/

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


Re: [U-Boot] [PATCH 3/3] marvell: armada385: Add the Turris Omnia board

2017-05-13 Thread Andreas Färber
Hi Marek,

Thanks for working on this.

Am 12.05.2017 um 16:10 schrieb Marek Behún:
> The Turris Omnia is a open-source router created by CZ.NIC.
> 
> The code is based on the Marvell/db-88f6820-gp by Stefan Roese
> with modifications from Tomas Hlavacek in the CZ.NIC turris-omnia-uboot
> repository, which can be found at
> https://gitlab.labs.nic.cz/turris/turris-omnia-uboot
> 
> The code does not yet support reading the ATSHA204 cryptochip, which
> stores the serial number of the device, as well as the base MAC
> address.
> 
> Also, the device does by default use btrfs as the main filesystem, on
> which kernel and device tree is stored. U-Boot does not yes support

"not yet"

> btrfs, thus the configuration header defaults to ext4.
> 

Given the above history remarks, shouldn't there also be a Signed-off-by
from Tomas before yours?

> Signed-off-by: Marek Behun 
> ---
>  arch/arm/dts/armada-385-turris-omnia.dts | 428 
> +++

Please indicate in the commit message where exactly this file comes from
- tree and tag/commit. Were any changes done compared to mainline Linux?

>  arch/arm/mach-mvebu/Kconfig  |   7 +
>  board/CZ.NIC/turris_omnia/Makefile   |   7 +
>  board/CZ.NIC/turris_omnia/kwbimage.cfg   |  12 +
>  board/CZ.NIC/turris_omnia/turris_omnia.c | 364 ++
>  configs/turris_omnia_defconfig   |  59 +
>  include/configs/turris_omnia.h   | 181 +
>  7 files changed, 1058 insertions(+)
>  create mode 100644 arch/arm/dts/armada-385-turris-omnia.dts
>  create mode 100644 board/CZ.NIC/turris_omnia/Makefile
>  create mode 100644 board/CZ.NIC/turris_omnia/kwbimage.cfg
>  create mode 100644 board/CZ.NIC/turris_omnia/turris_omnia.c
>  create mode 100644 configs/turris_omnia_defconfig
>  create mode 100644 include/configs/turris_omnia.h
> 
> diff --git a/arch/arm/dts/armada-385-turris-omnia.dts 
> b/arch/arm/dts/armada-385-turris-omnia.dts
> new file mode 100644
> index 000..369b69a
> --- /dev/null
> +++ b/arch/arm/dts/armada-385-turris-omnia.dts
> @@ -0,0 +1,428 @@
> +/*
> + * Device Tree file for the Turris Omnia
> + *
> + * Copyright (C) 2014 Marvell
> + *
> + * Marek Behun  + * Gregory CLEMENT 
[...]
> diff --git a/include/configs/turris_omnia.h b/include/configs/turris_omnia.h
> new file mode 100644
> index 000..0c7960d
> --- /dev/null
> +++ b/include/configs/turris_omnia.h
> @@ -0,0 +1,181 @@
> +/*
> + * Copyright (C) 2017 Marek Behun 
> + * Copyright (C) 2016 Tomas Hlavacek 
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +#ifndef _CONFIG_TURRIS_OMNIA_H
> +#define _CONFIG_TURRIS_OMNIA_H
> +
> +/*
> + * High Level Configuration Options (easy to change)
> + */
> +
> +#define CONFIG_DISPLAY_BOARDINFO_LATE
> +#define CONFIG_LIB_RAND
> +#define CONFIG_NET_RANDOM_ETHADDR
> +#define CONFIG_CMD_EXT4
> +
> +/*
> + * TEXT_BASE needs to be below 16MiB, since this area is scrubbed
> + * for DDR ECC byte filling in the SPL before loading the main
> + * U-Boot into it.
> + */
> +#define  CONFIG_SYS_TEXT_BASE0x0080
> +#define CONFIG_SYS_TCLK  25000   /* 250MHz */
> +
> +/*
> + * Commands configuration
> + */
> +#define CONFIG_CMD_ENV
> +#define CONFIG_CMD_PCI
> +#define CONFIG_SCSI
> +
> +/* RAW initrd support */
> +#define CONFIG_SUPPORT_RAW_INITRD
> +
> +/*#define CONFIG_ATSHA204
> +#define CONFIG_ATSHA204_ADDR 0x64*/

The address shouldn't hurt to define, but please drop the commented-out
not-yet-upstream define. Chances are, as a new driver, it should go into
the Kconfig.

> +
> +/* I2C */
> +#define CONFIG_DM_I2C
> +#define CONFIG_SYS_I2C_MVTWSI
> +
> +/* Watchdog */
> +#ifndef CONFIG_SPL_BUILD
> +#define CONFIG_HW_WATCHDOG
> +#define CONFIG_ORION_WATCHDOG
> +#endif
> +
> +/* SPI NOR flash default params, used by sf commands */
> +#define CONFIG_SF_DEFAULT_SPEED  100
> +#define CONFIG_SF_DEFAULT_MODE   SPI_MODE_3
> +#define CONFIG_SPI_FLASH_SPANSION
> +
> +/*
> + * SDIO/MMC Card Configuration
> + */
> +#define CONFIG_SYS_MMC_BASE  MVEBU_SDIO_BASE
> +
> +/*
> + * SATA/SCSI/AHCI configuration
> + */
> +#define CONFIG_LIBATA
> +#define CONFIG_SCSI_AHCI
> +#define CONFIG_SCSI_AHCI_PLAT
> +#define CONFIG_SYS_SCSI_MAX_SCSI_ID  2
> +#define CONFIG_SYS_SCSI_MAX_LUN  1
> +#define CONFIG_SYS_SCSI_MAX_DEVICE   (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
> +  CONFIG_SYS_SCSI_MAX_LUN)
> +
> +/* Partition support */
> +
> +/* Additional FS support/configuration */
> +#define CONFIG_SUPPORT_VFAT
> +
> +/* USB/EHCI configuration */
> +#define CONFIG_EHCI_IS_TDI
> +
> +/* Environment in SPI NOR flash */
> +#define CONFIG_ENV_IS_IN_SPI_FLASH
> +#define CONFIG_ENV_OFFSET(3*(1 << 18)) /* 768KiB in */
> +#define CONFIG_ENV_SIZE  (64 << 10)