Re: LLVM on openSUSE 15.1
On 18/9/19 4:09 pm, Sebastian Huber wrote: > On 18/09/2019 07:40, Chris Johns wrote: >> On 18/9/19 3:36 pm, Sebastian Huber wrote: >>> On 17/09/2019 08:07, Sebastian Huber wrote: On 17/09/2019 08:07, Chris Johns wrote: > On 17/9/19 3:32 pm, Sebastian Huber wrote: >> Hello, >> >> I didn't get far: >> >> config.status: creating t/wrap/automake-1.12 >> + make -j 12 all >> GEN automake >> GEN aclocal >> GEN t/ax/shell-no-trail-bslash >> GEN doc/aclocal.1 >> GEN doc/automake.1 >> GEN runtest >> GEN t/ax/test-defs.sh >> GEN lib/Automake/Config.pm >> GEN doc/aclocal-1.12.1 >> GEN doc/automake-1.12.1 >> help2man: can't get `--help' info from automake-1.12 >> Try `--no-discard-stderr' if option outputs to stderr >> make: *** [Makefile:4114: doc/automake-1.12.1] Error 255 > That is weird because this is what we build for gcc as we need autoconf to > boot > strap RTEMS. This is indeed quite weird, I never had problems building automake before. I will try to figure out what went wrong here. >>> >>> We have configuration files for Automake 1.12.6. I fixed it like this: >>> >>> https://git.rtems.org/rtems-source-builder/commit/?id=bf7b4ad68f0faa9a35e52ca1baafb6f72c0fb673 >>> > > This change breaks the build of the RTEMS toolchain on FreeBSD 12. > I do not understand ... https://lists.rtems.org/pipermail/build/2019-September/003517.html ? Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: LLVM on openSUSE 15.1
On 18/09/2019 10:29, Chris Johns wrote: On 18/9/19 4:09 pm, Sebastian Huber wrote: On 18/09/2019 07:40, Chris Johns wrote: On 18/9/19 3:36 pm, Sebastian Huber wrote: On 17/09/2019 08:07, Sebastian Huber wrote: On 17/09/2019 08:07, Chris Johns wrote: On 17/9/19 3:32 pm, Sebastian Huber wrote: Hello, I didn't get far: config.status: creating t/wrap/automake-1.12 + make -j 12 all GEN automake GEN aclocal GEN t/ax/shell-no-trail-bslash GEN doc/aclocal.1 GEN doc/automake.1 GEN runtest GEN t/ax/test-defs.sh GEN lib/Automake/Config.pm GEN doc/aclocal-1.12.1 GEN doc/automake-1.12.1 help2man: can't get `--help' info from automake-1.12 Try `--no-discard-stderr' if option outputs to stderr make: *** [Makefile:4114: doc/automake-1.12.1] Error 255 That is weird because this is what we build for gcc as we need autoconf to boot strap RTEMS. This is indeed quite weird, I never had problems building automake before. I will try to figure out what went wrong here. We have configuration files for Automake 1.12.6. I fixed it like this: https://git.rtems.org/rtems-source-builder/commit/?id=bf7b4ad68f0faa9a35e52ca1baafb6f72c0fb673 This change breaks the build of the RTEMS toolchain on FreeBSD 12. I do not understand ... https://lists.rtems.org/pipermail/build/2019-September/003517.html ? Building the unstable RTEMS 6 toolchain results in an endless build of automake with this patch on FreeBSD 12. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: LLVM on openSUSE 15.1
On 18/9/19 6:35 pm, Sebastian Huber wrote: > On 18/09/2019 10:29, Chris Johns wrote: >> On 18/9/19 4:09 pm, Sebastian Huber wrote: >>> On 18/09/2019 07:40, Chris Johns wrote: On 18/9/19 3:36 pm, Sebastian Huber wrote: > On 17/09/2019 08:07, Sebastian Huber wrote: >> >> >> On 17/09/2019 08:07, Chris Johns wrote: >>> On 17/9/19 3:32 pm, Sebastian Huber wrote: Hello, I didn't get far: config.status: creating t/wrap/automake-1.12 + make -j 12 all GEN automake GEN aclocal GEN t/ax/shell-no-trail-bslash GEN doc/aclocal.1 GEN doc/automake.1 GEN runtest GEN t/ax/test-defs.sh GEN lib/Automake/Config.pm GEN doc/aclocal-1.12.1 GEN doc/automake-1.12.1 help2man: can't get `--help' info from automake-1.12 Try `--no-discard-stderr' if option outputs to stderr make: *** [Makefile:4114: doc/automake-1.12.1] Error 255 >>> That is weird because this is what we build for gcc as we need autoconf >>> to >>> boot >>> strap RTEMS. >> >> This is indeed quite weird, I never had problems building automake >> before. I >> will try to figure out what went wrong here. > > We have configuration files for Automake 1.12.6. I fixed it like this: > > https://git.rtems.org/rtems-source-builder/commit/?id=bf7b4ad68f0faa9a35e52ca1baafb6f72c0fb673 > > >>> >>> This change breaks the build of the RTEMS toolchain on FreeBSD 12. >>> >> >> I do not understand ... >> https://lists.rtems.org/pipermail/build/2019-September/003517.html ? > > Building the unstable RTEMS 6 toolchain results in an endless build of > automake > with this patch on FreeBSD 12. OK. I will have a look tomorrow. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v2] Add lvgl/hello: Sample Hello world app using littleVGL and libbsd
On Wed, Sep 18, 2019 at 10:13 AM Chris Johns wrote: > On 18/9/19 7:31 am, Vijay Kumar Banerjee wrote: > > diff --git a/lvgl/hello/wscript b/lvgl/hello/wscript > > new file mode 100644 > > index 000..c706491 > > --- /dev/null > > +++ b/lvgl/hello/wscript > > @@ -0,0 +1,30 @@ > > +# Copyright 2019 Vijay Kumar Banerjee (vijaykumar9...@gmail.com) > > +# > > +# This file's license is 2-clause BSD as in this distribution's > LICENSE.2 file. > > +# > > + > > +import rtems_waf.rtems as rtems > > +import os > > + > > +def configure(conf): > > +rtems.check_lib_path(conf, lib = 'm') > > +rtems.check_lib_path(conf, lib = 'lvgl') > > +rtems.check_lib_path(conf, lib = 'bsd') > > What happens if there is no liblvgl found? I could not see any conditional > logic. > > Do the examples build for the SPARC erc32 BSP without liblvgl and libbsd? > > I have fixed this issue in the attached patch. Please have a look. > Chris > From 2c5a885d8242b8558e6b07a3eff0b2c2caddba29 Mon Sep 17 00:00:00 2001 From: Vijay Kumar Banerjee Date: Wed, 18 Sep 2019 02:56:46 +0530 Subject: [PATCH v3] Add lvgl/hello: Sample Hello world app using littleVGL and libbsd --- README | 2 +- lvgl/README| 6 ++ lvgl/hello/test.c | 154 + lvgl/hello/wscript | 32 ++ lvgl/wscript | 13 wscript| 9 ++- 6 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 lvgl/README create mode 100644 lvgl/hello/test.c create mode 100644 lvgl/hello/wscript create mode 100644 lvgl/wscript diff --git a/README b/README index 99ca787..f1e127c 100644 --- a/README +++ b/README @@ -15,4 +15,4 @@ posix_api- POSIX API examples (no led) schedsim - RTEMS Scheduler Simulator examples ticker - Ticker Variations uboot- U-Boot interaction examples - +lvgl_hello - LittleVGL graphics app example using libbsd framebuffer driver diff --git a/lvgl/README b/lvgl/README new file mode 100644 index 000..866d0cd --- /dev/null +++ b/lvgl/README @@ -0,0 +1,6 @@ +This folder contains a sample graphics app using littleVGL library and libbsd +The generated exe file can be directly run using a JTAG debugger on a target +with the right device tree or this can be converted into an image. + +For instructions on how to build the image or how to run the exe, please refer +to the BSP documentation in https://docs.rtems.org diff --git a/lvgl/hello/test.c b/lvgl/hello/test.c new file mode 100644 index 000..c85bb35 --- /dev/null +++ b/lvgl/hello/test.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2019 Vijay Kumar Banerjee . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +#define PRIO_SHELL 150 +#define STACK_SIZE_SHELL (64 * 1024) + +#include + +void +libbsdhelper_start_shell(rtems_task_priority prio) +{ + rtems_status_code sc = rtems_shell_init( + "SHLL", + STACK_SIZE_SHELL, + prio, + CONSOLE_DEVICE_NAME, + false, + true, + NULL + ); + assert(sc == RTEMS_SUCCESSFUL); +} + +static void +Init(rtems_task_argument arg) +{ + rtems_status_code sc; + int exit_code; + (void)arg; + static lv_color_t buf[LV_HOR_RES_MAX*10]; + static lv_disp_buf_t disp_buf; + + puts("\nRTEMS LVGL HELLO WORLD\n"); + sc = rtems_bsd_initialize(); + assert(sc == RTEMS_SUCCESSFUL); + + lv_init(); + + fbdev_init(); + + lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX*10); + + lv_disp_drv_t disp_drv; + lv_disp_drv_init(&disp_drv); + disp_drv.buffer = &disp_buf; + disp_drv.flush_cb = fbdev_flush; + lv_disp_drv_register(&disp_drv); + + lv_obj_t * label = lv_label_create(lv_scr_act(), NULL); + lv_label_set_t
Re: [PATCH 1/1] bsps/beagle: register i2c device at initialization
Hello Vijay, I tried it and the patch works. But there is a point that might could be improved: My application can still call bbb_register_i2c_0(). If I do that it returns an error code. That's better than if it would just initialize the bus twice. But it's not very clear from a user perspective. I could think of multiple alternatives: 1. Remove / rename the function so that it is clear at link time that it isn't there any more. In the ideal case, it's not longer visible in a header that is thought for the application developer. 2. Use 1 but make the function an empty one (returning success) so it doesn't fail. 3. Remember that the function has already been called in some function-static flag and don't execute it a second time. I think I would use 1. The function isn't useful any more if it is called during system init. And it should be very clear for a developer that something changed if there is a linker error with that function. Best regards Christian On 18/09/2019 00:03, Vijay Kumar Banerjee wrote: > --- > bsps/arm/beagle/i2c/bbb-i2c.c| 6 +++--- > bsps/arm/beagle/start/bspstart.c | 13 + > 2 files changed, 16 insertions(+), 3 deletions(-) > > diff --git a/bsps/arm/beagle/i2c/bbb-i2c.c b/bsps/arm/beagle/i2c/bbb-i2c.c > index 37b88864b9..f705078085 100644 > --- a/bsps/arm/beagle/i2c/bbb-i2c.c > +++ b/bsps/arm/beagle/i2c/bbb-i2c.c > @@ -186,16 +186,16 @@ static int am335x_i2c_reset( bbb_i2c_bus *bus ) > >bus->con_reg = 0; >regs->BBB_I2C_CON = bus->con_reg; > - udelay( 5 ); > + rtems_counter_delay_nanoseconds(5000); > >regs->BBB_I2C_SYSC = AM335X_I2C_SYSC_SRST; > - udelay( 1000 ); > + rtems_counter_delay_nanoseconds(100); >regs->BBB_I2C_CON = AM335X_I2C_CON_I2C_EN; > >while ( !( regs->BBB_I2C_SYSS & AM335X_I2C_SYSS_RDONE ) >&& timeout >= 0 ) { > --timeout; > -udelay( 100 ); > + rtems_counter_delay_nanoseconds(10); >} > >if ( timeout <= 0 ) { > diff --git a/bsps/arm/beagle/start/bspstart.c > b/bsps/arm/beagle/start/bspstart.c > index 224f9ecf3b..aadb9e826f 100644 > --- a/bsps/arm/beagle/start/bspstart.c > +++ b/bsps/arm/beagle/start/bspstart.c > @@ -17,6 +17,8 @@ > #include > #include > #include > +#include > +#include > > #include "bspdebug.h" > > @@ -41,3 +43,14 @@ uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t > icells) > { >return intr[0]; > } > + > +static void bbb_i2c_0_initialize(void) > +{ > + bbb_register_i2c_0(); > +} > + > +RTEMS_SYSINIT_ITEM( > + bbb_i2c_0_initialize, > + RTEMS_SYSINIT_LAST, > + RTEMS_SYSINIT_ORDER_LAST > +); > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH rtems_waf] rtems.py: Fix typo
--- rtems.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtems.py b/rtems.py index 2e57de4..af4b5fd 100644 --- a/rtems.py +++ b/rtems.py @@ -326,7 +326,7 @@ def check_cc(conf, *k, **kw): kw['fragment'] = test_application() conf.check_cc(*k, **kw) -def check_lib_path(ctx, lib, libpath = [], manditory = True): +def check_lib_path(ctx, lib, libpath = [], mandatory = True): lib_lib = 'lib%s.a' % (lib) ctx.start_msg('Library %s' % (lib_lib)) cmd = '%s %s %s -print-file-name=%s' % (' '.join(ctx.env.CC), @@ -336,7 +336,7 @@ def check_lib_path(ctx, lib, libpath = [], manditory = True): out = ctx.cmd_and_log(cmd) out = os.path.normpath(out.strip()) if out == lib_lib: -if manditory: +if mandatory: ctx.fatal('The library %s not found' % (lib_lib)) ctx.end_msg('not found') else: -- 2.20.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v2] Add lvgl/hello: Sample Hello world app using littleVGL and libbsd
On Wed, Sep 18, 2019 at 11:27 PM Vijay Kumar Banerjee < vijaykumar9...@gmail.com> wrote: > > > > On Wed, Sep 18, 2019 at 10:13 AM Chris Johns wrote: > >> On 18/9/19 7:31 am, Vijay Kumar Banerjee wrote: >> > diff --git a/lvgl/hello/wscript b/lvgl/hello/wscript >> > new file mode 100644 >> > index 000..c706491 >> > --- /dev/null >> > +++ b/lvgl/hello/wscript >> > @@ -0,0 +1,30 @@ >> > +# Copyright 2019 Vijay Kumar Banerjee (vijaykumar9...@gmail.com) >> > +# >> > +# This file's license is 2-clause BSD as in this distribution's >> LICENSE.2 file. >> > +# >> > + >> > +import rtems_waf.rtems as rtems >> > +import os >> > + >> > +def configure(conf): >> > +rtems.check_lib_path(conf, lib = 'm') >> > +rtems.check_lib_path(conf, lib = 'lvgl') >> > +rtems.check_lib_path(conf, lib = 'bsd') >> >> What happens if there is no liblvgl found? I could not see any >> conditional logic. >> >> Do the examples build for the SPARC erc32 BSP without liblvgl and libbsd? >> >> I have fixed this issue in the attached patch. Please have a look. > Sorry, this patch doesn't seem to work properly, I have modified it a bit and attached the v4 here. This v4 needs the rtems_waf typo patch that I recently posted. > Chris >> > From f6919d71d0f580e2d5c02e727220b32ecc95d0c3 Mon Sep 17 00:00:00 2001 From: Vijay Kumar Banerjee Date: Wed, 18 Sep 2019 02:56:46 +0530 Subject: [PATCH v4] Add lvgl/hello: Sample Hello world app using littleVGL and libbsd --- README | 2 +- lvgl/README| 6 ++ lvgl/hello/test.c | 154 + lvgl/hello/wscript | 32 ++ lvgl/wscript | 13 wscript| 9 ++- 6 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 lvgl/README create mode 100644 lvgl/hello/test.c create mode 100644 lvgl/hello/wscript create mode 100644 lvgl/wscript diff --git a/README b/README index 99ca787..f1e127c 100644 --- a/README +++ b/README @@ -15,4 +15,4 @@ posix_api- POSIX API examples (no led) schedsim - RTEMS Scheduler Simulator examples ticker - Ticker Variations uboot- U-Boot interaction examples - +lvgl_hello - LittleVGL graphics app example using libbsd framebuffer driver diff --git a/lvgl/README b/lvgl/README new file mode 100644 index 000..866d0cd --- /dev/null +++ b/lvgl/README @@ -0,0 +1,6 @@ +This folder contains a sample graphics app using littleVGL library and libbsd +The generated exe file can be directly run using a JTAG debugger on a target +with the right device tree or this can be converted into an image. + +For instructions on how to build the image or how to run the exe, please refer +to the BSP documentation in https://docs.rtems.org diff --git a/lvgl/hello/test.c b/lvgl/hello/test.c new file mode 100644 index 000..c85bb35 --- /dev/null +++ b/lvgl/hello/test.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2019 Vijay Kumar Banerjee . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +#define PRIO_SHELL 150 +#define STACK_SIZE_SHELL (64 * 1024) + +#include + +void +libbsdhelper_start_shell(rtems_task_priority prio) +{ + rtems_status_code sc = rtems_shell_init( + "SHLL", + STACK_SIZE_SHELL, + prio, + CONSOLE_DEVICE_NAME, + false, + true, + NULL + ); + assert(sc == RTEMS_SUCCESSFUL); +} + +static void +Init(rtems_task_argument arg) +{ + rtems_status_code sc; + int exit_code; + (void)arg; + static lv_color_t buf[LV_HOR_RES_MAX*10]; + static lv_disp_buf_t disp_buf; + + puts("\nRTEMS LVGL HELLO WORLD\n"); + sc = rtems_bsd_initialize(); + assert(sc == RTEMS_SUCCESSFUL); + + lv_init(); + + fbdev_init(); + + l
[PATCH v2] bsps/beagle: register i2c device at initialization
--- bsps/arm/beagle/i2c/bbb-i2c.c | 6 +++--- bsps/arm/beagle/include/bsp/i2c.h | 10 -- bsps/arm/beagle/start/bspstart.c | 16 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/bsps/arm/beagle/i2c/bbb-i2c.c b/bsps/arm/beagle/i2c/bbb-i2c.c index 37b88864b9..f705078085 100644 --- a/bsps/arm/beagle/i2c/bbb-i2c.c +++ b/bsps/arm/beagle/i2c/bbb-i2c.c @@ -186,16 +186,16 @@ static int am335x_i2c_reset( bbb_i2c_bus *bus ) bus->con_reg = 0; regs->BBB_I2C_CON = bus->con_reg; - udelay( 5 ); + rtems_counter_delay_nanoseconds(5000); regs->BBB_I2C_SYSC = AM335X_I2C_SYSC_SRST; - udelay( 1000 ); + rtems_counter_delay_nanoseconds(100); regs->BBB_I2C_CON = AM335X_I2C_CON_I2C_EN; while ( !( regs->BBB_I2C_SYSS & AM335X_I2C_SYSS_RDONE ) && timeout >= 0 ) { --timeout; -udelay( 100 ); + rtems_counter_delay_nanoseconds(10); } if ( timeout <= 0 ) { diff --git a/bsps/arm/beagle/include/bsp/i2c.h b/bsps/arm/beagle/include/bsp/i2c.h index 9d253406bf..60f71194bf 100644 --- a/bsps/arm/beagle/include/bsp/i2c.h +++ b/bsps/arm/beagle/include/bsp/i2c.h @@ -94,16 +94,6 @@ int am335x_i2c_bus_register( rtems_vector_number irq ); -static inline int bbb_register_i2c_0( void ) -{ - return am335x_i2c_bus_register( -BBB_I2C_0_BUS_PATH, -AM335X_I2C0_BASE, -I2C_BUS_CLOCK_DEFAULT, -BBB_I2C0_IRQ - ); -} - static inline int bbb_register_i2c_1( void ) { return am335x_i2c_bus_register( diff --git a/bsps/arm/beagle/start/bspstart.c b/bsps/arm/beagle/start/bspstart.c index 224f9ecf3b..8112e0867d 100644 --- a/bsps/arm/beagle/start/bspstart.c +++ b/bsps/arm/beagle/start/bspstart.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include "bspdebug.h" @@ -41,3 +43,17 @@ uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells) { return intr[0]; } + +static void bbb_i2c_0_initialize(void) +{ + am335x_i2c_bus_register(BBB_I2C_0_BUS_PATH, + AM335X_I2C0_BASE, + I2C_BUS_CLOCK_DEFAULT, + BBB_I2C0_IRQ); +} + +RTEMS_SYSINIT_ITEM( + bbb_i2c_0_initialize, + RTEMS_SYSINIT_LAST, + RTEMS_SYSINIT_ORDER_LAST +); -- 2.20.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 1/1] bsps/beagle: register i2c device at initialization
On Wed, Sep 18, 2019 at 11:29 PM Christian Mauderer wrote: > Hello Vijay, > > I tried it and the patch works. But there is a point that might could be > improved: > > My application can still call bbb_register_i2c_0(). If I do that it > returns an error code. That's better than if it would just initialize > the bus twice. But it's not very clear from a user perspective. I could > think of multiple alternatives: > > 1. Remove / rename the function so that it is clear at link time that it > isn't there any more. In the ideal case, it's not longer visible in a > header that is thought for the application developer. > > 2. Use 1 but make the function an empty one (returning success) so it > doesn't fail. > > 3. Remember that the function has already been called in some > function-static flag and don't execute it a second time. > > I think I would use 1. The function isn't useful any more if it is > called during system init. And it should be very clear for a developer > that something changed if there is a linker error with that function. > > Hi, Thanks for the review. I have posted a v2 [1] of the patch following the first alternative as you suggested. I'll also try to send a docs patch to mention that i2c-0 is registered at init and i2c-1 and i2c-2 can be registered with the respective wrappers. [1]: https://lists.rtems.org/pipermail/devel/2019-September/027765.html Best regards, Vijay > Best regards > > Christian > > On 18/09/2019 00:03, Vijay Kumar Banerjee wrote: > > --- > > bsps/arm/beagle/i2c/bbb-i2c.c| 6 +++--- > > bsps/arm/beagle/start/bspstart.c | 13 + > > 2 files changed, 16 insertions(+), 3 deletions(-) > > > > diff --git a/bsps/arm/beagle/i2c/bbb-i2c.c > b/bsps/arm/beagle/i2c/bbb-i2c.c > > index 37b88864b9..f705078085 100644 > > --- a/bsps/arm/beagle/i2c/bbb-i2c.c > > +++ b/bsps/arm/beagle/i2c/bbb-i2c.c > > @@ -186,16 +186,16 @@ static int am335x_i2c_reset( bbb_i2c_bus *bus ) > > > >bus->con_reg = 0; > >regs->BBB_I2C_CON = bus->con_reg; > > - udelay( 5 ); > > + rtems_counter_delay_nanoseconds(5000); > > > >regs->BBB_I2C_SYSC = AM335X_I2C_SYSC_SRST; > > - udelay( 1000 ); > > + rtems_counter_delay_nanoseconds(100); > >regs->BBB_I2C_CON = AM335X_I2C_CON_I2C_EN; > > > >while ( !( regs->BBB_I2C_SYSS & AM335X_I2C_SYSS_RDONE ) > >&& timeout >= 0 ) { > > --timeout; > > -udelay( 100 ); > > + rtems_counter_delay_nanoseconds(10); > >} > > > >if ( timeout <= 0 ) { > > diff --git a/bsps/arm/beagle/start/bspstart.c > b/bsps/arm/beagle/start/bspstart.c > > index 224f9ecf3b..aadb9e826f 100644 > > --- a/bsps/arm/beagle/start/bspstart.c > > +++ b/bsps/arm/beagle/start/bspstart.c > > @@ -17,6 +17,8 @@ > > #include > > #include > > #include > > +#include > > +#include > > > > #include "bspdebug.h" > > > > @@ -41,3 +43,14 @@ uint32_t bsp_fdt_map_intr(const uint32_t *intr, > size_t icells) > > { > >return intr[0]; > > } > > + > > +static void bbb_i2c_0_initialize(void) > > +{ > > + bbb_register_i2c_0(); > > +} > > + > > +RTEMS_SYSINIT_ITEM( > > + bbb_i2c_0_initialize, > > + RTEMS_SYSINIT_LAST, > > + RTEMS_SYSINIT_ORDER_LAST > > +); > > > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH rtems_waf] rtems.py: Fix typo
Pushed. Thanks Chris On 19/9/19 4:14 am, Vijay Kumar Banerjee wrote: > --- > rtems.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/rtems.py b/rtems.py > index 2e57de4..af4b5fd 100644 > --- a/rtems.py > +++ b/rtems.py > @@ -326,7 +326,7 @@ def check_cc(conf, *k, **kw): > kw['fragment'] = test_application() > conf.check_cc(*k, **kw) > > -def check_lib_path(ctx, lib, libpath = [], manditory = True): > +def check_lib_path(ctx, lib, libpath = [], mandatory = True): > lib_lib = 'lib%s.a' % (lib) > ctx.start_msg('Library %s' % (lib_lib)) > cmd = '%s %s %s -print-file-name=%s' % (' '.join(ctx.env.CC), > @@ -336,7 +336,7 @@ def check_lib_path(ctx, lib, libpath = [], manditory = > True): > out = ctx.cmd_and_log(cmd) > out = os.path.normpath(out.strip()) > if out == lib_lib: > -if manditory: > +if mandatory: > ctx.fatal('The library %s not found' % (lib_lib)) > ctx.end_msg('not found') > else: > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v2] Add lvgl/hello: Sample Hello world app using littleVGL and libbsd
On 19/9/19 5:05 am, Vijay Kumar Banerjee wrote: > Sorry, this patch doesn't seem to work properly, I have modified it a bit and > attached the v4 here. This v4 needs the rtems_waf typo patch that I recently > posted. Thanks. This fragment ... if bld.env.LIBPATH_libbsd and bld.env.LIBPATH_liblvgl: ... exposes how libraries are being held in the env so I have pushed a change to rtems_waf to add a `check_lib()` call you can use with ... if rtems.check_lib(['bsd', 'lvgl']): Could you please update the patch to pick up the latest rtems_waf changes and use the check_lib() call? Thanks Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: LLVM on openSUSE 15.1
On 18/9/19 6:56 pm, Chris Johns wrote: >> Building the unstable RTEMS 6 toolchain results in an endless build of >> automake >> with this patch on FreeBSD 12. > > OK. I will have a look tomorrow. The copy of the patch from rtems/config/tools/rtems-automake-1.12.6-1.cfg to the bare/devel resulted in the patch being duplicated and this broken the build because the second patch resulted in patch asking we want to reverse the patch. The include at the end of the rtems automake config is to the bare/devel automake config. I have pushed patches to detect duplicate adds in a simple way and remove the duplicate patch. Note, the detection can be easily be beaten if the arguments are not the same in same order. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: LLVM on openSUSE 15.1
On 19/09/2019 01:52, Chris Johns wrote: On 18/9/19 6:56 pm, Chris Johns wrote: Building the unstable RTEMS 6 toolchain results in an endless build of automake with this patch on FreeBSD 12. OK. I will have a look tomorrow. The copy of the patch from rtems/config/tools/rtems-automake-1.12.6-1.cfg to the bare/devel resulted in the patch being duplicated and this broken the build because the second patch resulted in patch asking we want to reverse the patch. The include at the end of the rtems automake config is to the bare/devel automake config. I have pushed patches to detect duplicate adds in a simple way and remove the duplicate patch. Note, the detection can be easily be beaten if the arguments are not the same in same order. Thanks for fixing this. I didn't take into account that the RTEMS file includes the bare/devel file. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel