Skip to contentSkip to conversation

SM501 framebuffer driver

DISCUSSION Bill Gatliff 8 participants 21 messages Oct 6, 2006 – Oct 16, 2006 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Guys:

Sorry about starting a new thread, but I was referred to this list/thread by a colleague just a few minutes ago. (OT: it isn't in the archives in SF, either!).

I hate to play "me too!", but I also have an SM501 framebuffer driver in a partial state of development. I'd love to collaborate with others to get a good version pushed upstream.

One of the challenges I've encountered with this chip is dealing with all the "other stuff" it has onboard. In my driver, I addressed that by creating a whole new bus similar to what Nico did for the UCB1400. I was in the process of getting AC97 working when I figured out that that part of the chip is so braindead, it isn't worth using--- at least on ARM platforms that don't have DMA (which was my case).

In an upcoming project I need to use the USBH, so I'll be revisiting this issue again soon. I have also cc'd others who have worked with me on this chip.

I'd be happy to post code if that makes sense. Or to host a CVS repo or something.

Kindest regards,

b.g.

Signature · 9 lines
Bill Gatliff
[email protected]


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
#1 lore raw
Quoted 18 lines · Bill Gatliff

Guys:

Sorry about starting a new thread, but I was referred to this list/thread by a colleague just a few minutes ago. (OT: it isn't in the archives in SF, either!).

I hate to play "me too!", but I also have an SM501 framebuffer driver in a partial state of development. I'd love to collaborate with others to get a good version pushed upstream.

One of the challenges I've encountered with this chip is dealing with all the "other stuff" it has onboard. In my driver, I addressed that by creating a whole new bus similar to what Nico did for the UCB1400. I was in the process of getting AC97 working when I figured out that that part of the chip is so braindead, it isn't worth using--- at least on ARM platforms that don't have DMA (which was my case).

Quoted 6 lines

In an upcoming project I need to use the USBH, so I'll be revisiting this issue again soon. I have also cc'd others who have worked with me on this chip.

I'd be happy to post code if that makes sense. Or to host a CVS repo or something.

We have a solution based on an central device in drivers/mfd which creates a set of sub-devices that are used by the invidicual drivers

Signature · 9 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
#2 lore raw
Quoted 7 lines · Ben Dooks

On Fri, Oct 06, 2006 at 11:11:46AM -0500, Bill Gatliff wrote:

We have a solution based on an central device in drivers/mfd which creates a set of sub-devices that are used by the invidicual drivers

Yes, I've seen your code. My SM501 code does something very similar. I don't know if there's any opportunity for reuse or to create a "standard", given that the SM501 is all over the place functionality (USB, AC97, framebuffer, UART, ...)-wise and bus (PCI, MMIO)-wise. But the general idea of your approach is definitely the right way to go.

b.g.

Signature · 9 lines
Bill Gatliff
[email protected]


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
#3 lore raw
In reply to Ben Dooks
Quoted 23 lines · Ben Dooks
Quoted 22 lines · Bill Gatliff

Guys:

Sorry about starting a new thread, but I was referred to this list/thread by a colleague just a few minutes ago. (OT: it isn't in the archives in SF, either!).

I hate to play "me too!", but I also have an SM501 framebuffer driver in a partial state of development. I'd love to collaborate with others to get a good version pushed upstream.

One of the challenges I've encountered with this chip is dealing with all the "other stuff" it has onboard. In my driver, I addressed that by creating a whole new bus similar to what Nico did for the UCB1400. I was in the process of getting AC97 working when I figured out that that part of the chip is so braindead, it isn't worth using--- at least on ARM platforms that don't have DMA (which was my case).

In an upcoming project I need to use the USBH, so I'll be revisiting this issue again soon. I have also cc'd others who have worked with me on this chip.

Quoted 7 lines
Quoted 2 lines

I'd be happy to post code if that makes sense. Or to host a CVS repo or something.

We have a solution based on an central device in drivers/mfd which creates a set of sub-devices that are used by the invidicual drivers

We too ;), and use on our board: http://www.varma-el.com/en/prod?cls=sbc

Anyone have objections about berlios.de SVN for a sm501 staff?

Andrey

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#4 lore raw

Andrey:

Quoted 5 lines · Andrey Volkov

We too ;), and use on our board: http://www.varma-el.com/en/prod?cls=sbc

Anyone have objections about berlios.de SVN for a sm501 staff?

Works for me! :)

Please post the URL when you have it.

b.g.

Signature · 9 lines
Bill Gatliff
[email protected]


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
#5 lore raw

Hello, Andrey!

Quoted 3 lines
Quoted 3 lines

We too ;), and use on our board: http://www.varma-el.com/en/prod?cls=sbc

Anyone have objections about berlios.de SVN for a sm501 staff?

Good start!
I am with berlios.de, too. For all the SM501 interested developers, please see:

https://developer.berlios.de/projects/sm5xx/

Best greets,

Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany

http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#6 lore raw
In reply to Bill Gatliff

Hello, Bill,

Quoted 3 lines

Sorry about starting a new thread, but I was referred to this list/thread by a colleague just a few minutes ago. (OT: it isn't in the archives in SF, either!).

Okay, fine! I'll be glad to join the party because we are using the SM501 on PCI of an MPC8540 embedded PowerPC.

Searching the list archives, about ten people have had (at least) some hands on the SM501 during the last year. I also got several questions about the driver status off list.

Quoted 3 lines

I hate to play "me too!", but I also have an SM501 framebuffer driver in a partial state of development. I'd love to collaborate with others to get a good version pushed upstream.

Great! Where shall we collect the code?
I have some

- a working fb driver kernel module
(I did lots of code cleanup, but still needs a lot)

- older Xfree86 driver (partially accelerated!?, never tried but code looks good)

- some collected MMCC (Multi Media Companion Chip) drivers/snippets for the other periperals besides the graphics part.

- kernel code for an functional complete(?) SM501 implementation for an RTS7751R2D Renesas SH-4 Board running Linux.

I am working on the latest 2.6.18 Kernels on PowerPC.
But I can also test the SM501 on PCI in an x86 since we have this PCI Demo Board with an SM501G8 AA.
On our PPC we use the SM501GF8 AB Chip Revision (F means: RoHS Version).

I also mirrored the Silicon Motion's FTP server with lots of Datasheets and reference designs.

Quoted 6 lines

One of the challenges I've encountered with this chip is dealing with all the "other stuff" it has onboard. In my driver, I addressed that by creating a whole new bus similar to what Nico did for the UCB1400. I was in the process of getting AC97 working when I figured out that that part of the chip is so braindead, it isn't worth using--- at least on ARM platforms that don't have DMA (which was my case).

Oh, I will need to get the AC97 working, too :-/ (my hardware is more or less ready to test some software)

Quoted 6 lines

In an upcoming project I need to use the USBH, so I'll be revisiting this issue again soon. I have also cc'd others who have worked with me on this chip.

I'd be happy to post code if that makes sense. Or to host a CVS repo or something.

Can you host a CVS repo at your place? I don't like SF much.

Best greets,

Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany

http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#7 lore raw

Clemens:

Quoted 2 lines · Clemens Koller

Great! Where shall we collect the code?

I have a co-lo machine that has space on it. I can set up a user account "sm501" and a CVS repository, but I'm such a lousy sysadmin, I don't know how to give others access to the repository without giving them all the login to the "sm501" account.

Can someone coach me through it? I just created the account now.

b.g.

Signature · 9 lines
Bill Gatliff
[email protected]


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

Clemens:

Quoted 3 lines · Clemens Koller

If you want I can spend an hour on that stuff if you give me an account on your machine.

Done. See your Inbox.

I think what makes sense is to have a public_html directory with subdirectories for each contribution that's been mentioned so far. Then we can collaborate on a CVS repository that blends the best bits of all the contributed code into one place.

Any volunteers? :)

b.g.

Signature · 9 lines
Bill Gatliff
[email protected]


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
#10 lore raw
In reply to Clemens Koller
Quoted 17 lines · Clemens Koller

Hello, Bill,

Quoted 3 lines

Sorry about starting a new thread, but I was referred to this list/thread by a colleague just a few minutes ago. (OT: it isn't in the archives in SF, either!).

Okay, fine! I'll be glad to join the party because we are using the SM501 on PCI of an MPC8540 embedded PowerPC.

Searching the list archives, about ten people have had (at least) some hands on the SM501 during the last year. I also got several questions about the driver status off list.

Quoted 3 lines

I hate to play "me too!", but I also have an SM501 framebuffer driver in a partial state of development. I'd love to collaborate with others to get a good version pushed upstream.

Quoted 8 lines

Great! Where shall we collect the code?
I have some

- a working fb driver kernel module
(I did lots of code cleanup, but still needs a lot)

- older Xfree86 driver (partially accelerated!?, never tried but code looks good)

As I mentioned earlier, with the exception of dualhead, I've got a working xorg smi501 driver. I'll be adding it to xorg git once I get dualhead working and a few other odds and ends worked out.

Alex

Quoted 48 lines

- some collected MMCC (Multi Media Companion Chip) drivers/snippets for the other periperals besides the graphics part.

- kernel code for an functional complete(?) SM501 implementation for an RTS7751R2D Renesas SH-4 Board running Linux.

I am working on the latest 2.6.18 Kernels on PowerPC.
But I can also test the SM501 on PCI in an x86 since we have this PCI Demo Board with an SM501G8 AA.
On our PPC we use the SM501GF8 AB Chip Revision (F means: RoHS Version).

I also mirrored the Silicon Motion's FTP server with lots of Datasheets and reference designs.

Quoted 6 lines

One of the challenges I've encountered with this chip is dealing with all the "other stuff" it has onboard. In my driver, I addressed that by creating a whole new bus similar to what Nico did for the UCB1400. I was in the process of getting AC97 working when I figured out that that part of the chip is so braindead, it isn't worth using--- at least on ARM platforms that don't have DMA (which was my case).

Oh, I will need to get the AC97 working, too :-/ (my hardware is more or less ready to test some software)

Quoted 6 lines

In an upcoming project I need to use the USBH, so I'll be revisiting this issue again soon. I have also cc'd others who have worked with me on this chip.

I'd be happy to post code if that makes sense. Or to host a CVS repo or something.

Can you host a CVS repo at your place? I don't like SF much.

Best greets,

Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany

http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19

Quoted 10 lines

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Linux-fbdev-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#11 lore raw
In reply to Clemens Koller
Quoted 8 lines · Clemens Koller

Hello, Bill,

Quoted 3 lines

Sorry about starting a new thread, but I was referred to this list/thread by a colleague just a few minutes ago. (OT: it isn't in the archives in SF, either!).

Okay, fine! I'll be glad to join the party because we are using the SM501 on PCI of an MPC8540 embedded PowerPC.

I'm using an ARM board. The CPU is an Atmel AT91RM9200, and the SM501 is connected to it via a CPLD.

Quoted 9 lines
Quoted 3 lines

I hate to play "me too!", but I also have an SM501 framebuffer driver in a partial state of development. I'd love to collaborate with others to get a good version pushed upstream.

Great! Where shall we collect the code?
I have some

- a working fb driver kernel module
(I did lots of code cleanup, but still needs a lot)

Me too here :) My changes to the original sm501 fb driver include:
- Use dev_dbg instead of custom macro
- video= command line parsing
- Better checking in check_var
- Started to implement setcolreg and panning, not finished
- Removed duplicated code
- Tried to make code more readable :)
- Maybe something else (I didn't keep track

I also started to write an ALSA driver for the audio part. I wrote the basic driver skeleton, and my next step was going to be the 8051, but then I got distracted by other stuff. My plan was to start off with some very simple code for the 8051 which would just issue an interrupt at some interval so I could just see how the CPU<->8051 communication works. I'll try dig up the code in case someone wants to take a look.

Like I mentioned in the other thread I also wrote a DirectFB gfxdriver. It does basic blitting and filling for now. I tried to make it draw lines too but that caused the chip to lock up, and I tried to use alpha bleded blits but those seem to make the chip really sluggish to respond.

Signature · 9 lines
Ville Syrjälä
[email protected]
http://www.sci.fi/~syrjala/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
#12 lore raw
In reply to Clemens Koller
Quoted 6 lines · Clemens Koller

Great! Where shall we collect the code?
I have some

- a working fb driver kernel module
(I did lots of code cleanup, but still needs a lot)

There's at least half a dozen of these floating around, with some disagreement on the actual implementation. We had one in the old SH tree that specifically registered a different framebuffer device for each plane, which we had some code in DirectFB and mplayer for making use of for overlays and so on.

There's also another framebuffer driver for this in the Linux/MIPS tree that's reasonably clean and might make a better starting point. The main issue is supporting both PCI and platform device handling from the same driver, since there seem to be just as many in both configurations floating around.

Quoted 3 lines

- kernel code for an functional complete(?) SM501 implementation for an RTS7751R2D Renesas SH-4 Board running Linux.

It's largely complete, yes, but most of the code is fairly messy, or against outdated APIs. It might make a good reference point, but little else. The OHCI and i2c drivers are probably the "cleanest" out of these, though I haven't gotten around to tidying them up and merging them in to mainline as of yet. It might be beneficial to get these in to your sm5xx tree though, before we end up having even more duplication (it seems there already is with i2c..).

The OHCI thing was a bit of a mess since the DMA requests need to be in the 8051 address space via the accessible SRAM there. You can see our lame allocator for that in arch/sh/cchips/voyagergx/consistent.c.

Quoted 3 lines

Oh, I will need to get the AC97 working, too :-/ (my hardware is more or less ready to test some software)

We also have an OSS driver for SM501, but it contains a lot of 8051 microcode that needs to be shoved in to userspace, and it needs to be reworked for ALSA.

It should be fairly trivial to rework this for the mfd approach and work from there, which I'll look at doing if no one beats me to it and I finish some more pressing matters first.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#13 lore raw

Hi Paul,

Quoted 4 lines · Paul Mundt
Quoted 3 lines · Clemens Koller

Great! Where shall we collect the code?
I have some

Quoted 8 lines
Quoted 3 lines

- a working fb driver kernel module
(I did lots of code cleanup, but still needs a lot)

There's at least half a dozen of these floating around, with some disagreement on the actual implementation. We had one in the old SH tree that specifically registered a different framebuffer device for each plane, which we had some code in DirectFB and mplayer for making use of for overlays and so on.

IMHO, its very awkward implementation for real world application, especially since, as ex, alpha/video planes is coupled with panel plane but not with CRT plane. We currently try use sm501 as two fb (crt/panel) devices.

Quoted 7 lines

There's also another framebuffer driver for this in the Linux/MIPS tree that's reasonably clean and might make a better starting point. The main issue is supporting both PCI and platform device handling from the same driver, since there seem to be just as many in both configurations floating around.

PCI and MMIO modes of SM501 is mutually exclusive, so it should be selected at configure time (as I already does, check my implementation in svn).

Quoted 18 lines
Quoted 3 lines

- kernel code for an functional complete(?) SM501 implementation for an RTS7751R2D Renesas SH-4 Board running Linux.

It's largely complete, yes, but most of the code is fairly messy, or against outdated APIs. It might make a good reference point, but little else. The OHCI and i2c drivers are probably the "cleanest" out of these, though I haven't gotten around to tidying them up and merging them in to mainline as of yet. It might be beneficial to get these in to your sm5xx tree though, before we end up having even more duplication (it seems there already is with i2c..).

The OHCI thing was a bit of a mess since the DMA requests need to be in the 8051 address space via the accessible SRAM there. You can see our lame allocator for that in arch/sh/cchips/voyagergx/consistent.c.

Quoted 3 lines

Oh, I will need to get the AC97 working, too :-/ (my hardware is more or less ready to test some software)

Quoted 7 lines

We also have an OSS driver for SM501, but it contains a lot of 8051 microcode that needs to be shoved in to userspace, and it needs to be reworked for ALSA.

It should be fairly trivial to rework this for the mfd approach and work from there, which I'll look at doing if no one beats me to it and I finish some more pressing matters first.

Nice, but please, do it vs berlios svn.

P.S. I repeat my invitation, sm5xx svn/maillists is up and ready.

Andrey

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#14 lore raw
Quoted 11 lines · Andrey Volkov
Quoted 5 lines · Paul Mundt

There's at least half a dozen of these floating around, with some disagreement on the actual implementation. We had one in the old SH tree that specifically registered a different framebuffer device for each plane, which we had some code in DirectFB and mplayer for making use of for overlays and so on.

IMHO, its very awkward implementation for real world application, especially since, as ex, alpha/video planes is coupled with panel plane but not with CRT plane. We currently try use sm501 as two fb (crt/panel) devices.

Awkward as it may be, there are plenty of users going with this approach, and DirectFB has been using it for quite some time. If you don't care for this approach, do you have a better idea for exposing individual planes to userspace and fine-grained overlay control? Multiple device nodes are a lot more pleasant to look at than an ioctl abortion.

Quoted 4 lines

PCI and MMIO modes of SM501 is mutually exclusive, so it should be selected at configure time (as I already does, check my implementation in svn).

The driver still requires visibility of these two things. Looking at the fb driver, it's clear you have no transparent means for gauging the aperture size. With PCI this comes down to sizing the membar, and in the platform case it can be statically defined at registration time too.

This will never work on a system where you have a platform bus SM501 with an SM501 on a PCI add-in board, you simply can not gaurantee that they are exclusive.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#15 lore raw
In reply to Paul Mundt

Hello, Paul!

Thank you for your comments! I'll have to dig through the code to see of what we can use there.
Since I don't want to re-invent the wheel, I am curious how we get the driver cross-platform'ish. Hmm... no big ideas yet.

Quoted 3 lines

It should be fairly trivial to rework this for the mfd approach and work from there, which I'll look at doing if no one beats me to it and I finish some more pressing matters first.

The MultiFunctionDevice (mfd) approach looks good to me. I'll be glad to have you onboard! :-)

Best greets,

Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany

http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#16 lore raw

Hi, Clemens

Quoted 7 lines · Clemens Koller

Hello, Paul!

Thank you for your comments! I'll have to dig through the code to see of what we can use there.
Since I don't want to re-invent the wheel, I am curious how we get the driver cross-platform'ish. Hmm... no big ideas yet.

Quoted 7 lines
Quoted 3 lines

It should be fairly trivial to rework this for the mfd approach and work from there, which I'll look at doing if no one beats me to it and I finish some more pressing matters first.

The MultiFunctionDevice (mfd) approach looks good to me. I'll be glad to have you onboard! :-)

As I already wrote before, check sm5xx svn ;). And may be continue this this thread in directly sm5xx-devel?

Andrey

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#17 lore raw
In reply to Paul Mundt
Quoted 5 lines · Paul Mundt

We also have an OSS driver for SM501, but it contains a lot of 8051 microcode that needs to be shoved in to userspace, and it needs to be reworked for ALSA.

Hi Paul! Long time no chat! :)

One thing that concerns me about all of the ALSA implementations I've seen so far is that the source code for the 8051 side is never included. GPL questions aside, for legacy reasons alone we've got to make sure that stuff gets in too.

But then again, there's the question of where the source code is at all, and what toolsystem you use to produce the binary image...

b.g.

Signature · 12 lines
Bill Gatliff
[email protected]





-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
#18 lore raw

Hi Bill, fancy seeing you in this thread ;-)

Quoted 5 lines · William A. Gatliff

One thing that concerns me about all of the ALSA implementations I've seen so far is that the source code for the 8051 side is never included. GPL questions aside, for legacy reasons alone we've got to make sure that stuff gets in too.

We want the 8051 blob in userspace if anything, there's little reason to tie this in to the module specifically, and it's handy to expose the interface for people that are specifically interested in loading in alternate code on the 8051.

As far as including source for the 8051 code itself, that would be nice to have, but I doubt it's something the majority of users are going to care about. I've certainly never seen any.

Quoted 3 lines

But then again, there's the question of where the source code is at all, and what toolsystem you use to produce the binary image...

I suspect it's just a simple binary blob and little else, there's certainly no infrastructure in the loading side for dealing with anything more elaborate, and it is just a stupid 8051 after all. Taking and disassembling the thing will likely get you as close as to what the real source looks like as anything else, but again, most people aren't going to have a use for this.

Kbuild also doesn't have a simple facility for mapping in multiple cross compilers depending on target preference, which is one of the things we hit when trying to figure out how to interface the ARM7 firmware build for the AICA on the Dreamcast (prior to the request_firmware() interface being added). This is now handled by pushing everything to userspace, which seems the obvious choice for the 8051, too.

On that note, do you have a pointer to some of the various ALSA implementations that are floating around? I've only seen the OSS driver we had in CVS, and that provides a rather dysmal starting point..

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#19 lore raw

Paul:

Quoted 3 lines · Paul Mundt

Hi Bill, fancy seeing you in this thread ;-)

Heh, you need to talk to the guy at the door. He'll let anyone in, I'm proof! :)

Quoted 10 lines

We want the 8051 blob in userspace if anything, there's little reason to tie this in to the module specifically, and it's handy to expose the interface for people that are specifically interested in loading in alternate code on the 8051.

As far as including source for the 8051 code itself, that would be nice to have, but I doubt it's something the majority of users are going to care about. I've certainly never seen any.

I totally agree on all points. But I hate blobs. If the source code is around, I'd love to have it recorded somewhere even though we all know that Kbuild and most users won't know what to do with it. Just In Case.

Do we even know where this blob came from originally?

Quoted 5 lines

On that note, do you have a pointer to some of the various ALSA implementations that are floating around? I've only seen the OSS driver we had in CVS, and that provides a rather dysmal starting point..

Whaley sent me one just last week (hi Robert!). Given that, I don't suppose he'd mind my forwarding the patch on. What makes it tricky to do so is that the patch is against his highly-evolved sm501 driver stack, so there will be some mending required.

Yet another reason why we've all got to get all this stuff together. The SM501 is a decent chip, and there's too few of us to go around re-inventing the wheel.

b.g.

Signature · 9 lines
Bill Gatliff
[email protected]


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
#20 lore raw
Quoted 25 lines · Bill Gatliff

Paul:

Quoted 3 lines · Paul Mundt

Hi Bill, fancy seeing you in this thread ;-)

Heh, you need to talk to the guy at the door. He'll let anyone in, I'm proof! :)

Quoted 10 lines

We want the 8051 blob in userspace if anything, there's little reason to tie this in to the module specifically, and it's handy to expose the interface for people that are specifically interested in loading in alternate code on the 8051.

As far as including source for the 8051 code itself, that would be nice to have, but I doubt it's something the majority of users are going to care about. I've certainly never seen any.

I totally agree on all points. But I hate blobs. If the source code is around, I'd love to have it recorded somewhere even though we all know that Kbuild and most users won't know what to do with it. Just In Case.

Do we even know where this blob came from originally?

Quoted 7 lines
Quoted 5 lines

On that note, do you have a pointer to some of the various ALSA implementations that are floating around? I've only seen the OSS driver we had in CVS, and that provides a rather dysmal starting point..

Whaley sent me one just last week (hi Robert!). Given that, I don't suppose he'd mind my forwarding the patch on.

Not at all. BTW: we use this (moderately buggy) compiler to compile the 8051 code:

http://sourceforge.net/project/showfiles.php?group_id=599

Between the bugs in the compiler and the absence of documentation in the SM501 manual about 8051 interrupts, etc. It was pretty difficult making this work.

Don't try anything remotely like this with this compiler:

u8 a, b;
u32 c;

   c |= a << b;

That's why all the registers are u8 instead of u32.

Quoted 9 lines

What makes it tricky to
do so is that the patch is against his highly-evolved sm501 driver stack, so there will be some mending required.

Yet another reason why we've all got to get all this stuff together. The SM501 is a decent chip, and there's too few of us to go around re-inventing the wheel.

b.g.

Signature · 3 lines
Robert Whaley
Applied Data Systems            www.applieddata.net
434-244-9504		    [email protected]
arch/arm/common/sm501.c +12 -1
diff -urN linux-2.6.17.9.orig/arch/arm/common/sm501.c linux-2.6.17.9/arch/arm/common/sm501.c
@@ -137,7 +137,11 @@
 	DPRINTK(" %s: %p %#lx (%p %#lx)\n", __FUNCTION__,
 		virt, ((virt - sm501Mem) + sm501Phy), sm501Mem, sm501Phy);
 
-	return (virt - sm501Mem) + sm501Phy;
+	if ((sm501Reg > sm501Mem && virt >= sm501Reg) ||
+	    (sm501Reg <= sm501Mem && virt < sm501Mem))
+		return (virt - sm501Reg) + sm501PR;
+	else
+		return (virt - sm501Mem) + sm501Phy;
 }
 
 unsigned long sm501_phys_to_offset(unsigned long phys)
@@ -317,6 +321,13 @@
 
 	DPRINTK(" %s: size %d, virt %p, handle %x\n", __func__, size, virt, handle);
 
+	/* check for 8051 memory */
+	if ((sm501Reg > sm501Mem && virt >= sm501Reg) ||
+	    (sm501Reg <= sm501Mem && virt < sm501Mem)) {
+		/* if 8051 don't do anything! */
+		return;
+	}
+
 	list_for_each_entry(mem_lst, &sm501_mem_list_head, list) {
 		if (mem_lst->address == virt) {
 			sm501_free(virt);
arch/arm/configs/adsportal_defconfig +91 -16

128 lines not on this page · raw message

include/asm-arm/hardware/sm501.h +6 -0
diff -urN linux-2.6.17.9.orig/include/asm-arm/hardware/sm501.h linux-2.6.17.9/include/asm-arm/hardware/sm501.h
@@ -2305,6 +2305,11 @@
 // CPU Protocol Interrupt
 #define UC8051_INT_CPU					0x0B000C
 
+#define UC8051_PRIVATE_SRAM                             0x0C0000
+#define UC8051_PRIVATE_SRAM_LEN                         0x003000
+#define UC8051_SHARED_SRAM                              0x0C3000
+#define UC8051_SHARED_SRAM_LEN                          0x001000
+
 ////////////////////////////////////////////////////////////////////////////////
 //                                                                            //
 // D I S P L A Y   C O N T R O L L E R                                        //
@@ -2479,6 +2484,7 @@
 	struct device	dev;
 	unsigned int	devid;
 	u64		dma_mask;
+	void		*private;
 };
 
 #define SM501_DEV(_d)	container_of((_d), struct sm501_dev, dev)
sound/arm/Kconfig +13 -0
diff -urN linux-2.6.17.9.orig/sound/arm/Kconfig linux-2.6.17.9/sound/arm/Kconfig
@@ -33,4 +33,17 @@
 	  Say Y or M if you want to support any AC97 codec attached to
 	  the PXA2xx AC97 interface.
 
+config SND_SM501_PCM
+	tristate
+	select SND_PCM
+
+config SND_SM501_AC97
+	tristate "AC97 driver for the Silicon Motion SM501 chip"
+	depends on SND
+	select SND_SM501_PCM
+	select SND_AC97_CODEC
+	help
+	  Say Y or M if you want to support any AC97 codec attached to
+	  the SM501 AC97 interface.
+
 endmenu
sound/arm/Makefile +6 -0
diff -urN linux-2.6.17.9.orig/sound/arm/Makefile linux-2.6.17.9/sound/arm/Makefile
@@ -13,3 +13,9 @@
 
 obj-$(CONFIG_SND_PXA2XX_AC97)	+= snd-pxa2xx-ac97.o
 snd-pxa2xx-ac97-objs		:= pxa2xx-ac97.o
+
+obj-$(CONFIG_SND_SM501_PCM)	+= snd-sm501-pcm.o
+snd-sm501-pcm-objs		:= sm501-pcm.o
+
+obj-$(CONFIG_SND_SM501_AC97)	+= snd-sm501-ac97.o
+snd-sm501-ac97-objs		:= sm501-ac97.o
sound/arm/sm501-ac97.c +674 -0

674 lines not on this page · raw message

sound/arm/sm501-pcm.c +259 -0

259 lines not on this page · raw message

sound/arm/sm501-pcm.h +29 -0
diff -urN linux-2.6.17.9.orig/sound/arm/sm501-pcm.h linux-2.6.17.9/sound/arm/sm501-pcm.h
@@ -0,0 +1,29 @@
+/*
+ * linux/sound/arm/sm501-pcm.h -- ALSA PCM interface for the SM501 chip
+ *
+ * Author:	Robert Whaley
+ * Created:	Oct 2, 2006
+ * Copyright:	Applied Data Systems, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define TX_BUF_SIZE 2048
+#define RX_BUF_SIZE 1024
+
+#define TX_BUF_OFFSET 2048
+#define RX_BUF_OFFSET 1024
+
+struct sm501_pcm_client {
+	int (*prepare)(struct snd_pcm_substream *);
+	snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *);
+	void (*start_pcm)(struct snd_pcm_substream *);
+	void (*stop_pcm)(struct snd_pcm_substream *);
+	void (*set_period_sz)(struct snd_pcm_substream *, int);
+	void (*set_buffer_sz)(struct snd_pcm_substream *, int);
+};
+
+extern int sm501_pcm_new(struct snd_card *, struct sm501_pcm_client *, struct snd_pcm **pcm);
+
sound/arm/sm501_ac97_8051.c +661 -0

661 lines not on this page · raw message

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Linux-fbdev-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel

#21 lore raw
Quoted 51 lines · Robert Whaley
Quoted 30 lines · Bill Gatliff

Paul:

Quoted 3 lines · Paul Mundt

Hi Bill, fancy seeing you in this thread ;-)

Heh, you need to talk to the guy at the door. He'll let anyone in, I'm proof! :)

Quoted 11 lines

We want the 8051 blob in userspace if anything, there's little reason to
tie this in to the module specifically, and it's handy to expose the interface for people that are specifically interested in loading in alternate code on the 8051.

As far as including source for the 8051 code itself, that would be nice to have, but I doubt it's something the majority of users are going to care about. I've certainly never seen any.

I totally agree on all points. But I hate blobs. If the source code is around, I'd love to have it recorded somewhere even though we all know that Kbuild and most users won't know what to do with it. Just In Case.

Do we even know where this blob came from originally?

Quoted 8 lines
Quoted 5 lines

On that note, do you have a pointer to some of the various ALSA implementations that are floating around? I've only seen the OSS driver we had in CVS, and that provides a rather dysmal starting point..

Whaley sent me one just last week (hi Robert!). Given that, I don't suppose he'd mind my forwarding the patch on.

Not at all. BTW: we use this (moderately buggy) compiler to compile the 8051 code:

http://sourceforge.net/project/showfiles.php?group_id=599

Between the bugs in the compiler and the absence of documentation in
the SM501 manual about 8051 interrupts, etc. It was pretty difficult
making this work.

Quoted 8 lines

Don't try anything remotely like this with this compiler:

u8 a, b;
u32 c;

   c |= a << b;

WTF?! :)

And here I was thinking that SDCC was probably pretty good...

sound/arm/sm501_ac97_8051.c line 116

Quoted 10 lines
sound/arm/sm501_ac97_8051.c +8 -0
+
+/* There are 2 copies of shared because the shared SRAM is not safe if
+ * the 8051 is reading/writing to a location while the CPU is
+ * writing/reading the same location (according to the SM501 manual
+ * and verified by tests).  So 2 redundant copies are maintained and
+ * for the contents to be considered valid the same data must be
+ * present in both copies.
+ */

Classic SM501. "Here's a feature that works.... but it doesn't!" :)

b.g.

Signature · 9 lines
Bill Gatliff
[email protected]


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642