Discussion:
[Hans]How to porting Nano-X to RTEMS?
黄喜
2014-04-12 02:20:22 UTC
Permalink
Dear All Sirs:


I searched about you porting the Nano-X to RTEMS. I want to ask you whether or not porting the Nano-X to RTEMS with a LCD device. Because I want to porting the Nano-X to RTEMS and running on ARM9 port with a MCU. Can you supply any information to me?
Thanks!
Aaron J. Grier
2014-04-13 04:13:59 UTC
Permalink
(pointing back to rtems-users and bottom posting)

On Sat, Apr 12, 2014 at 10:29:07AM +0800, ???? wrote:
> At 2014-04-12 09:04:13,"Gedare Bloom" <gedare-bAyde64XM/***@public.gmane.org> wrote:
> > On Fri, Apr 11, 2014 at 8:13 PM, ???? <huangxi_hans-9Onoh4P/***@public.gmane.org> wrote:
> > > I searched about you porting the Nano-X to RTEMS. I want to ask
> > > you whether or not porting the Nano-X to RTEMS with a LCD device.
> > > Because I want to porting the Nano-X to RTEMS and running on ARM9
> > > port with a MCU. Can you supply any information to me?
>
> > There are some notes on using microwindows at
> > http://wiki.rtems.org/wiki/index.php/RTEMSGraphicsToolkit
> >
> > I have not used it myself. You might try the rtems-users mailing list
> > to inquire about the current support.
>
> Hi Gedare,
> Thank you very much!

there was some work done on the toolkit in 2012:
http://www.rtems.org/wiki/index.php/RTEMSGraphicsToolkit#Experimental_GSoC_2012_Version_of_the_RTEMS_Graphics_Toolkit
you should be able to leverage this for your ARM project.

I'm a bit out of touch with the current activities involving RTEMS and
Nano-X. The last project I worked on with RTEMS and Nano-X was
discontinued at the end of 2010.

--
Aaron J. Grier | "Not your ordinary poofy goof." | agrier-QpT+***@public.gmane.org
黄喜
2014-04-15 01:01:54 UTC
Permalink
Hi Pavel,


I'm very happy to get your mail. May be Nano-x can't support the VGA device from your mail. But has a method can realize it. I know the SM502 graphic MCU support LVDS and VGA graphic port. So we can through write the framebuffer,and the SM502 can convert the pixel to VGA format.


Through your attaching file. Maybe I can porting the Nano-X with RTEMS to ARM MCU with a LCD.


Best Wishes.
Hans








At 2014-04-14 20:48:33,"Pavel Pisa" <***@cmp.felk.cvut.cz> wrote:
>Hello all,
>
>On Sunday 13 of April 2014 06:13:59 Aaron J. Grier wrote:
>> there was some work done on the toolkit in 2012:
>> http://www.rtems.org/wiki/index.php/RTEMSGraphicsToolkit#Experimental_GSoC_
>>2012_Version_of_the_RTEMS_Graphics_Toolkit you should be able to leverage
>> this for your ARM project.
>>
>> I'm a bit out of touch with the current activities involving RTEMS and
>> Nano-X. The last project I worked on with RTEMS and Nano-X was
>> discontinued at the end of 2010.
>
>we are using Microwindows/Nano-X codebase together
>with our SuiTk GUI on RTEMS at company on ARM CSB336
>board.
>
>We have tested actual RTEMS git build for i386
>with Nano-X under QEMU with CIRRUS GD5446 driver
>developed during mentioned GSoC. The RTEMS configuration
>for that setup is described there
>
>http://www.rtems.org/wiki/index.php/RTEMSGraphicsToolkit#Running_RTEMS_Graphics_Toolkit_under_QEMU
>
>The use of Nano-X with RTEMS on embedded targets where
>framebuffer is simply mapped from fixed someaddress
>in fixed format is quite straightforward. I can provide
>some info and code which we use. I am attaching microwin-080121
>version of our adapted driver as example.
>
>When it is put into src/drivers directory and Nano-X are modified
>to build an use that "driver"/configuration then it can be
>used from application. I.e. calling GdOpenScreen() low level init.
>
>But such solution is not usable for PC and even on other targets
>it is bypassing RTEMS drivers framework.
>
>One of our students - Jan Dolezal - is working now on VESA BIOS
>Extension (VBE3) based solution for standard PC hardware.
>It should be integrated same as CIRRUS GD5446 driver into RTEMS
>mainline if he succeed. Unfortuantelly QEMU VESA BIOS does not
>provide VBE3 support but our initial check shows that most f real cards
>support it. So we hope to provide that solution and then next step
>is add layer to switch between three i386 (VGA, Cirrus and VBE3)
>graphic divers during startup phase. Problem is, that VGA is unusable
>with actual Nano-X because actual Nano-X deprecated/removes old
>planes based driver for ancient VGA hardware.
>
>The support for VBE3 requires application/driver configurable GDT
>entries. Jan Dolezal has already setup GIT repository with his work
>
> https://github.com/dolezaljan/rtems
>
>As for Nano-X build with use of do_it script, we have found some problem
>with actual version in
>
> git://git.rtems.org/rtems-graphics-toolkit.git
>
>The repo points to incorrect Nano-X GIT revision.
>We have used last Alexandru-Sever Horin's version.
>
> git://github.com/alex-sever-h/microwin.git
>
>and have some minor patch for config. Jan Jan Dolezal should prepare
>it during his bachelor thesis. All is work in progress and we
>planned to announce our actual steps when we have more finished,
>but I am sending as much info now when there is and interrest
>to coordinate possible effort of others and do not repeat
>fails and looking for same corrections.
>
>Best wishes
>
> Pavel Pisa
> e-mail: ***@cmp.felk.cvut.cz
> www: http://cmp.felk.cvut.cz/~pisa
> university: http://dce.fel.cvut.cz/
> company: http://www.pikron.com/
>
>
Pavel Pisa
2014-04-15 09:06:40 UTC
Permalink
Helo Hans,

On Tuesday 15 of April 2014 03:01:54 黄喜 wrote:
> Hi Pavel,
>
>
> I'm very happy to get your mail. May be Nano-x can't support the
> VGA device from your mail. But has a method can realize it. I know the
> SM502 graphic MCU support LVDS and VGA graphic port. So we can through
> write the framebuffer,and the SM502 can convert the pixel to VGA format.

you have to be more specific about your hardware to get some
more relevant answer.

The first, are you speaking about x86 based hardware or embedded
ARM/MIPS/Sparc based system? Is the SM502 SiliconMotion multimedia
companion chip?

When I speak about VGA, I have not in mind VGA connector/RGB analog
signals. The original PC style VGA is standard for I/O registers
and framebuffer mapping and function on old PCs. It support 640x480
pixels max and only in 4 BPP format. But due to compatibility
requirements with all that DOS and other direct hardware accessing
software the exact registers mapping is support even by allmost
all today GPU offers which can be used with PC (Intel, Nvidia, ATI/AMD).
But recent Microwindows/Nano-X versions do not support plane based
pixels access which is the only way to achieve 640x480 on bare VGA
hardware so RTEMS included VGA driver is of no use with recent hardware
and Nano-X.

But the PC based cards are equipped by BIOS which can be called
and allows to setup required graphic mode. It is called VESA BIOS
and there exists more of its EXTENSIONS where one (VBE3) allows to
be called from protected mode. That is what we want to implement for RTEMS.

The other option (for PC and PCI/PCIe/AGP cards) is to write own graphic
driver which locates card on PCI bus and does whole initialization
itself. The example is our Cirrus driver

http://git.rtems.org/rtems/tree/c/src/lib/libbsp/i386/pc386/console/fb_cirrus.c

This driver does not use any part of PC BIOS and is not x86 specific in fact
so it can be adapted/included in other RTEMS platforms/architectures builds
and in the fact it should be moved to some shared location one day.
Ideally with support for runtime (at RTEMS startup) selection of graphic
hardware support.

> Through your attaching file. Maybe I can porting the Nano-X with
> RTEMS to ARM MCU with a LCD.

In the case of embedded, you need to use/implement target system specific
driver.

On Tuesday 15 of April 2014 03:40:32 黄喜 wrote:
> What's difference between scr_mx1sl.c and
> rtems-4.11\c\src\lib\libbsp\arm\gumstix\fb\fb.c ?

The RTEMS Gumstick graphics driver is a real/integrated RTEMS driver
which provides IOCTL based control over hardware

http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/gumstix/fb/fb.c

When Nano-X is configured for RTEMS then it selects scr_rtems.c

https://github.com/alex-sever-h/microwin/blob/master/src/drivers/scr_rtems.c

its graphics driver/configuration. In the fact that driver
does not setup mode directly in HW but opens console device
previously registered by target specific RTEMS fb.c and uses
architecture independent IOCTLs to ask HW setup from RTEMS.
RTEMS fb.c provides information about selected mode and
pixels organization and setups Nano-X PSD/drawing rutines
for that mode, BPP etc.

> The scr_mx1sl.c from microwin\src\drivers, and the fb.c in BSP of RTEMS.
> I think scr_mx1sl.c tell Microwindows how to format the pixel data, and the
> fb.c tell RTEMS how to initialize the hardware .

Our scr_mx1sl.c bypasses RTEMS framebuffer driver (we do not have one for
CSB336). But because we know that our bootblock setups graphics and
shows logo on display, we know that we do not need to take care about
initialization. The framebuffer start address and other parameters
are delivered to RTEMS application through our system specific
BootBlock Config structures and at the end we directly provide
information to the Nano-X through scr_mx1sl.c where is framebuffer
RAM located etc. We than do some more tricks to achieve full screen
double buffering etc. But for you, scr_mx1sl.c, is an example
how to do all graphics setup under application control without
need to modify RTEMS BSP support.

> So I think I need two files if I porting Microwindows into RTEMS, they all
> should be exist. Is right?

I hope, my description should be enough. It could worth to somehow clean
it up and put somewhere into RTEMS wiki.

I guess that you are speaking about ARM based system with PCI and
SiliconMotion multimedia SM502 companion chip.

In such case, you should start from Cyrrus PCI driver if RTEMS support
PCI configuration space access functions on your target.
You need to find how SM502 should be configured for you panel
and write code to provide setup over card memory mapped regions
(start addresses needs to be setup/can be found from PCI device
BAR registers).

If you achieve mode setup then you need to find/map actual framebuffer
to the ARM CPU address pace and provide start address and mode to
the calling scr_rtems.c driver. Then Nano-X should use your HW
and can draw GUI.

But be prepared that it can be quite slow for higher resolutions.
The chip gains speed through acceleration.
Nano-X provides good infrastructure for 2D acceleration but
if you want to use SM502 hardware implementation of blits etc.,
then you need to write your own scr_xxx driver which provides
own implementation of these function which can send commands
directly to the chip. You can route calls through target specific
fb.c included in RTEMS through IOCTLs or you can access HW directly
form your Nano-X driver. Because there would be quite huge amount
of code required and it would be quite specific to your setup
it can be easier in such case to move all, even HW initialization
to target specific Nano-X driver and bypass RTEMS fb.c.
Other option is to negotiate RTEMS wide set of IOCTLs for graphic
acceleration, but I think that it is simper and more flexible
to write code in one place first and start more universal infrastructure
implementation when there knowledge/experience
gained.

Best wishes,

Pavel Pisa

==================================================
PiKRON s.r.o. Phone/Fax: +420 2 84684676
Kankovskeho 1235 Phone: +420 2 84684676
182 00 Praha 8 WWW: http://www.pikron.com/
Czech Republic e-mail: ***@pikron.com
==================================================


>
> At 2014-04-14 20:48:33,"Pavel Pisa" <***@cmp.felk.cvut.cz> wrote:
> >Hello all,
> >
> >On Sunday 13 of April 2014 06:13:59 Aaron J. Grier wrote:
> >> there was some work done on the toolkit in 2012:
> >> http://www.rtems.org/wiki/index.php/RTEMSGraphicsToolkit#Experimental_GS
> >>oC_ 2012_Version_of_the_RTEMS_Graphics_Toolkit you should be able to
> >> leverage this for your ARM project.
> >>
> >> I'm a bit out of touch with the current activities involving RTEMS and
> >> Nano-X. The last project I worked on with RTEMS and Nano-X was
> >> discontinued at the end of 2010.
> >
> >we are using Microwindows/Nano-X codebase together
> >with our SuiTk GUI on RTEMS at company on ARM CSB336
> >board.
> >
> >We have tested actual RTEMS git build for i386
> >with Nano-X under QEMU with CIRRUS GD5446 driver
> >developed during mentioned GSoC. The RTEMS configuration
> >for that setup is described there
> >
> >http://www.rtems.org/wiki/index.php/RTEMSGraphicsToolkit#Running_RTEMS_Gra
> >phics_Toolkit_under_QEMU
> >
> >The use of Nano-X with RTEMS on embedded targets where
> >framebuffer is simply mapped from fixed someaddress
> >in fixed format is quite straightforward. I can provide
> >some info and code which we use. I am attaching microwin-080121
> >version of our adapted driver as example.
> >
> >When it is put into src/drivers directory and Nano-X are modified
> >to build an use that "driver"/configuration then it can be
> >used from application. I.e. calling GdOpenScreen() low level init.
> >
> >But such solution is not usable for PC and even on other targets
> >it is bypassing RTEMS drivers framework.
> >
> >One of our students - Jan Dolezal - is working now on VESA BIOS
> >Extension (VBE3) based solution for standard PC hardware.
> >It should be integrated same as CIRRUS GD5446 driver into RTEMS
> >mainline if he succeed. Unfortuantelly QEMU VESA BIOS does not
> >provide VBE3 support but our initial check shows that most f real cards
> >support it. So we hope to provide that solution and then next step
> >is add layer to switch between three i386 (VGA, Cirrus and VBE3)
> >graphic divers during startup phase. Problem is, that VGA is unusable
> >with actual Nano-X because actual Nano-X deprecated/removes old
> >planes based driver for ancient VGA hardware.
> >
> >The support for VBE3 requires application/driver configurable GDT
> >entries. Jan Dolezal has already setup GIT repository with his work
> >
> > https://github.com/dolezaljan/rtems
> >
> >As for Nano-X build with use of do_it script, we have found some problem
> >with actual version in
> >
> > git://git.rtems.org/rtems-graphics-toolkit.git
> >
> >The repo points to incorrect Nano-X GIT revision.
> >We have used last Alexandru-Sever Horin's version.
> >
> > git://github.com/alex-sever-h/microwin.git
> >
> >and have some minor patch for config. Jan Jan Dolezal should prepare
> >it during his bachelor thesis. All is work in progress and we
> >planned to announce our actual steps when we have more finished,
> >but I am sending as much info now when there is and interrest
> >to coordinate possible effort of others and do not repeat
> >fails and looking for same corrections.
> >
> >Best wishes
> >
> > Pavel Pisa
> > e-mail: ***@cmp.felk.cvut.cz
> > www: http://cmp.felk.cvut.cz/~pisa
> > university: http://dce.fel.cvut.cz/
> > company: http://www.pikron.com/
Pavel Pisa
2014-04-16 08:26:08 UTC
Permalink
Helo Hans,


On Wednesday 16 of April 2014 03:35:19 黄喜 wrote:
> My project is based on ARM with SM502 Silicon Motion
> multimedia chip. But the at91sam9g45 connect SM502 through the address bus
> ,data bus and chip select signal.It is not through the PCI interface. But
> the SM502 support the PCI interface connect to other MCU.For example.
> Xscale, MIPS, Hitach etc.
>
> According to above your answer, The CSB336 has not a fb.c file in
> RTEMS, the LCD Hardware initialization steps finish in bootloader or
> bootblock.So the LCD controller is initialized before run RTEMS, only do
> scr_mx1sl.c steps tell Nano-X how to do. The RTEMS doesn't need know any
> information about the framebuffer. So has not a framebuffer driver
> architecture in CSB336 port. Is right?

Yes, that is a option. RTEMS usually maps virtual and physical addrespace 1:1
so direct access is possible. You need to consider cache. The area
representing framebuffer control registers has to be uncached and framebuffer
area should be write through (ideally + combine) cached or uncached (slower).

Look at CSB336 memory mapping as an example.

http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/csb336/startup/memmap.c

We use framebuffer in main memory for some boards variants (MXS based)
and we need to declare it as MMU_CACHE_WTHROUGH.

> I don't through the PCI interface connect to SM502 chip. I through
> the data bus and address bus connect to SM502 chip. And I have some
> experience to achieve it about Hardware. And have some demo code to tell me
> how to initialize the SM502 chip through the address bus and data bus, so I
> want to put these initialization code in bootloader, bypass RTEMS
> framebuffer architecture,Because I need show logo of company, and copy the
> application from norflash to DDR. And then base your scr_mx1sl.c to give
> the fixed framebuffer address and LCD configure information to Nano-X. Is
> a viable method?

Yes than my approach is most simple and you can even use allmost directly
bare metal support code from RTEMS. Writing simple RTEMS based driver
should not be problem as well but you do not gain too much there
and if your framebuffer mapping is specific for your HW (i.e. GPU
is not part of standard supported board or SoC) then there is not
significant reason to try to push it into RTEMS mainline.

I do CC to mainlinglist because information can be interresting
to others as well.

Best wishes,

Pavel Pisa

==================================================
PiKRON s.r.o. Phone/Fax: +420 2 84684676
Kankovskeho 1235 Phone: +420 2 84684676
182 00 Praha 8 WWW: http://www.pikron.com/
Czech Republic e-mail: ***@pikron.com
==================================================
huangxi_hans
2014-04-16 13:44:18 UTC
Permalink
Hello Pavel,

Thanks!! And your answer is so detailed.

I will enable the D-cache and I-cache. If I disable the I-cache, the code is running so slowly.

The framebuffer address is managed by SM502 if I use the SM502 with AT91SAM9G45, but the AT91SAM9G45 directly write this address. Because the SM502 connect a SDRAM for framebuffer RAM,this SDRAM only for framebuffer, not use for other task. My step is below:

1. Config the SM502 chip in bootloader, and show logo. That's verify the HW design is or not right.

2. Porting the RTEMS 4.11 to AT91SAM9G45 ,and running some tasks ,verify the RTEMS is or not OK.

3. Show circle and line to LCD through the RTEMS . Verify LCD handle is or not OK in RTEMS.

4. Porting the Nano-X to RTEMS and refer to your scr_mx1sl.c. This course may be need some times.


Later, may be have some questions need to trouble you. You're a wonderful teacher.










huangxi_hans

From: Pavel Pisa
Date: 2014-04-16 16:26
To: 黄喜
CC: rtems-users
Subject: Re: How to porting Nano-X to RTEMS, graphic drivers support and PC VESA support.
Helo Hans,


On Wednesday 16 of April 2014 03:35:19 黄喜 wrote:
> My project is based on ARM with SM502 Silicon Motion
> multimedia chip. But the at91sam9g45 connect SM502 through the address bus
> ,data bus and chip select signal.It is not through the PCI interface. But
> the SM502 support the PCI interface connect to other MCU.For example.
> Xscale, MIPS, Hitach etc.
>
> According to above your answer, The CSB336 has not a fb.c file in
> RTEMS, the LCD Hardware initialization steps finish in bootloader or
> bootblock.So the LCD controller is initialized before run RTEMS, only do
> scr_mx1sl.c steps tell Nano-X how to do. The RTEMS doesn't need know any
> information about the framebuffer. So has not a framebuffer driver
> architecture in CSB336 port. Is right?

Yes, that is a option. RTEMS usually maps virtual and physical addrespace 1:1
so direct access is possible. You need to consider cache. The area
representing framebuffer control registers has to be uncached and framebuffer
area should be write through (ideally + combine) cached or uncached (slower).

Look at CSB336 memory mapping as an example.

http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/csb336/startup/memmap.c

We use framebuffer in main memory for some boards variants (MXS based)
and we need to declare it as MMU_CACHE_WTHROUGH.

> I don't through the PCI interface connect to SM502 chip. I through
> the data bus and address bus connect to SM502 chip. And I have some
> experience to achieve it about Hardware. And have some demo code to tell me
> how to initialize the SM502 chip through the address bus and data bus, so I
> want to put these initialization code in bootloader, bypass RTEMS
> framebuffer architecture,Because I need show logo of company, and copy the
> application from norflash to DDR. And then base your scr_mx1sl.c to give
> the fixed framebuffer address and LCD configure information to Nano-X. Is
> a viable method?

Yes than my approach is most simple and you can even use allmost directly
bare metal support code from RTEMS. Writing simple RTEMS based driver
should not be problem as well but you do not gain too much there
and if your framebuffer mapping is specific for your HW (i.e. GPU
is not part of standard supported board or SoC) then there is not
significant reason to try to push it into RTEMS mainline.

I do CC to mainlinglist because information can be interresting
to others as well.

Best wishes,

Pavel Pisa

==================================================
PiKRON s.r.o. Phone/Fax: +420 2 84684676
Kankovskeho 1235 Phone: +420 2 84684676
182 00 Praha 8 WWW: http://www.pikron.com/
Czech Republic e-mail: ***@pikron.com
==================================================
Gedare Bloom
2014-04-16 14:19:35 UTC
Permalink
Thank you both for keeping this on the list. -Gedare

On Wed, Apr 16, 2014 at 9:44 AM, huangxi_hans <***@163.com> wrote:
> Hello Pavel,
>
> Thanks!! And your answer is so detailed.
>
> I will enable the D-cache and I-cache. If I disable the I-cache,
> the code is running so slowly.
>
> The framebuffer address is managed by SM502 if I use the SM502
> with AT91SAM9G45, but the AT91SAM9G45 directly write this address. Because
> the SM502 connect a SDRAM for framebuffer RAM,this SDRAM only for
> framebuffer, not use for other task. My step is below:
>
> 1. Config the SM502 chip in bootloader, and show logo. That's
> verify the HW design is or not right.
>
> 2. Porting the RTEMS 4.11 to AT91SAM9G45 ,and running some tasks
> ,verify the RTEMS is or not OK.
>
> 3. Show circle and line to LCD through the RTEMS . Verify LCD
> handle is or not OK in RTEMS.
>
> 4. Porting the Nano-X to RTEMS and refer to your scr_mx1sl.c.
> This course may be need some times.
>
>
> Later, may be have some questions need to trouble you. You're a
> wonderful teacher.
>
>
>
>
>
>
>
> ________________________________
> huangxi_hans
>
> From: Pavel Pisa
> Date: 2014-04-16 16:26
> To: 黄喜
> CC: rtems-users
> Subject: Re: How to porting Nano-X to RTEMS, graphic drivers support and PC
> VESA support.
> Helo Hans,
>
>
> On Wednesday 16 of April 2014 03:35:19 黄喜 wrote:
>> My project is based on ARM with SM502 Silicon Motion
>> multimedia chip. But the at91sam9g45 connect SM502 through the address bus
>> ,data bus and chip select signal.It is not through the PCI interface. But
>> the SM502 support the PCI interface connect to other MCU.For example.
>> Xscale, MIPS, Hitach etc.
>>
>> According to above your answer, The CSB336 has not a fb.c file in
>> RTEMS, the LCD Hardware initialization steps finish in bootloader or
>> bootblock.So the LCD controller is initialized before run RTEMS, only do
>> scr_mx1sl.c steps tell Nano-X how to do. The RTEMS doesn't need know any
>> information about the framebuffer. So has not a framebuffer driver
>> architecture in CSB336 port. Is right?
>
> Yes, that is a option. RTEMS usually maps virtual and physical addrespace
> 1:1
> so direct access is possible. You need to consider cache. The area
> representing framebuffer control registers has to be uncached and
> framebuffer
> area should be write through (ideally + combine) cached or uncached
> (slower).
>
> Look at CSB336 memory mapping as an example.
>
> http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/csb336/startup/memmap.c
>
> We use framebuffer in main memory for some boards variants (MXS based)
> and we need to declare it as MMU_CACHE_WTHROUGH.
>
>> I don't through the PCI interface connect to SM502 chip. I through
>> the data bus and address bus connect to SM502 chip. And I have some
>> experience to achieve it about Hardware. And have some demo code to tell
>> me
>> how to initialize the SM502 chip through the address bus and data bus, so
>> I
>> want to put these initialization code in bootloader, bypass RTEMS
>> framebuffer architecture,Because I need show logo of company, and copy the
>> application from norflash to DDR. And then base your scr_mx1sl.c to give
>> the fixed framebuffer address and LCD configure information to Nano-X. Is
>> a viable method?
>
> Yes than my approach is most simple and you can even use allmost directly
> bare metal support code from RTEMS. Writing simple RTEMS based driver
> should not be problem as well but you do not gain too much there
> and if your framebuffer mapping is specific for your HW (i.e. GPU
> is not part of standard supported board or SoC) then there is not
> significant reason to try to push it into RTEMS mainline.
>
> I do CC to mainlinglist because information can be interresting
> to others as well.
>
> Best wishes,
>
> Pavel Pisa
>
> ==================================================
> PiKRON s.r.o. Phone/Fax: +420 2 84684676
> Kankovskeho 1235 Phone: +420 2 84684676
> 182 00 Praha 8 WWW: http://www.pikron.com/
> Czech Republic e-mail: ***@pikron.com
> ==================================================
>
> _______________________________________________
> rtems-users mailing list
> rtems-***@rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
>
huangxi_hans
2014-04-16 14:22:53 UTC
Permalink
Hi Gedare,

I will supply the detailed porting steps if I porting the Nano-X and RTEMS to AT91SAM9G45 MCU successful.





huangxi_hans

·¢ŒþÈË£º Gedare Bloom
·¢ËÍʱŒä£º 2014-04-16 22:19
ÊÕŒþÈË£º huangxi_hans
³­ËÍ£º Pavel Pisa; rtems-users
Ö÷Ì⣺ Re: Re: How to porting Nano-X to RTEMS, graphic drivers support and PC VESA support.
Thank you both for keeping this on the list. -Gedare

On Wed, Apr 16, 2014 at 9:44 AM, huangxi_hans <***@163.com> wrote:
> Hello Pavel,
>
> Thanks!! And your answer is so detailed.
>
> I will enable the D-cache and I-cache. If I disable the I-cache,
> the code is running so slowly.
>
> The framebuffer address is managed by SM502 if I use the SM502
> with AT91SAM9G45, but the AT91SAM9G45 directly write this address. Because
> the SM502 connect a SDRAM for framebuffer RAM,this SDRAM only for
> framebuffer, not use for other task. My step is below:
>
> 1. Config the SM502 chip in bootloader, and show logo. That's
> verify the HW design is or not right.
>
> 2. Porting the RTEMS 4.11 to AT91SAM9G45 ,and running some tasks
> ,verify the RTEMS is or not OK.
>
> 3. Show circle and line to LCD through the RTEMS . Verify LCD
> handle is or not OK in RTEMS.
>
> 4. Porting the Nano-X to RTEMS and refer to your scr_mx1sl.c.
> This course may be need some times.
>
>
> Later, may be have some questions need to trouble you. You're a
> wonderful teacher.
>
>
>
>
>
>
>
> ________________________________
> huangxi_hans
>
> From: Pavel Pisa
> Date: 2014-04-16 16:26
> To: »Æϲ
> CC: rtems-users
> Subject: Re: How to porting Nano-X to RTEMS, graphic drivers support and PC
> VESA support.
> Helo Hans,
>
>
> On Wednesday 16 of April 2014 03:35:19 »Æϲ wrote:
>> My project is based on ARM with SM502 Silicon Motion
>> multimedia chip. But the at91sam9g45 connect SM502 through the address bus
>> ,data bus and chip select signal.It is not through the PCI interface. But
>> the SM502 support the PCI interface connect to other MCU.For example.
>> Xscale, MIPS, Hitach etc.
>>
>> According to above your answer, The CSB336 has not a fb.c file in
>> RTEMS, the LCD Hardware initialization steps finish in bootloader or
>> bootblock.So the LCD controller is initialized before run RTEMS, only do
>> scr_mx1sl.c steps tell Nano-X how to do. The RTEMS doesn't need know any
>> information about the framebuffer. So has not a framebuffer driver
>> architecture in CSB336 port. Is right?
>
> Yes, that is a option. RTEMS usually maps virtual and physical addrespace
> 1:1
> so direct access is possible. You need to consider cache. The area
> representing framebuffer control registers has to be uncached and
> framebuffer
> area should be write through (ideally + combine) cached or uncached
> (slower).
>
> Look at CSB336 memory mapping as an example.
>
> http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/csb336/startup/memmap.c
>
> We use framebuffer in main memory for some boards variants (MXS based)
> and we need to declare it as MMU_CACHE_WTHROUGH.
>
>> I don't through the PCI interface connect to SM502 chip. I through
>> the data bus and address bus connect to SM502 chip. And I have some
>> experience to achieve it about Hardware. And have some demo code to tell
>> me
>> how to initialize the SM502 chip through the address bus and data bus, so
>> I
>> want to put these initialization code in bootloader, bypass RTEMS
>> framebuffer architecture,Because I need show logo of company, and copy the
>> application from norflash to DDR. And then base your scr_mx1sl.c to give
>> the fixed framebuffer address and LCD configure information to Nano-X. Is
>> a viable method?
>
> Yes than my approach is most simple and you can even use allmost directly
> bare metal support code from RTEMS. Writing simple RTEMS based driver
> should not be problem as well but you do not gain too much there
> and if your framebuffer mapping is specific for your HW (i.e. GPU
> is not part of standard supported board or SoC) then there is not
> significant reason to try to push it into RTEMS mainline.
>
> I do CC to mainlinglist because information can be interresting
> to others as well.
>
> Best wishes,
>
> Pavel Pisa
>
> ==================================================
> PiKRON s.r.o. Phone/Fax: +420 2 84684676
> Kankovskeho 1235 Phone: +420 2 84684676
> 182 00 Praha 8 WWW: http://www.pikron.com/
> Czech Republic e-mail: ***@pikron.com
> ==================================================
>
> _______________________________________________
> rtems-users mailing list
> rtems-***@rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
>
emanuel stiebler
2014-04-16 14:31:11 UTC
Permalink
On 2014-04-16 16:22, huangxi_hans wrote:
> Hi Gedare,
> I will supply the detailed porting steps if I porting the
> Nano-X and RTEMS to AT91SAM9G45 MCU successful.

I wouldn't mind, if you post any progress or failures, so the next one
knows where to expect problems porting ...

Cheers
黄喜
2014-07-19 06:43:48 UTC
Permalink
Dear Joel,


I compile the GUI packet reference to http://rtems.org/wiki/index.php/RTEMSGraphicsToolkit#Experimental_GSoC_2012_Version_of_the_RTEMS_Graphics_Toolkit but have many errors .Has any detail guide or good packet ?


Thanks!











At 2014-04-15 05:06:40, "Pavel Pisa" <***@pikron.com> wrote:
>Helo Hans,
>
>On Tuesday 15 of April 2014 03:01:54 »Æϲ wrote:
>> Hi Pavel,
>>
>>
>> I'm very happy to get your mail. May be Nano-x can't support the
>> VGA device from your mail. But has a method can realize it. I know the
>> SM502 graphic MCU support LVDS and VGA graphic port. So we can through
>> write the framebuffer,and the SM502 can convert the pixel to VGA format.
>
>you have to be more specific about your hardware to get some
>more relevant answer.
>
>The first, are you speaking about x86 based hardware or embedded
>ARM/MIPS/Sparc based system? Is the SM502 SiliconMotion multimedia
>companion chip?
>
>When I speak about VGA, I have not in mind VGA connector/RGB analog
>signals. The original PC style VGA is standard for I/O registers
>and framebuffer mapping and function on old PCs. It support 640x480
>pixels max and only in 4 BPP format. But due to compatibility
>requirements with all that DOS and other direct hardware accessing
>software the exact registers mapping is support even by allmost
>all today GPU offers which can be used with PC (Intel, Nvidia, ATI/AMD).
>But recent Microwindows/Nano-X versions do not support plane based
>pixels access which is the only way to achieve 640x480 on bare VGA
>hardware so RTEMS included VGA driver is of no use with recent hardware
>and Nano-X.
>
>But the PC based cards are equipped by BIOS which can be called
>and allows to setup required graphic mode. It is called VESA BIOS
>and there exists more of its EXTENSIONS where one (VBE3) allows to
>be called from protected mode. That is what we want to implement for RTEMS.
>
>The other option (for PC and PCI/PCIe/AGP cards) is to write own graphic
>driver which locates card on PCI bus and does whole initialization
>itself. The example is our Cirrus driver
>
>http://git.rtems.org/rtems/tree/c/src/lib/libbsp/i386/pc386/console/fb_cirrus.c
>
>This driver does not use any part of PC BIOS and is not x86 specific in fact
>so it can be adapted/included in other RTEMS platforms/architectures builds
>and in the fact it should be moved to some shared location one day.
>Ideally with support for runtime (at RTEMS startup) selection of graphic
>hardware support.
>
>> Through your attaching file. Maybe I can porting the Nano-X with
>> RTEMS to ARM MCU with a LCD.
>
>In the case of embedded, you need to use/implement target system specific
>driver.
>
> On Tuesday 15 of April 2014 03:40:32 »Æϲ wrote:
>> What's difference between scr_mx1sl.c and
>> rtems-4.11\c\src\lib\libbsp\arm\gumstix\fb\fb.c ?
>
>The RTEMS Gumstick graphics driver is a real/integrated RTEMS driver
>which provides IOCTL based control over hardware
>
>http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/gumstix/fb/fb.c
>
>When Nano-X is configured for RTEMS then it selects scr_rtems.c
>
>https://github.com/alex-sever-h/microwin/blob/master/src/drivers/scr_rtems.c
>
>its graphics driver/configuration. In the fact that driver
>does not setup mode directly in HW but opens console device
>previously registered by target specific RTEMS fb.c and uses
>architecture independent IOCTLs to ask HW setup from RTEMS.
>RTEMS fb.c provides information about selected mode and
>pixels organization and setups Nano-X PSD/drawing rutines
>for that mode, BPP etc.
>
>> The scr_mx1sl.c from microwin\src\drivers, and the fb.c in BSP of RTEMS.
>> I think scr_mx1sl.c tell Microwindows how to format the pixel data, and the
>> fb.c tell RTEMS how to initialize the hardware .
>
>Our scr_mx1sl.c bypasses RTEMS framebuffer driver (we do not have one for
>CSB336). But because we know that our bootblock setups graphics and
>shows logo on display, we know that we do not need to take care about
>initialization. The framebuffer start address and other parameters
>are delivered to RTEMS application through our system specific
>BootBlock Config structures and at the end we directly provide
>information to the Nano-X through scr_mx1sl.c where is framebuffer
>RAM located etc. We than do some more tricks to achieve full screen
>double buffering etc. But for you, scr_mx1sl.c, is an example
>how to do all graphics setup under application control without
>need to modify RTEMS BSP support.
>
>> So I think I need two files if I porting Microwindows into RTEMS, they all
>> should be exist. Is right?
>
>I hope, my description should be enough. It could worth to somehow clean
>it up and put somewhere into RTEMS wiki.
>
>I guess that you are speaking about ARM based system with PCI and
>SiliconMotion multimedia SM502 companion chip.
>
>In such case, you should start from Cyrrus PCI driver if RTEMS support
>PCI configuration space access functions on your target.
>You need to find how SM502 should be configured for you panel
>and write code to provide setup over card memory mapped regions
>(start addresses needs to be setup/can be found from PCI device
>BAR registers).
>
>If you achieve mode setup then you need to find/map actual framebuffer
>to the ARM CPU address pace and provide start address and mode to
>the calling scr_rtems.c driver. Then Nano-X should use your HW
>and can draw GUI.
>
>But be prepared that it can be quite slow for higher resolutions.
>The chip gains speed through acceleration.
>Nano-X provides good infrastructure for 2D acceleration but
>if you want to use SM502 hardware implementation of blits etc.,
>then you need to write your own scr_xxx driver which provides
>own implementation of these function which can send commands
>directly to the chip. You can route calls through target specific
>fb.c included in RTEMS through IOCTLs or you can access HW directly
>form your Nano-X driver. Because there would be quite huge amount
>of code required and it would be quite specific to your setup
>it can be easier in such case to move all, even HW initialization
>to target specific Nano-X driver and bypass RTEMS fb.c.
>Other option is to negotiate RTEMS wide set of IOCTLs for graphic
>acceleration, but I think that it is simper and more flexible
>to write code in one place first and start more universal infrastructure
>implementation when there knowledge/experience
>gained.
>
>Best wishes,
>
> Pavel Pisa
>
>==================================================
> PiKRON s.r.o. Phone/Fax: +420 2 84684676
> Kankovskeho 1235 Phone: +420 2 84684676
> 182 00 Praha 8 WWW: http://www.pikron.com/
> Czech Republic e-mail: ***@pikron.com
>==================================================
>
>
>>
>> At 2014-04-14 20:48:33,"Pavel Pisa" <***@cmp.felk.cvut.cz> wrote:
>> >Hello all,
>> >
>> >On Sunday 13 of April 2014 06:13:59 Aaron J. Grier wrote:
>> >> there was some work done on the toolkit in 2012:
>> >> http://www.rtems.org/wiki/index.php/RTEMSGraphicsToolkit#Experimental_GS
>> >>oC_ 2012_Version_of_the_RTEMS_Graphics_Toolkit you should be able to
>> >> leverage this for your ARM project.
>> >>
>> >> I'm a bit out of touch with the current activities involving RTEMS and
>> >> Nano-X. The last project I worked on with RTEMS and Nano-X was
>> >> discontinued at the end of 2010.
>> >
>> >we are using Microwindows/Nano-X codebase together
>> >with our SuiTk GUI on RTEMS at company on ARM CSB336
>> >board.
>> >
>> >We have tested actual RTEMS git build for i386
>> >with Nano-X under QEMU with CIRRUS GD5446 driver
>> >developed during mentioned GSoC. The RTEMS configuration
>> >for that setup is described there
>> >
>> >http://www.rtems.org/wiki/index.php/RTEMSGraphicsToolkit#Running_RTEMS_Gra
>> >phics_Toolkit_under_QEMU
>> >
>> >The use of Nano-X with RTEMS on embedded targets where
>> >framebuffer is simply mapped from fixed someaddress
>> >in fixed format is quite straightforward. I can provide
>> >some info and code which we use. I am attaching microwin-080121
>> >version of our adapted driver as example.
>> >
>> >When it is put into src/drivers directory and Nano-X are modified
>> >to build an use that "driver"/configuration then it can be
>> >used from application. I.e. calling GdOpenScreen() low level init.
>> >
>> >But such solution is not usable for PC and even on other targets
>> >it is bypassing RTEMS drivers framework.
>> >
>> >One of our students - Jan Dolezal - is working now on VESA BIOS
>> >Extension (VBE3) based solution for standard PC hardware.
>> >It should be integrated same as CIRRUS GD5446 driver into RTEMS
>> >mainline if he succeed. Unfortuantelly QEMU VESA BIOS does not
>> >provide VBE3 support but our initial check shows that most f real cards
>> >support it. So we hope to provide that solution and then next step
>> >is add layer to switch between three i386 (VGA, Cirrus and VBE3)
>> >graphic divers during startup phase. Problem is, that VGA is unusable
>> >with actual Nano-X because actual Nano-X deprecated/removes old
>> >planes based driver for ancient VGA hardware.
>> >
>> >The support for VBE3 requires application/driver configurable GDT
>> >entries. Jan Dolezal has already setup GIT repository with his work
>> >
>> > https://github.com/dolezaljan/rtems
>> >
>> >As for Nano-X build with use of do_it script, we have found some problem
>> >with actual version in
>> >
>> > git://git.rtems.org/rtems-graphics-toolkit.git
>> >
>> >The repo points to incorrect Nano-X GIT revision.
>> >We have used last Alexandru-Sever Horin's version.
>> >
>> > git://github.com/alex-sever-h/microwin.git
>> >
>> >and have some minor patch for config. Jan Jan Dolezal should prepare
>> >it during his bachelor thesis. All is work in progress and we
>> >planned to announce our actual steps when we have more finished,
>> >but I am sending as much info now when there is and interrest
>> >to coordinate possible effort of others and do not repeat
>> >fails and looking for same corrections.
>> >
>> >Best wishes
>> >
>> > Pavel Pisa
>> > e-mail: ***@cmp.felk.cvut.cz
>> > www: http://cmp.felk.cvut.cz/~pisa
>> > university: http://dce.fel.cvut.cz/
>> > company: http://www.pikron.com/
>
黄喜
2014-04-15 01:40:32 UTC
Permalink
Hi Pavel,


I have a question to trouble you.
What's difference between scr_mx1sl.c and rtems-4.11\c\src\lib\libbsp\arm\gumstix\fb\fb.c ?


The scr_mx1sl.c from microwin\src\drivers, and the fb.c in BSP of RTEMS. I think scr_mx1sl.c tell Microwindows how to format the pixel data, and the fb.c tell RTEMS how to initialize the hardware .


So I think I need two files if I porting Microwindows into RTEMS, they all should be exist. Is right?








At 2014-04-14 20:48:33,"Pavel Pisa" <***@cmp.felk.cvut.cz> wrote:
>Hello all,
>
>On Sunday 13 of April 2014 06:13:59 Aaron J. Grier wrote:
>> there was some work done on the toolkit in 2012:
>> http://www.rtems.org/wiki/index.php/RTEMSGraphicsToolkit#Experimental_GSoC_
>>2012_Version_of_the_RTEMS_Graphics_Toolkit you should be able to leverage
>> this for your ARM project.
>>
>> I'm a bit out of touch with the current activities involving RTEMS and
>> Nano-X. The last project I worked on with RTEMS and Nano-X was
>> discontinued at the end of 2010.
>
>we are using Microwindows/Nano-X codebase together
>with our SuiTk GUI on RTEMS at company on ARM CSB336
>board.
>
>We have tested actual RTEMS git build for i386
>with Nano-X under QEMU with CIRRUS GD5446 driver
>developed during mentioned GSoC. The RTEMS configuration
>for that setup is described there
>
>http://www.rtems.org/wiki/index.php/RTEMSGraphicsToolkit#Running_RTEMS_Graphics_Toolkit_under_QEMU
>
>The use of Nano-X with RTEMS on embedded targets where
>framebuffer is simply mapped from fixed someaddress
>in fixed format is quite straightforward. I can provide
>some info and code which we use. I am attaching microwin-080121
>version of our adapted driver as example.
>
>When it is put into src/drivers directory and Nano-X are modified
>to build an use that "driver"/configuration then it can be
>used from application. I.e. calling GdOpenScreen() low level init.
>
>But such solution is not usable for PC and even on other targets
>it is bypassing RTEMS drivers framework.
>
>One of our students - Jan Dolezal - is working now on VESA BIOS
>Extension (VBE3) based solution for standard PC hardware.
>It should be integrated same as CIRRUS GD5446 driver into RTEMS
>mainline if he succeed. Unfortuantelly QEMU VESA BIOS does not
>provide VBE3 support but our initial check shows that most f real cards
>support it. So we hope to provide that solution and then next step
>is add layer to switch between three i386 (VGA, Cirrus and VBE3)
>graphic divers during startup phase. Problem is, that VGA is unusable
>with actual Nano-X because actual Nano-X deprecated/removes old
>planes based driver for ancient VGA hardware.
>
>The support for VBE3 requires application/driver configurable GDT
>entries. Jan Dolezal has already setup GIT repository with his work
>
> https://github.com/dolezaljan/rtems
>
>As for Nano-X build with use of do_it script, we have found some problem
>with actual version in
>
> git://git.rtems.org/rtems-graphics-toolkit.git
>
>The repo points to incorrect Nano-X GIT revision.
>We have used last Alexandru-Sever Horin's version.
>
> git://github.com/alex-sever-h/microwin.git
>
>and have some minor patch for config. Jan Jan Dolezal should prepare
>it during his bachelor thesis. All is work in progress and we
>planned to announce our actual steps when we have more finished,
>but I am sending as much info now when there is and interrest
>to coordinate possible effort of others and do not repeat
>fails and looking for same corrections.
>
>Best wishes
>
> Pavel Pisa
> e-mail: ***@cmp.felk.cvut.cz
> www: http://cmp.felk.cvut.cz/~pisa
> university: http://dce.fel.cvut.cz/
> company: http://www.pikron.com/
>
>
Loading...