Re: [PATCH 12/12] arm: boards: add virt board

2016-06-07 Thread Raphaël Poggi
2016-06-07 14:59 GMT+02:00 Antony Pavlov :
> On Tue, 7 Jun 2016 13:53:49 +0200
> Raphaël Poggi  wrote:
>
>> 2016-06-07 13:00 GMT+02:00 Antony Pavlov :
>> > On Thu,  2 Jun 2016 10:06:58 +0200
>> > Raphael Poggi  wrote:
>> >
>> >> Add qemu virt board which emulates arm64 board.
>> >>
>> >> Signed-off-by: Raphael Poggi 
>> >> ---
>> >>  arch/arm/Kconfig   |  9 
>> >>  arch/arm/boards/Makefile   |  1 +
>> >>  arch/arm/boards/virt/Kconfig   |  8 
>> >
>> > Can we use a more descriptive 'qemu-virt' name for this machine/board 
>> > instead of 'virt'?
>>
>> Qemu virt machine support armv7 and armv8 cpu, maybe we can use the
>> name "mach-qemu" for the machine and "qemu-virt64" for the board.
>>
>> With this approach we use a generic name for the machine (since qemu
>> virt machine support armv7/armv8, we do not need to distinguish
>> between arm/arm64),
>> and made the distinction arm/arm64 only in board name.
>>
>> This also lets the possibility, for someone who wants to add support
>> for qemu virt arm32 board, to not create another machine folder.
>>
>> What do you think about that ?
>
> So you are proposing to introduce these directories:
>
>   arch/arm/boards/qemu-virt64/
>   arch/arm/mach-qemu/

Yes, exactly.

>
> I propose to use 'arch/arm/mach-qemu-virt' for machine dir,
> because qemu supports several arm-based machines, not only the virt machine.
>
> On the other hand the 'mach-qemu-virt' name is too long
> and 'mach-qemu' may be is a better solution.

"mach-qemu-virt" seems too long.

Another proposition:  we can choose "mach-qemu", and to distinguish
qemu machine use the same way as mach-at91, ie:

arch/arm/mach-qemu/
  --> virt_devices.c
  --> virt_lowlevel.c
  --> etc...

This also implies to add some Kconfig entries to handle the multiple
qemu machines.

>
>
>> >
>> >>  arch/arm/boards/virt/Makefile  |  1 +
>> >>  arch/arm/boards/virt/env/bin/_update   | 36 
>> >>  arch/arm/boards/virt/env/bin/boot  | 38 +
>> >
>> > ... skipped ...
>> >
>> > --
>> > Best regards,
>> >   Antony Pavlov
>> >
>> > ___
>> > barebox mailing list
>> > barebox@lists.infradead.org
>> > http://lists.infradead.org/mailman/listinfo/barebox
>
>
> --
> --
> Best regards,
>   Antony Pavlov
>
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 12/12] arm: boards: add virt board

2016-06-07 Thread Antony Pavlov
On Tue, 7 Jun 2016 13:53:49 +0200
Raphaël Poggi  wrote:

> 2016-06-07 13:00 GMT+02:00 Antony Pavlov :
> > On Thu,  2 Jun 2016 10:06:58 +0200
> > Raphael Poggi  wrote:
> >
> >> Add qemu virt board which emulates arm64 board.
> >>
> >> Signed-off-by: Raphael Poggi 
> >> ---
> >>  arch/arm/Kconfig   |  9 
> >>  arch/arm/boards/Makefile   |  1 +
> >>  arch/arm/boards/virt/Kconfig   |  8 
> >
> > Can we use a more descriptive 'qemu-virt' name for this machine/board 
> > instead of 'virt'?
> 
> Qemu virt machine support armv7 and armv8 cpu, maybe we can use the
> name "mach-qemu" for the machine and "qemu-virt64" for the board.
> 
> With this approach we use a generic name for the machine (since qemu
> virt machine support armv7/armv8, we do not need to distinguish
> between arm/arm64),
> and made the distinction arm/arm64 only in board name.
> 
> This also lets the possibility, for someone who wants to add support
> for qemu virt arm32 board, to not create another machine folder.
> 
> What do you think about that ?

So you are proposing to introduce these directories:

  arch/arm/boards/qemu-virt64/
  arch/arm/mach-qemu/

I propose to use 'arch/arm/mach-qemu-virt' for machine dir,
because qemu supports several arm-based machines, not only the virt machine.

On the other hand the 'mach-qemu-virt' name is too long
and 'mach-qemu' may be is a better solution.


> >
> >>  arch/arm/boards/virt/Makefile  |  1 +
> >>  arch/arm/boards/virt/env/bin/_update   | 36 
> >>  arch/arm/boards/virt/env/bin/boot  | 38 +
> >
> > ... skipped ...
> >
> > --
> > Best regards,
> >   Antony Pavlov
> >
> > ___
> > barebox mailing list
> > barebox@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox


-- 
-- 
Best regards,
  Antony Pavlov

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 12/12] arm: boards: add virt board

2016-06-07 Thread Raphaël Poggi
2016-06-07 13:00 GMT+02:00 Antony Pavlov :
> On Thu,  2 Jun 2016 10:06:58 +0200
> Raphael Poggi  wrote:
>
>> Add qemu virt board which emulates arm64 board.
>>
>> Signed-off-by: Raphael Poggi 
>> ---
>>  arch/arm/Kconfig   |  9 
>>  arch/arm/boards/Makefile   |  1 +
>>  arch/arm/boards/virt/Kconfig   |  8 
>
> Can we use a more descriptive 'qemu-virt' name for this machine/board instead 
> of 'virt'?

Qemu virt machine support armv7 and armv8 cpu, maybe we can use the
name "mach-qemu" for the machine and "qemu-virt64" for the board.

With this approach we use a generic name for the machine (since qemu
virt machine support armv7/armv8, we do not need to distinguish
between arm/arm64),
and made the distinction arm/arm64 only in board name.

This also lets the possibility, for someone who wants to add support
for qemu virt arm32 board, to not create another machine folder.

What do you think about that ?

Raphaël

>
>>  arch/arm/boards/virt/Makefile  |  1 +
>>  arch/arm/boards/virt/env/bin/_update   | 36 
>>  arch/arm/boards/virt/env/bin/boot  | 38 +
>
> ... skipped ...
>
> --
> Best regards,
>   Antony Pavlov
>
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 12/12] arm: boards: add virt board

2016-06-07 Thread Antony Pavlov
On Thu,  2 Jun 2016 10:06:58 +0200
Raphael Poggi  wrote:

> Add qemu virt board which emulates arm64 board.
> 
> Signed-off-by: Raphael Poggi 
> ---
>  arch/arm/Kconfig   |  9 
>  arch/arm/boards/Makefile   |  1 +
>  arch/arm/boards/virt/Kconfig   |  8 

Can we use a more descriptive 'qemu-virt' name for this machine/board instead 
of 'virt'?

>  arch/arm/boards/virt/Makefile  |  1 +
>  arch/arm/boards/virt/env/bin/_update   | 36 
>  arch/arm/boards/virt/env/bin/boot  | 38 +

... skipped ...

-- 
Best regards,
  Antony Pavlov

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 12/12] arm: boards: add virt board

2016-06-07 Thread Raphaël Poggi
Hi,

2016-06-03 10:50 GMT+02:00 Sascha Hauer :
> On Thu, Jun 02, 2016 at 10:06:58AM +0200, Raphael Poggi wrote:
>> Add qemu virt board which emulates arm64 board.
>>
>> Signed-off-by: Raphael Poggi 
>> ---
>>  arch/arm/Kconfig   |  9 
>>  arch/arm/boards/Makefile   |  1 +
>>  arch/arm/boards/virt/Kconfig   |  8 
>>  arch/arm/boards/virt/Makefile  |  1 +
>>  arch/arm/boards/virt/env/bin/_update   | 36 
>>  arch/arm/boards/virt/env/bin/boot  | 38 +
>>  arch/arm/boards/virt/env/bin/init  | 20 +
>>  arch/arm/boards/virt/env/bin/update_kernel |  8 
>>  arch/arm/boards/virt/env/bin/update_root   |  8 
>>  arch/arm/boards/virt/env/config| 38 +
>>  arch/arm/boards/virt/env/init/mtdparts-nor | 11 +
>>  arch/arm/boards/virt/init.c| 67 
>> ++
>>  arch/arm/configs/virt_defconfig| 55 
>>  arch/arm/mach-virt/Kconfig | 15 +++
>>  arch/arm/mach-virt/Makefile|  3 ++
>>  arch/arm/mach-virt/devices.c   | 30 +
>>  arch/arm/mach-virt/include/mach/debug_ll.h | 24 +++
>>  arch/arm/mach-virt/include/mach/devices.h  | 13 ++
>>  arch/arm/mach-virt/lowlevel.c  | 19 +
>>  arch/arm/mach-virt/reset.c | 24 +++
>>  20 files changed, 428 insertions(+)
>>  create mode 100644 arch/arm/boards/virt/Kconfig
>>  create mode 100644 arch/arm/boards/virt/Makefile
>>  create mode 100644 arch/arm/boards/virt/env/bin/_update
>>  create mode 100644 arch/arm/boards/virt/env/bin/boot
>>  create mode 100644 arch/arm/boards/virt/env/bin/init
>>  create mode 100644 arch/arm/boards/virt/env/bin/update_kernel
>>  create mode 100644 arch/arm/boards/virt/env/bin/update_root
>>  create mode 100644 arch/arm/boards/virt/env/config
>>  create mode 100644 arch/arm/boards/virt/env/init/mtdparts-nor
>>  create mode 100644 arch/arm/boards/virt/init.c
>>  create mode 100644 arch/arm/configs/virt_defconfig
>>  create mode 100644 arch/arm/mach-virt/Kconfig
>>  create mode 100644 arch/arm/mach-virt/Makefile
>>  create mode 100644 arch/arm/mach-virt/devices.c
>>  create mode 100644 arch/arm/mach-virt/include/mach/debug_ll.h
>>  create mode 100644 arch/arm/mach-virt/include/mach/devices.h
>>  create mode 100644 arch/arm/mach-virt/lowlevel.c
>>  create mode 100644 arch/arm/mach-virt/reset.c
>>
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index 986fdaa..71b90e7 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -255,6 +255,14 @@ config ARCH_ZYNQ
>>   bool "Xilinx Zynq-based boards"
>>   select HAS_DEBUG_LL
>>
>> +config ARCH_VIRT
>> + bool "ARM QEMU virt boards"
>> + select HAS_DEBUG_LL
>> + select CPU_V8
>> + select SYS_SUPPORTS_64BIT_KERNEL
>> + select ARM_AMBA
>> + select HAVE_CONFIGURABLE_MEMORY_LAYOUT
>
> This should have 64 somewhere in the name to distinguish between 64 and
> 32 bit qemu platforms.

Only in the Kconfig entry or also in the mach/board name (virt64 or
something like that) ?

>
>> +
>>  endchoice
>>
>>  source arch/arm/cpu/Kconfig
>> @@ -280,6 +288,7 @@ source arch/arm/mach-vexpress/Kconfig
>>  source arch/arm/mach-tegra/Kconfig
>>  source arch/arm/mach-uemd/Kconfig
>>  source arch/arm/mach-zynq/Kconfig
>> +source arch/arm/mach-virt/Kconfig
>>
>>  config ARM_ASM_UNIFIED
>>   bool
>> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
>> index 5a755c9..da0af74 100644
>> --- a/arch/arm/boards/Makefile
>> +++ b/arch/arm/boards/Makefile
>> @@ -134,3 +134,4 @@ obj-$(CONFIG_MACH_VIRT2REAL)  += 
>> virt2real/
>>  obj-$(CONFIG_MACH_ZEDBOARD)  += avnet-zedboard/
>>  obj-$(CONFIG_MACH_ZYLONITE)  += zylonite/
>>  obj-$(CONFIG_MACH_VARISCITE_MX6) += variscite-mx6/
>> +obj-$(CONFIG_MACH_VIRT)  += virt/
>> diff --git a/arch/arm/boards/virt/Kconfig b/arch/arm/boards/virt/Kconfig
>> new file mode 100644
>> index 000..b239127
>> --- /dev/null
>> +++ b/arch/arm/boards/virt/Kconfig
>> @@ -0,0 +1,8 @@
>> +
>> +if MACH_VIRT
>> +
>> +config ARCH_TEXT_BASE
>> + hex
>> + default 0x4000
>> +
>> +endif
>> diff --git a/arch/arm/boards/virt/Makefile b/arch/arm/boards/virt/Makefile
>> new file mode 100644
>> index 000..eb072c0
>> --- /dev/null
>> +++ b/arch/arm/boards/virt/Makefile
>> @@ -0,0 +1 @@
>> +obj-y += init.o
>> diff --git a/arch/arm/boards/virt/env/bin/_update 
>> b/arch/arm/boards/virt/env/bin/_update
>
> Please drop these environment files. New boards for sure should use
> defenv2 and normally for this you don't need any board specific
> environment files.
>
>> diff --git a/arch/arm/boards/virt/init.c b/arch/arm/boards/virt/init.c
>> new file mode 100644
>> index 000..9626067
>> --- /dev/null
>> +++ b/arch/arm/boards/virt/init.c
>> @

Re: [PATCH 12/12] arm: boards: add virt board

2016-06-03 Thread Sascha Hauer
On Thu, Jun 02, 2016 at 10:06:58AM +0200, Raphael Poggi wrote:
> Add qemu virt board which emulates arm64 board.
> 
> Signed-off-by: Raphael Poggi 
> ---
>  arch/arm/Kconfig   |  9 
>  arch/arm/boards/Makefile   |  1 +
>  arch/arm/boards/virt/Kconfig   |  8 
>  arch/arm/boards/virt/Makefile  |  1 +
>  arch/arm/boards/virt/env/bin/_update   | 36 
>  arch/arm/boards/virt/env/bin/boot  | 38 +
>  arch/arm/boards/virt/env/bin/init  | 20 +
>  arch/arm/boards/virt/env/bin/update_kernel |  8 
>  arch/arm/boards/virt/env/bin/update_root   |  8 
>  arch/arm/boards/virt/env/config| 38 +
>  arch/arm/boards/virt/env/init/mtdparts-nor | 11 +
>  arch/arm/boards/virt/init.c| 67 
> ++
>  arch/arm/configs/virt_defconfig| 55 
>  arch/arm/mach-virt/Kconfig | 15 +++
>  arch/arm/mach-virt/Makefile|  3 ++
>  arch/arm/mach-virt/devices.c   | 30 +
>  arch/arm/mach-virt/include/mach/debug_ll.h | 24 +++
>  arch/arm/mach-virt/include/mach/devices.h  | 13 ++
>  arch/arm/mach-virt/lowlevel.c  | 19 +
>  arch/arm/mach-virt/reset.c | 24 +++
>  20 files changed, 428 insertions(+)
>  create mode 100644 arch/arm/boards/virt/Kconfig
>  create mode 100644 arch/arm/boards/virt/Makefile
>  create mode 100644 arch/arm/boards/virt/env/bin/_update
>  create mode 100644 arch/arm/boards/virt/env/bin/boot
>  create mode 100644 arch/arm/boards/virt/env/bin/init
>  create mode 100644 arch/arm/boards/virt/env/bin/update_kernel
>  create mode 100644 arch/arm/boards/virt/env/bin/update_root
>  create mode 100644 arch/arm/boards/virt/env/config
>  create mode 100644 arch/arm/boards/virt/env/init/mtdparts-nor
>  create mode 100644 arch/arm/boards/virt/init.c
>  create mode 100644 arch/arm/configs/virt_defconfig
>  create mode 100644 arch/arm/mach-virt/Kconfig
>  create mode 100644 arch/arm/mach-virt/Makefile
>  create mode 100644 arch/arm/mach-virt/devices.c
>  create mode 100644 arch/arm/mach-virt/include/mach/debug_ll.h
>  create mode 100644 arch/arm/mach-virt/include/mach/devices.h
>  create mode 100644 arch/arm/mach-virt/lowlevel.c
>  create mode 100644 arch/arm/mach-virt/reset.c
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 986fdaa..71b90e7 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -255,6 +255,14 @@ config ARCH_ZYNQ
>   bool "Xilinx Zynq-based boards"
>   select HAS_DEBUG_LL
>  
> +config ARCH_VIRT
> + bool "ARM QEMU virt boards"
> + select HAS_DEBUG_LL
> + select CPU_V8
> + select SYS_SUPPORTS_64BIT_KERNEL
> + select ARM_AMBA
> + select HAVE_CONFIGURABLE_MEMORY_LAYOUT

This should have 64 somewhere in the name to distinguish between 64 and
32 bit qemu platforms.

> +
>  endchoice
>  
>  source arch/arm/cpu/Kconfig
> @@ -280,6 +288,7 @@ source arch/arm/mach-vexpress/Kconfig
>  source arch/arm/mach-tegra/Kconfig
>  source arch/arm/mach-uemd/Kconfig
>  source arch/arm/mach-zynq/Kconfig
> +source arch/arm/mach-virt/Kconfig
>  
>  config ARM_ASM_UNIFIED
>   bool
> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> index 5a755c9..da0af74 100644
> --- a/arch/arm/boards/Makefile
> +++ b/arch/arm/boards/Makefile
> @@ -134,3 +134,4 @@ obj-$(CONFIG_MACH_VIRT2REAL)  += 
> virt2real/
>  obj-$(CONFIG_MACH_ZEDBOARD)  += avnet-zedboard/
>  obj-$(CONFIG_MACH_ZYLONITE)  += zylonite/
>  obj-$(CONFIG_MACH_VARISCITE_MX6) += variscite-mx6/
> +obj-$(CONFIG_MACH_VIRT)  += virt/
> diff --git a/arch/arm/boards/virt/Kconfig b/arch/arm/boards/virt/Kconfig
> new file mode 100644
> index 000..b239127
> --- /dev/null
> +++ b/arch/arm/boards/virt/Kconfig
> @@ -0,0 +1,8 @@
> +
> +if MACH_VIRT
> +
> +config ARCH_TEXT_BASE
> + hex
> + default 0x4000
> +
> +endif
> diff --git a/arch/arm/boards/virt/Makefile b/arch/arm/boards/virt/Makefile
> new file mode 100644
> index 000..eb072c0
> --- /dev/null
> +++ b/arch/arm/boards/virt/Makefile
> @@ -0,0 +1 @@
> +obj-y += init.o
> diff --git a/arch/arm/boards/virt/env/bin/_update 
> b/arch/arm/boards/virt/env/bin/_update

Please drop these environment files. New boards for sure should use
defenv2 and normally for this you don't need any board specific
environment files.

> diff --git a/arch/arm/boards/virt/init.c b/arch/arm/boards/virt/init.c
> new file mode 100644
> index 000..9626067
> --- /dev/null
> +++ b/arch/arm/boards/virt/init.c
> @@ -0,0 +1,67 @@
> +/*
> + * Copyright (C) 2016 Raphaël Poggi 
> + *
> + * GPLv2 only
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +static int virt_mem_init(v