All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] baremetal-helloworld: Enable RISC-V 64 port
@ 2021-05-11  5:31 Alejandro Hernandez Samaniego
  2021-05-11  5:58 ` [OE-core] " Alistair Francis
  2021-05-13  0:07 ` Alistair Francis
  0 siblings, 2 replies; 4+ messages in thread
From: Alejandro Hernandez Samaniego @ 2021-05-11  5:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alejandro Enedino Hernandez Samaniego

Add support for MACHINE=qemuriscv64.

$ runqemu nographic

KERNEL: [tmp/deploy/images/qemuriscv64/baremetal-helloworld-image-qemuriscv64.bin]
MACHINE: [qemuriscv64]
FSTYPE: [bin]

runqemu - INFO - Running tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-riscv64

Hello OpenEmbedded on RISC-V 64!

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
---
 .../baremetal-examples/baremetal-helloworld_git.bb |  5 +++--
 meta/classes/baremetal-image.bbclass               | 14 +++++++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb b/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
index ee945c1ff0..19ef16988f 100644
--- a/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
+++ b/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
@@ -4,7 +4,7 @@ DESCRIPTION = "These are introductory examples to showcase the use of QEMU to ru
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449"
 
-SRCREV = "99f4fa4a3b266b42b52af302610b0f4f429ba5e3"
+SRCREV = "0bf9ea216e6f76be50726a3a74e527b7bbb0ad93"
 PV = "0.1+git${SRCPV}"
 
 SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master"
@@ -28,12 +28,13 @@ inherit baremetal-image
 # machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57
 # but the examples can also be run on other architectures/machines
 # such as vexpress-a15 by overriding the setting on the machine.conf
-COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64"
+COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64"
 
 BAREMETAL_QEMUARCH ?= ""
 BAREMETAL_QEMUARCH_qemuarmv5 = "versatile"
 BAREMETAL_QEMUARCH_qemuarm = "arm"
 BAREMETAL_QEMUARCH_qemuarm64 = "aarch64"
+BAREMETAL_QEMUARCH_qemuriscv64 = "riscv64"
 
 EXTRA_OEMAKE_append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1"
 
diff --git a/meta/classes/baremetal-image.bbclass b/meta/classes/baremetal-image.bbclass
index b0f5e885b5..319b61c7cd 100644
--- a/meta/classes/baremetal-image.bbclass
+++ b/meta/classes/baremetal-image.bbclass
@@ -73,7 +73,19 @@ QB_DEFAULT_KERNEL ?= "${IMAGE_LINK_NAME}.bin"
 QB_MEM ?= "-m 256"
 QB_DEFAULT_FSTYPE ?= "bin"
 QB_DTB ?= ""
-QB_OPT_APPEND = "-nographic"
+QB_OPT_APPEND_append = " -nographic"
+
+# RISC-V tunes set the BIOS, unset, and instruct QEMU to
+# ignore the BIOS and boot from -kernel
+QB_DEFAULT_BIOS_qemuriscv64 = ""
+QB_OPT_APPEND_append_qemuriscv64 = " -bios none"
+
+
+# Use the medium-any code model for the RISC-V 64 bit implementation,
+# since medlow can only access addresses below 0x80000000 and RAM
+# starts at 0x80000000 on RISC-V 64
+CFLAGS_append_qemuriscv64 = " -mcmodel=medany"
+
 
 # This next part is necessary to trick the build system into thinking
 # its building an image recipe so it generates the qemuboot.conf
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH v2] baremetal-helloworld: Enable RISC-V 64 port
  2021-05-11  5:31 [PATCH v2] baremetal-helloworld: Enable RISC-V 64 port Alejandro Hernandez Samaniego
@ 2021-05-11  5:58 ` Alistair Francis
  2021-05-11  6:08   ` Alejandro Hernandez Samaniego
  2021-05-13  0:07 ` Alistair Francis
  1 sibling, 1 reply; 4+ messages in thread
From: Alistair Francis @ 2021-05-11  5:58 UTC (permalink / raw)
  To: Alejandro Hernandez Samaniego; +Cc: OE-core

On Tue, May 11, 2021 at 3:31 PM Alejandro Hernandez Samaniego
<alejandro@enedino.org> wrote:
>
> Add support for MACHINE=qemuriscv64.
>
> $ runqemu nographic
>
> KERNEL: [tmp/deploy/images/qemuriscv64/baremetal-helloworld-image-qemuriscv64.bin]
> MACHINE: [qemuriscv64]
> FSTYPE: [bin]
>
> runqemu - INFO - Running tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-riscv64
>
> Hello OpenEmbedded on RISC-V 64!
>
> Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
> ---
>  .../baremetal-examples/baremetal-helloworld_git.bb |  5 +++--
>  meta/classes/baremetal-image.bbclass               | 14 +++++++++++++-
>  2 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb b/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
> index ee945c1ff0..19ef16988f 100644
> --- a/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
> +++ b/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
> @@ -4,7 +4,7 @@ DESCRIPTION = "These are introductory examples to showcase the use of QEMU to ru
>  LICENSE = "MIT"
>  LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449"
>
> -SRCREV = "99f4fa4a3b266b42b52af302610b0f4f429ba5e3"
> +SRCREV = "0bf9ea216e6f76be50726a3a74e527b7bbb0ad93"
>  PV = "0.1+git${SRCPV}"
>
>  SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master"
> @@ -28,12 +28,13 @@ inherit baremetal-image
>  # machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57
>  # but the examples can also be run on other architectures/machines
>  # such as vexpress-a15 by overriding the setting on the machine.conf
> -COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64"
> +COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64"
>
>  BAREMETAL_QEMUARCH ?= ""
>  BAREMETAL_QEMUARCH_qemuarmv5 = "versatile"
>  BAREMETAL_QEMUARCH_qemuarm = "arm"
>  BAREMETAL_QEMUARCH_qemuarm64 = "aarch64"
> +BAREMETAL_QEMUARCH_qemuriscv64 = "riscv64"
>
>  EXTRA_OEMAKE_append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1"
>
> diff --git a/meta/classes/baremetal-image.bbclass b/meta/classes/baremetal-image.bbclass
> index b0f5e885b5..319b61c7cd 100644
> --- a/meta/classes/baremetal-image.bbclass
> +++ b/meta/classes/baremetal-image.bbclass
> @@ -73,7 +73,19 @@ QB_DEFAULT_KERNEL ?= "${IMAGE_LINK_NAME}.bin"
>  QB_MEM ?= "-m 256"
>  QB_DEFAULT_FSTYPE ?= "bin"
>  QB_DTB ?= ""
> -QB_OPT_APPEND = "-nographic"
> +QB_OPT_APPEND_append = " -nographic"
> +
> +# RISC-V tunes set the BIOS, unset, and instruct QEMU to
> +# ignore the BIOS and boot from -kernel
> +QB_DEFAULT_BIOS_qemuriscv64 = ""
> +QB_OPT_APPEND_append_qemuriscv64 = " -bios none"

Sorry, I forgot to reply to the other thread.

Can't you just set QB_DEFAULT_BIOS to "none"?

Alistair

> +
> +
> +# Use the medium-any code model for the RISC-V 64 bit implementation,
> +# since medlow can only access addresses below 0x80000000 and RAM
> +# starts at 0x80000000 on RISC-V 64
> +CFLAGS_append_qemuriscv64 = " -mcmodel=medany"
> +
>
>  # This next part is necessary to trick the build system into thinking
>  # its building an image recipe so it generates the qemuboot.conf
> --
> 2.25.1
>
>
> 
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH v2] baremetal-helloworld: Enable RISC-V 64 port
  2021-05-11  5:58 ` [OE-core] " Alistair Francis
@ 2021-05-11  6:08   ` Alejandro Hernandez Samaniego
  0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Hernandez Samaniego @ 2021-05-11  6:08 UTC (permalink / raw)
  To: Alistair Francis; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 3914 bytes --]

On Mon, May 10, 2021, 11:59 PM Alistair Francis <alistair23@gmail.com>
wrote:

> On Tue, May 11, 2021 at 3:31 PM Alejandro Hernandez Samaniego
> <alejandro@enedino.org> wrote:
> >
> > Add support for MACHINE=qemuriscv64.
> >
> > $ runqemu nographic
> >
> > KERNEL:
> [tmp/deploy/images/qemuriscv64/baremetal-helloworld-image-qemuriscv64.bin]
> > MACHINE: [qemuriscv64]
> > FSTYPE: [bin]
> >

> runqemu - INFO - Running
> tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-riscv64
> >
> > Hello OpenEmbedded on RISC-V 64!
> >
> > Signed-off-by: Alejandro Enedino Hernandez Samaniego <
> alejandro@enedino.org>
> > ---
> >  .../baremetal-examples/baremetal-helloworld_git.bb |  5 +++--
> >  meta/classes/baremetal-image.bbclass               | 14 +++++++++++++-
> >  2 files changed, 16 insertions(+), 3 deletions(-)
> >
> > diff --git a/meta-skeleton/recipes-baremetal/baremetal-examples/
> baremetal-helloworld_git.bb
> b/meta-skeleton/recipes-baremetal/baremetal-examples/
> baremetal-helloworld_git.bb
> > index ee945c1ff0..19ef16988f 100644
> > --- a/meta-skeleton/recipes-baremetal/baremetal-examples/
> baremetal-helloworld_git.bb
> > +++ b/meta-skeleton/recipes-baremetal/baremetal-examples/
> baremetal-helloworld_git.bb
> > @@ -4,7 +4,7 @@ DESCRIPTION = "These are introductory examples to
> showcase the use of QEMU to ru
> >  LICENSE = "MIT"
> >  LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449"
> >
> > -SRCREV = "99f4fa4a3b266b42b52af302610b0f4f429ba5e3"
> > +SRCREV = "0bf9ea216e6f76be50726a3a74e527b7bbb0ad93"
> >  PV = "0.1+git${SRCPV}"
> >
> >  SRC_URI = "git://
> github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master"
> > @@ -28,12 +28,13 @@ inherit baremetal-image
> >  # machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57
> >  # but the examples can also be run on other architectures/machines
> >  # such as vexpress-a15 by overriding the setting on the machine.conf
> > -COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64"
> > +COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64"
> >
> >  BAREMETAL_QEMUARCH ?= ""
> >  BAREMETAL_QEMUARCH_qemuarmv5 = "versatile"
> >  BAREMETAL_QEMUARCH_qemuarm = "arm"
> >  BAREMETAL_QEMUARCH_qemuarm64 = "aarch64"
> > +BAREMETAL_QEMUARCH_qemuriscv64 = "riscv64"
> >
> >  EXTRA_OEMAKE_append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1"
> >
> > diff --git a/meta/classes/baremetal-image.bbclass
> b/meta/classes/baremetal-image.bbclass
> > index b0f5e885b5..319b61c7cd 100644
> > --- a/meta/classes/baremetal-image.bbclass
> > +++ b/meta/classes/baremetal-image.bbclass
> > @@ -73,7 +73,19 @@ QB_DEFAULT_KERNEL ?= "${IMAGE_LINK_NAME}.bin"
> >  QB_MEM ?= "-m 256"
> >  QB_DEFAULT_FSTYPE ?= "bin"
> >  QB_DTB ?= ""
> > -QB_OPT_APPEND = "-nographic"
> > +QB_OPT_APPEND_append = " -nographic"
> > +
> > +# RISC-V tunes set the BIOS, unset, and instruct QEMU to
> > +# ignore the BIOS and boot from -kernel
> > +QB_DEFAULT_BIOS_qemuriscv64 = ""
> > +QB_OPT_APPEND_append_qemuriscv64 = " -bios none"
>
> Sorry, I forgot to reply to the other thread.
>
> Can't you just set QB_DEFAULT_BIOS to "none"?
>
> Alistair


> > +


No problem, and nope, runqemu will behave the same way (doesn't pass -bios
at all) if QB_DEFAULT_BIOS is either set to an empty string or "none" which
means passing QB_OPT_APPEND is still required

> +
> > +# Use the medium-any code model for the RISC-V 64 bit implementation,
> > +# since medlow can only access addresses below 0x80000000 and RAM
> > +# starts at 0x80000000 on RISC-V 64
> > +CFLAGS_append_qemuriscv64 = " -mcmodel=medany"
> > +
> >
> >  # This next part is necessary to trick the build system into thinking
> >  # its building an image recipe so it generates the qemuboot.conf
> > --
> > 2.25.1
> >
> >
> > 
> >
>

[-- Attachment #2: Type: text/html, Size: 6278 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH v2] baremetal-helloworld: Enable RISC-V 64 port
  2021-05-11  5:31 [PATCH v2] baremetal-helloworld: Enable RISC-V 64 port Alejandro Hernandez Samaniego
  2021-05-11  5:58 ` [OE-core] " Alistair Francis
@ 2021-05-13  0:07 ` Alistair Francis
  1 sibling, 0 replies; 4+ messages in thread
From: Alistair Francis @ 2021-05-13  0:07 UTC (permalink / raw)
  To: Alejandro Hernandez Samaniego; +Cc: OE-core

On Tue, May 11, 2021 at 3:31 PM Alejandro Hernandez Samaniego
<alejandro@enedino.org> wrote:
>
> Add support for MACHINE=qemuriscv64.
>
> $ runqemu nographic
>
> KERNEL: [tmp/deploy/images/qemuriscv64/baremetal-helloworld-image-qemuriscv64.bin]
> MACHINE: [qemuriscv64]
> FSTYPE: [bin]
>
> runqemu - INFO - Running tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-riscv64
>
> Hello OpenEmbedded on RISC-V 64!
>
> Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  .../baremetal-examples/baremetal-helloworld_git.bb |  5 +++--
>  meta/classes/baremetal-image.bbclass               | 14 +++++++++++++-
>  2 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb b/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
> index ee945c1ff0..19ef16988f 100644
> --- a/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
> +++ b/meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb
> @@ -4,7 +4,7 @@ DESCRIPTION = "These are introductory examples to showcase the use of QEMU to ru
>  LICENSE = "MIT"
>  LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449"
>
> -SRCREV = "99f4fa4a3b266b42b52af302610b0f4f429ba5e3"
> +SRCREV = "0bf9ea216e6f76be50726a3a74e527b7bbb0ad93"
>  PV = "0.1+git${SRCPV}"
>
>  SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master"
> @@ -28,12 +28,13 @@ inherit baremetal-image
>  # machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57
>  # but the examples can also be run on other architectures/machines
>  # such as vexpress-a15 by overriding the setting on the machine.conf
> -COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64"
> +COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64"
>
>  BAREMETAL_QEMUARCH ?= ""
>  BAREMETAL_QEMUARCH_qemuarmv5 = "versatile"
>  BAREMETAL_QEMUARCH_qemuarm = "arm"
>  BAREMETAL_QEMUARCH_qemuarm64 = "aarch64"
> +BAREMETAL_QEMUARCH_qemuriscv64 = "riscv64"
>
>  EXTRA_OEMAKE_append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1"
>
> diff --git a/meta/classes/baremetal-image.bbclass b/meta/classes/baremetal-image.bbclass
> index b0f5e885b5..319b61c7cd 100644
> --- a/meta/classes/baremetal-image.bbclass
> +++ b/meta/classes/baremetal-image.bbclass
> @@ -73,7 +73,19 @@ QB_DEFAULT_KERNEL ?= "${IMAGE_LINK_NAME}.bin"
>  QB_MEM ?= "-m 256"
>  QB_DEFAULT_FSTYPE ?= "bin"
>  QB_DTB ?= ""
> -QB_OPT_APPEND = "-nographic"
> +QB_OPT_APPEND_append = " -nographic"
> +
> +# RISC-V tunes set the BIOS, unset, and instruct QEMU to
> +# ignore the BIOS and boot from -kernel
> +QB_DEFAULT_BIOS_qemuriscv64 = ""
> +QB_OPT_APPEND_append_qemuriscv64 = " -bios none"
> +
> +
> +# Use the medium-any code model for the RISC-V 64 bit implementation,
> +# since medlow can only access addresses below 0x80000000 and RAM
> +# starts at 0x80000000 on RISC-V 64
> +CFLAGS_append_qemuriscv64 = " -mcmodel=medany"
> +
>
>  # This next part is necessary to trick the build system into thinking
>  # its building an image recipe so it generates the qemuboot.conf
> --
> 2.25.1
>
>
> 
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-13  0:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11  5:31 [PATCH v2] baremetal-helloworld: Enable RISC-V 64 port Alejandro Hernandez Samaniego
2021-05-11  5:58 ` [OE-core] " Alistair Francis
2021-05-11  6:08   ` Alejandro Hernandez Samaniego
2021-05-13  0:07 ` Alistair Francis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.