You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
(82) |
Jun
(72) |
Jul
(39) |
Aug
(104) |
Sep
(61) |
Oct
(55) |
Nov
(101) |
Dec
(48) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(52) |
Feb
(67) |
Mar
(18) |
Apr
(16) |
May
(33) |
Jun
(12) |
Jul
(102) |
Aug
(168) |
Sep
(65) |
Oct
(60) |
Nov
(43) |
Dec
(121) |
2002 |
Jan
(69) |
Feb
(32) |
Mar
(90) |
Apr
(59) |
May
(45) |
Jun
(43) |
Jul
(33) |
Aug
(21) |
Sep
(11) |
Oct
(20) |
Nov
(26) |
Dec
(3) |
2003 |
Jan
(12) |
Feb
(18) |
Mar
(11) |
Apr
(11) |
May
(41) |
Jun
(76) |
Jul
(77) |
Aug
(15) |
Sep
(38) |
Oct
(56) |
Nov
(19) |
Dec
(39) |
2004 |
Jan
(17) |
Feb
(52) |
Mar
(36) |
Apr
(34) |
May
(48) |
Jun
(85) |
Jul
(38) |
Aug
(42) |
Sep
(41) |
Oct
(77) |
Nov
(27) |
Dec
(19) |
2005 |
Jan
(32) |
Feb
(35) |
Mar
(29) |
Apr
(8) |
May
(7) |
Jun
(31) |
Jul
(46) |
Aug
(93) |
Sep
(65) |
Oct
(85) |
Nov
(219) |
Dec
(47) |
2006 |
Jan
(170) |
Feb
(103) |
Mar
(49) |
Apr
(43) |
May
(45) |
Jun
(29) |
Jul
(77) |
Aug
(82) |
Sep
(43) |
Oct
(45) |
Nov
(26) |
Dec
(85) |
2007 |
Jan
(42) |
Feb
(48) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(53) |
Jul
(175) |
Aug
(212) |
Sep
(91) |
Oct
(103) |
Nov
(110) |
Dec
(5) |
2008 |
Jan
(20) |
Feb
(11) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(5) |
Sep
(3) |
Oct
(12) |
Nov
|
Dec
|
From: Fabio G. <fab...@au...> - 2008-01-18 16:48:24
|
I got the c,c++ compilers, on top of uClibc. If you like I send you the patch. Best regards Alle 11:44, domenica 9 dicembre 2007, Fabio Giovagnini ha scritto: > Hi Julian, > BSP for sh7263 which linux branch is part of? > Is it public and available the access to the toolchain source? > > Thanks a lot > > Alle 16:16, venerd=EC 7 dicembre 2007, Julian Back ha scritto: > > Hi Fabio, > > > > No we did not start with buildroot. The SH7203 BSP was derived from a > > BSP for SH7263 which was not developed by us. Whether that was derived > > from buildroot I don't know. > > > > Julian > > > > Fabio Giovagnini wrote: > > > Hi Julian, > > > only a simple question. > > > Is your uClinux environemnt derived directly from build root? > > > > > > Thanks in advance. > > > > > > Alle 17:53, mercoled=EC 5 dicembre 2007, Julian Back ha scritto: > > >> Fabio Giovagnini wrote: > > >>> I bought an evaluation bouard made by MPC data. > > >>> For 7203 the suggest to use uCLinux. > > >>> But they are sponsor of shlinux.com and if I remember properly they > > >>> suggestied to use linux-sh for the other eva boards than 7203. > > >>> According to you is uCLinux the best available choice for sh2a 7203? > > >> > > >> The board is actually made by Renesas, we (MPC Data) have done the > > >> Linux BSP. > > >> > > >> One of my colleagues has been tasked with integrating some of our BS= Ps > > >> with the main sh tree, this includes SH7203. It's at an early stage > > >> at the moment, he's just working out what needs to be done, but I ho= pe > > >> you will see some submissions from him in the not too distant future. > > >> > > >> Julian =2D-=20 =46abio Giovagnini Aurion s.r.l. via degli orti 11, 40050 Funo di Argelato (BO) P.I e C.F. 00885711200 Tel. +39.335.8350919 =46ax +39.051.8659009 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini |
From: Fabio G. <fab...@au...> - 2008-01-07 11:52:48
|
Hi, I get such an error. checking how to run the C preprocessor... /home/fgiovagnini/sh7203-uClinux-1.4/build/stage/gcc/gcc/xgcc -B/home/fgiovagnini/sh7203-uClinux-1.4/build/stage/gcc/gcc/ -B/home/fgiovagnini/sh7203-uClinux-1.4/build/target/sh-linux/bin/ -B/home/fgiovagnini/sh7203-uClinux-1.4/build/target/sh-linux/lib/ -isystem /home/fgiovagnini/sh7203-uClinux-1.4/build/target/sh-linux/include -isystem /home/fgiovagnini/sh7203-uClinux-1.4/build/target/sh-linux/sys-include -E checking for egrep... grep -E checking for ANSI C header files... no checking for sys/types.h... no checking for sys/stat.h... no checking for stdlib.h... no checking for string.h... no checking for memory.h... no checking for strings.h... no checking for inttypes.h... no checking for stdint.h... no checking for unistd.h... no checking for C locale to use... generic checking for std::allocator base class to use... new configure: "C" header strategy set to c_std checking for ISO C99 support in <math.h>... no checking for ISO C99 support in <stdio.h>... no checking for lldiv_t declaration... no checking for ISO C99 support in <stdlib.h>... no checking for additional ISO C99 support in <wchar.h>... no checking for enabled ISO C99 support... no checking for thread model used by GCC... single configure: Debug build flags set to -g3 -O0 checking for additional debug build... no checking for extra compiler flags for building... configure: WARNING: No native atomic operations are provided for this platform. configure: WARNING: They cannot be faked when thread support is disabled. configure: WARNING: Thread-safety of certain classes is not guaranteed. checking nan.h usability... no checking nan.h presence... no checking for nan.h... no checking ieeefp.h usability... no checking ieeefp.h presence... no checking for ieeefp.h... no checking endian.h usability... no checking endian.h presence... no checking for endian.h... no checking sys/isa_defs.h usability... no checking sys/isa_defs.h presence... no checking for sys/isa_defs.h... no checking machine/endian.h usability... no checking machine/endian.h presence... no checking for machine/endian.h... no checking machine/param.h usability... no checking machine/param.h presence... no checking for machine/param.h... no checking sys/machine.h usability... no checking sys/machine.h presence... no checking for sys/machine.h... no checking for sys/types.h... (cached) no checking fp.h usability... no checking fp.h presence... no checking for fp.h... no checking float.h usability... no checking float.h presence... yes configure: WARNING: float.h: present but cannot be compiled configure: WARNING: float.h: check for missing prerequisite headers? configure: WARNING: float.h: see the Autoconf documentation configure: WARNING: float.h: section "Present But Cannot Be Compiled" configure: WARNING: float.h: proceeding with the preprocessor's result configure: WARNING: float.h: in the future, the compiler will take precedence configure: WARNING: ## ----------------------------------------- ## configure: WARNING: ## Report this to the package-unused lists. ## configure: WARNING: ## ----------------------------------------- ## checking for float.h... yes checking for endian.h... (cached) no checking for inttypes.h... (cached) no checking locale.h usability... no checking locale.h presence... no checking for locale.h... no checking for float.h... (cached) yes checking for stdint.h... (cached) no checking for main in -lm... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. make[3]: *** [configure-target-libstdc++-v3] Error 1 make[3]: Leaving directory `/home/fgiovagnini/sh7203-uClinux-1.4/build/stage/gcc' make[2]: *** [build] Error 2 make[2]: Leaving directory `/home/fgiovagnini/sh7203-uClinux-1.4/build' make[1]: *** [gcc-3.4.6] Error 2 make[1]: Leaving directory `/home/fgiovagnini/sh7203-uClinux-1.4/build' make: *** [/home/fgiovagnini/sh7203-uClinux-1.4/build/target/.toolchain] Error 2 How can I check? Best Regards Alle 10:59, domenica 6 gennaio 2008, Kieran Bingham ha scritto: > Fabio, > > The buildscripts that make the BSP also make the toolchain, - so you > could potentially look into adding C++ to the toolchain yourself. > I didn't look into it at the time, as I was on short timescales - and > only needed a c compiler. > > I don't know what's involved in adding extra languages - but if you > look in the build folder, at Makefile.gcc-3.4.6 the configure line is > in there. > Looking at it, it could be as simple as changing the line > > --enable-languages="c" > to > --enable-languages="c,c++" > > I have no idea if it will be that simple or if you will hit any problems - > > change the build script > type make distclean (important as the scripts won't know to rebuild > the toolchain) > then make > > And let us know how it goes - if it works with no problems I'll try to > ensure that c++ is enabled by default in the future. > -- > Kieran Bingham > > On 05/01/2008, Fabio Giovagnini <fab...@au...> wrote: > > Hi, > > I'd like to run qt embedded on my sh2a 7203 eva board. > > MCP data gave me with the board the uClinux tree working with the BSP > > working properly; but in the tool chain there is only gcc and not g++ so > > I cannot try to build qt embedded. > > I'd like to keep in place the tree from MCP data because of it has the > > BSP properly configured and workign so I do not stend time to do the same > > from scratch, btu I would only replase teh toolchain; > > How could I procede? > > > > Thanks a lot. > > na d Best Regards > > > > > > -- > > Fabio Giovagnini > > > > Aurion s.r.l. > > via degli orti 11, > > 40050 Funo di Argelato (BO) > > P.I e C.F. > > 00885711200 > > Tel. +39.335.8350919 > > Fax +39.051.8659009 > > > > www.aurion-tech.com > > > > account telefono VoIP skype (www.skype.com): > > aurion.giovagnini > > - > > To unsubscribe from this list: send the line "unsubscribe linux-sh" in > > the body of a message to maj...@vg... > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > - > To unsubscribe from this list: send the line "unsubscribe linux-sh" in > the body of a message to maj...@vg... > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Fabio Giovagnini Aurion s.r.l. via degli orti 11, 40050 Funo di Argelato (BO) P.I e C.F. 00885711200 Tel. +39.335.8350919 Fax +39.051.8659009 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini |
From: Julian B. <jb...@mp...> - 2007-12-07 15:17:11
|
Hi Fabio, No we did not start with buildroot. The SH7203 BSP was derived from a BSP for SH7263 which was not developed by us. Whether that was derived from buildroot I don't know. Julian Fabio Giovagnini wrote: > Hi Julian, > only a simple question. > Is your uClinux environemnt derived directly from build root? > > Thanks in advance. > > > > Alle 17:53, mercoledì 5 dicembre 2007, Julian Back ha scritto: > >> Fabio Giovagnini wrote: >> >>> I bought an evaluation bouard made by MPC data. >>> For 7203 the suggest to use uCLinux. >>> But they are sponsor of shlinux.com and if I remember properly they >>> suggestied to use linux-sh for the other eva boards than 7203. >>> According to you is uCLinux the best available choice for sh2a 7203? >>> >> The board is actually made by Renesas, we (MPC Data) have done the Linux >> BSP. >> >> One of my colleagues has been tasked with integrating some of our BSPs >> with the main sh tree, this includes SH7203. It's at an early stage at >> the moment, he's just working out what needs to be done, but I hope you >> will see some submissions from him in the not too distant future. >> >> Julian >> > > -- Julian Back, Consultant Software Engineer MPC Data Limited e-mail: jb...@mp... web: www.mpc-data.co.uk tel: +44 (0) 1225 710600 fax: +44 (0) 1225 710601 ddi: +44 (0) 1225 710620 MPC Data Limited is a company registered in England and Wales with company number 1877740 Registered Address: County Gate, County Way, Trowbridge, Wiltshire, BA14 7FJ VAT no: 850625238 The information in this email and in the attached documents is confidential and may be legally privileged. Any unauthorized review, copying, disclosure or distribution is prohibited and may be unlawful. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. When addressed to our clients any opinions or advice contained in this email is subject to the terms and conditions expressed in the governing contract. |
From: Fabio G. <fab...@au...> - 2007-12-06 19:19:13
|
Hi Julian, only a simple question. Is your uClinux environemnt derived directly from build root? Thanks in advance. Alle 17:53, mercoled=EC 5 dicembre 2007, Julian Back ha scritto: > Fabio Giovagnini wrote: > > I bought an evaluation bouard made by MPC data. > > For 7203 the suggest to use uCLinux. > > But they are sponsor of shlinux.com and if I remember properly they > > suggestied to use linux-sh for the other eva boards than 7203. > > According to you is uCLinux the best available choice for sh2a 7203? > > The board is actually made by Renesas, we (MPC Data) have done the Linux > BSP. > > One of my colleagues has been tasked with integrating some of our BSPs > with the main sh tree, this includes SH7203. It's at an early stage at > the moment, he's just working out what needs to be done, but I hope you > will see some submissions from him in the not too distant future. > > Julian =2D-=20 =46abio Giovagnini Aurion s.r.l. via degli orti 11, 40050 Funo di Argelato (BO) P.I e C.F. 00885711200 Tel. +39.335.8350919 =46ax +39.051.8659009 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini |
From: Fabio G. <fab...@au...> - 2007-12-05 18:59:22
|
Why the toolchain provided with the board use for compiling the bootstrap -= m3e=20 option? Is sh 7203 an SH2A upward compatible with sh-1, sh-2 and sh2e? Is -m3e an option for sh3 branch? Thanks a lot Alle 18:28, mercoled=EC 5 dicembre 2007, Fabio Giovagnini ha scritto: > Hi Julian, > sounds very good form you. > I'll stay in touch with you and I'll keep you informed about our progress. > > Many thanks and write you soon. > > Bye > > Alle 17:53, mercoled=EC 5 dicembre 2007, Julian Back ha scritto: > > Fabio Giovagnini wrote: > > > I bought an evaluation bouard made by MPC data. > > > For 7203 the suggest to use uCLinux. > > > But they are sponsor of shlinux.com and if I remember properly they > > > suggestied to use linux-sh for the other eva boards than 7203. > > > According to you is uCLinux the best available choice for sh2a 7203? > > > > The board is actually made by Renesas, we (MPC Data) have done the Linux > > BSP. > > > > One of my colleagues has been tasked with integrating some of our BSPs > > with the main sh tree, this includes SH7203. It's at an early stage at > > the moment, he's just working out what needs to be done, but I hope you > > will see some submissions from him in the not too distant future. > > > > Julian =2D-=20 =46abio Giovagnini Aurion s.r.l. via degli orti 11, 40050 Funo di Argelato (BO) P.I e C.F. 00885711200 Tel. +39.335.8350919 =46ax +39.051.8659009 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini |
From: Fabio G. <fab...@au...> - 2007-12-05 17:27:05
|
Hi Julian, sounds very good form you. I'll stay in touch with you and I'll keep you informed about our progress. Many thanks and write you soon. Bye Alle 17:53, mercoled=EC 5 dicembre 2007, Julian Back ha scritto: > Fabio Giovagnini wrote: > > I bought an evaluation bouard made by MPC data. > > For 7203 the suggest to use uCLinux. > > But they are sponsor of shlinux.com and if I remember properly they > > suggestied to use linux-sh for the other eva boards than 7203. > > According to you is uCLinux the best available choice for sh2a 7203? > > The board is actually made by Renesas, we (MPC Data) have done the Linux > BSP. > > One of my colleagues has been tasked with integrating some of our BSPs > with the main sh tree, this includes SH7203. It's at an early stage at > the moment, he's just working out what needs to be done, but I hope you > will see some submissions from him in the not too distant future. > > Julian =2D-=20 =46abio Giovagnini Aurion s.r.l. via degli orti 11, 40050 Funo di Argelato (BO) P.I e C.F. 00885711200 Tel. +39.335.8350919 =46ax +39.051.8659009 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini |
From: Fabio G. <fab...@au...> - 2007-12-05 08:04:11
|
Alle 02:01, mercoled=EC 5 dicembre 2007, Paul Mundt ha scritto: I'm interested very mach, but is linux-sh runnunng with uClib? Could be affordable for me (not very much memory on the board) to use othe= r=20 libc? Where can I find the state of art of documentation? Thanks a lot and it is always a pleasure to read about you. Ciao > On Tue, Dec 04, 2007 at 05:21:24PM +0100, Fabio Giovagnini wrote: > > I bought an evaluation bouard made by MPC data. > > For 7203 the suggest to use uCLinux. > > But they are sponsor of shlinux.com and if I remember properly they > > suggestied to use linux-sh for the other eva boards than 7203. > > According to you is uCLinux the best available choice for sh2a 7203? > > uClinux =3D=3D Linux with CONFIG_MMU=3Dn, it's all the same kernel. I hav= e one > of these in my board pile at the office also, and have already started > merging bits and peices of the support code for the 2.6.25 merge window. > If you're interested in this platform, you might want to start hacking at > the code that's in-tree now. The board-specific bits have not been > merged, but the generic machvec should get you most of the way at the > moment. > - > To unsubscribe from this list: send the line "unsubscribe linux-sh" in > the body of a message to maj...@vg... > More majordomo info at http://vger.kernel.org/majordomo-info.html =2D-=20 =46abio Giovagnini Aurion s.r.l. via degli orti 11, 40050 Funo di Argelato (BO) P.I e C.F. 00885711200 Tel. +39.335.8350919 =46ax +39.051.8659009 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini |
From: Fabio G. <fab...@au...> - 2007-11-30 14:11:39
|
Thanks a lot. Now everythign is clear. have a nice day. Regards Ciao Alle 14:01, venerd=EC 30 novembre 2007, Nobuhiro Iwamatsu ha scritto: > On Fri, 30 Nov 2007 13:41:38 +0100 > > Fabio Giovagnini <fab...@au...> wrote: > > Why thet list has been moved from sourceforge? > > Please see > http://marc.info/?l=3Dlinuxsh-dev&m=3D119485985014724&w=3D2 > > regards, > Nobuhiro =2D-=20 =46abio Giovagnini Aurion s.r.l. via degli orti 11, 40050 Funo di Argelato (BO) P.I e C.F. 00885711200 Tel. +39.335.8350919 =46ax +39.051.8659009 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini |
From: Nobuhiro I. <he...@t-...> - 2007-11-30 13:02:05
|
On Fri, 30 Nov 2007 13:41:38 +0100 Fabio Giovagnini <fab...@au...> wrote: > Why thet list has been moved from sourceforge? Please see http://marc.info/?l=linuxsh-dev&m=119485985014724&w=2 regards, Nobuhiro -- Nobuhiro Iwamatsu he...@t-... iwa...@de... GPG ID : 3170EBE9 |
From: Nobuhiro I. <he...@t-...> - 2007-11-30 13:01:11
|
Hi, On Fri, 30 Nov 2007 11:43:20 +0100 Fabio Giovagnini <fab...@au...> wrote: > Hi all, is this the new lits > lin...@vg... ? Yes. > Can I subscribe to be informed about activities? ML is always opened. We will welcome you.;-) regards, Nobuhiro -- Nobuhiro Iwamatsu he...@t-... iwa...@de... GPG ID : 3170EBE9 |
From: Fabio G. <fab...@au...> - 2007-11-30 12:41:13
|
Why thet list has been moved from sourceforge? Regards Alle 11:43, venerd=EC 30 novembre 2007, Fabio Giovagnini ha scritto: > Hi all, is this the new lits > lin...@vg... ? > > Can I subscribe to be informed about activities? > > Best regards > > Alle 07:58, venerd=EC 30 novembre 2007, Paul Mundt ha scritto: > > Hi Mahesh, > > > > Please use the new mailing list in the future, we have moved off of > > linuxsh-dev. Also please fix your mailer not to send html email, ever. > > > > On Fri, Nov 30, 2007 at 12:07:17PM +0530, Mahesh Basavaraj Shavari wrot= e: > > > I have successfully built SH4-Linux toolchain based on > > > > > > (binutils-2.17.50, gcc-4.3-20071012, glibc-2.6) for Renesas SH target > > > > [snip] > > > > > It even fails to print the banner of the kernel. > > > > > > The same kernel when compiled with gcc-4.2.1 (released) based > > > toolchain, it boots successfully on the target hardware > > > > I expect that you are the first one to try to boot a gcc 4.3 built > > kernel, so it's not surprising that you've hit problems. Please send a > > copy of your .config, and a link to your toolchain. > > > > -----------------------------------------------------------------------= =2D- > > SF.Net email is sponsored by: The Future of Linux Business White Paper > > from Novell. From the desktop to the data center, Linux is going > > mainstream. Let it simplify your IT future. > > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > > _______________________________________________ > > linuxsh-dev mailing list > > lin...@li... > > https://lists.sourceforge.net/lists/listinfo/linuxsh-dev =2D-=20 =46abio Giovagnini Aurion s.r.l. via degli orti 11, 40050 Funo di Argelato (BO) P.I e C.F. 00885711200 Tel. +39.335.8350919 =46ax +39.051.8659009 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini |
From: Fabio G. <fab...@au...> - 2007-11-30 10:42:54
|
Hi all, is this the new lits lin...@vg... ? Can I subscribe to be informed about activities? Best regards Alle 07:58, venerd=EC 30 novembre 2007, Paul Mundt ha scritto: > Hi Mahesh, > > Please use the new mailing list in the future, we have moved off of > linuxsh-dev. Also please fix your mailer not to send html email, ever. > > On Fri, Nov 30, 2007 at 12:07:17PM +0530, Mahesh Basavaraj Shavari wrote: > > I have successfully built SH4-Linux toolchain based on > > > > (binutils-2.17.50, gcc-4.3-20071012, glibc-2.6) for Renesas SH target > > [snip] > > > It even fails to print the banner of the kernel. > > > > The same kernel when compiled with gcc-4.2.1 (released) based > > toolchain, it boots successfully on the target hardware > > I expect that you are the first one to try to boot a gcc 4.3 built > kernel, so it's not surprising that you've hit problems. Please send a > copy of your .config, and a link to your toolchain. > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > linuxsh-dev mailing list > lin...@li... > https://lists.sourceforge.net/lists/listinfo/linuxsh-dev =2D-=20 =46abio Giovagnini Aurion s.r.l. via degli orti 11, 40050 Funo di Argelato (BO) P.I e C.F. 00885711200 Tel. +39.335.8350919 =46ax +39.051.8659009 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini |
From: Paul M. <le...@li...> - 2007-11-30 06:59:21
|
Hi Mahesh, Please use the new mailing list in the future, we have moved off of linuxsh-dev. Also please fix your mailer not to send html email, ever. On Fri, Nov 30, 2007 at 12:07:17PM +0530, Mahesh Basavaraj Shavari wrote: > I have successfully built SH4-Linux toolchain based on > > (binutils-2.17.50, gcc-4.3-20071012, glibc-2.6) for Renesas SH target > [snip] > It even fails to print the banner of the kernel. > > The same kernel when compiled with gcc-4.2.1 (released) based > toolchain, it boots successfully on the target hardware > I expect that you are the first one to try to boot a gcc 4.3 built kernel, so it's not surprising that you've hit problems. Please send a copy of your .config, and a link to your toolchain. |
From: Mahesh B. S. <Mah...@kp...> - 2007-11-30 06:40:39
|
Hello all, I have successfully built SH4-Linux toolchain based on (binutils-2.17.50, gcc-4.3-20071012, glibc-2.6) for Renesas SH target =20 I am facing problem while booting the Linux kernel on SH target. =20 I have successfully compiled Linux kernel version 2.6.22.1 and 2.6.23.1 = using the above mentioned toolchain but kernel hangs after following = message: =20 Disk drive detected: TOSHIBA THNCF128MMG 3.10 STCB21M85008B24183C8 Set Transfer Mode result: 51 Initialize Device Parameters result: 50 IDLE result: 50 LILO boot: first-image Loading linux........................done. =20 It even fails to print the banner of the kernel. The same kernel when compiled with gcc-4.2.1 (released) based toolchain, = it boots successfully on the target hardware =20 =20 Any help on this will be highly appreciated. =20 Regards, Mahesh Shavari KPIT Cummins Infosystems Ltd, Pune (INDIA) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~ Free download of GNU based SH-Linux toolchains for Renesas' SH Series. = =20 The following site also offers free technical support to its users. = =20 Visit http://www.kpitgnutools.com for details. =20 Latest versions of KPIT GNU SH-Linux tools were released on October 19, = 2007. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~ |
From: Kristoffer E. <kri...@gm...> - 2007-11-23 19:39:31
|
On Mon, 19 Nov 2007 23:25:47 +0100 Dominik Brodowski <li...@do...> wrote: > Hi, > > On Mon, Nov 19, 2007 at 08:49:12PM +0100, Kristoffer Ericson wrote: > > On Mon, 19 Nov 2007 09:49:41 +0100 > > Dominik Brodowski <li...@do...> wrote: > > > > > Hi, > > > > > > On Mon, Nov 19, 2007 at 01:19:00AM -0800, Kristoffer Ericson wrote: > > > > > Actually, why do you bother? The PCMCIA subsystem is capable of working with > > > > > shared IRQs... > > > > > > > > > So I should have same interrupt for both? Isn't it important to know > > > > where the IRQ came from? Thats what puzzles me. > > > > > > Well, each IRQ handler needs to check whether it is indeed the one which was > > > called. So, inside hd6441_interrupt() you'd need to do the following > > > > > > cscr = inb(cscr_reg); > > > if !(cscr & HD64461_PCCCSCR_IRQ) > > > return IRQ_NONE; > > > > > > to avoid handling ("IRQ_HANDLED") an interrupt which wasn't caused by this > > > device. > > > > > Oki, sounds logical. But do I need to setup io_irq "IRQ's" or does PCMCIA code register one for me? From what I've read so far > > I believe I need to register the "slot IRQ" and handler, while pcmcia setups the pcmcia_card handler. Correct? > > Correct. > Well, for some reason the pcmcia subsystem isn't installing any irq handler for the pcmcia_card handler. So Im getting "IRQ 78: nobody cared" messages. The only pcmcia_... function my driver calls is pcmcia_register_socket. Best way to bugtrack why?.. The only respons I get on dmesg is : "<7>cs: : pcmcia_register_socket(0x8d2fac5c)" And when I insert card, it freezes for about 2 seconds then gives me the kernel message "<3>irq 78: nobody cared (try booting with the "irqpoll" option). Best wishes Kristoffer > > Dominik /* * drivers/pcmcia/hd64461_ss.c * * PCMCIA platform driver for Hitachi HD64461 companion chip * Copyright (C) 2006-2007 Kristoffer Ericson <kri...@gm...> * * This driver is based on hd64461_ss.c that was maintained in LinuxSH cvs before merger with mainline * by * COPYRIGHT (C) 2002-2005 Andriy Skulysh <ask...@im...> * COPYRIGHT (C) ? Greg Banks <gb...@po...> * COPYRIGHT (C) 2000 YAEGASHI Takeshi * * Please note that although the hd64461 chipset supports two sockets (0 & 1) this driver only * supports the PCMCIA one. The CF slot cannot handle anything other than memory cards, so its * better to leave support for that on libata. * */ #include <linux/autoconf.h> #include <linux/types.h> #include <linux/module.h> #include <linux/init.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/ioport.h> #include <linux/mm.h> #include <linux/vmalloc.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <pcmcia/cs_types.h> #include <pcmcia/cs.h> #include <pcmcia/ss.h> #include <pcmcia/bulkmem.h> #include <pcmcia/cistpl.h> #include "cs_internal.h" #include <asm/io.h> #include <asm/hd64461.h> #include <asm/hp6xx.h> #define MODNAME "HD64461_ss" /* * * Our socket implementation **************************************/ typedef struct hd64461_socket_t { u8 cscier; unsigned int irq; unsigned long mem_base; socket_state_t state; pccard_mem_map mem_maps[MAX_WIN]; unsigned char IC_memory; struct pcmcia_socket socket; } hd64461_socket_t; /* socket declaration */ static hd64461_socket_t hd64461_sockets[CONFIG_HD64461_PCMCIA_SOCKETS]; /* * hd64461_set_voltage(int Vcc, int Vpp) * * returns : %1 on success (no error checking!) */ static int hd64461_set_voltage(int Vcc, int Vpp) { u8 gcr, scr; u16 stbcr; u32 gcr_reg = HD64461_PCC0GCR; u32 scr_reg = HD64461_PCC0SCR; gcr = inb(gcr_reg); scr = inb(scr_reg); /* Handling voltage control pins */ switch (Vcc) { case 0: gcr |= HD64461_PCCGCR_VCC0; scr |= HD64461_PCCSCR_VCC1; break; case 33: gcr |= HD64461_PCCGCR_VCC0; scr &= ~HD64461_PCCSCR_VCC1; break; case 50: gcr &= ~HD64461_PCCGCR_VCC0; scr &= ~HD64461_PCCSCR_VCC1; break; } outb(gcr, gcr_reg); outb(scr, scr_reg); stbcr = inw(HD64461_STBCR); if (Vcc > 0) { stbcr &= ~HD64461_STBCR_SPC0ST; } else { stbcr |= HD64461_STBCR_SPC0ST; } outw(stbcr, HD64461_STBCR); return 1; } static int hd64461_init(struct pcmcia_socket *s) { u16 gpadr; hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); printk(KERN_INFO "Entering hd64461_init from pcmcia_register_socket\n"); sp->state.Vcc = 0; sp->state.Vpp = 0; hd64461_set_voltage(0, 0); gpadr = inw(HD64461_GPADR); gpadr &= ~HD64461_GPADR_PCMCIA0; outw(gpadr, HD64461_GPADR); return 0; } static int hd64461_suspend(struct pcmcia_socket *s) { u16 gpadr; u8 gcr; u32 gcr_reg = HD64461_PCC0GCR; gcr = inb(gcr_reg); gcr &= ~HD64461_PCCGCR_DRVE; outb(gcr, gcr_reg); hd64461_set_voltage(0, 0); gpadr = inw(HD64461_GPADR); gpadr |= HD64461_GPADR_PCMCIA0; outw(gpadr, HD64461_GPADR); return 0; } /* * hd64461_get_status(struct pcmcia_socket *s, u32 * value) * * */ static int hd64461_get_status(struct pcmcia_socket *s, u32 * value) { u8 isr; u32 status = 0; hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); /* get status of pcmcia socket */ isr = inb(HD64461_PCC0ISR); printk(KERN_INFO "hd64461_get_status: reading HD64461_PCC0ISR status %d\n", isr); /* is card inserted and powerd? */ if ((isr & HD64461_PCCISR_PCD_MASK) == 0) { status |= SS_DETECT; /* If its an memory card, lets find out the voltage */ if (sp->IC_memory) { switch (isr & HD64461_PCCISR_BVD_MASK) { case HD64461_PCCISR_BVD_BATGOOD: break; case HD64461_PCCISR_BVD_BATWARN: status |= SS_BATWARN; break; default: status |= SS_BATDEAD; break; } if (isr & HD64461_PCCISR_READY) status |= SS_READY; if (isr & HD64461_PCCISR_MWP) status |= SS_WRPROT; } else { if (isr & HD64461_PCCISR_BVD1) status |= SS_STSCHG; } switch (isr & (HD64461_PCCISR_VS2 | HD64461_PCCISR_VS1)) { case HD64461_PCCISR_VS1: printk(KERN_INFO MODNAME ": cannot handle X.XV card, ignored\n"); status = 0; break; case 0: case HD64461_PCCISR_VS2: status |= SS_3VCARD; break; case HD64461_PCCISR_VS2 | HD64461_PCCISR_VS1: break; } if ((sp->state.Vcc != 0) || (sp->state.Vpp != 0)) status |= SS_POWERON; } *value = status; return 0; } static int hd64461_set_socket(struct pcmcia_socket *s, socket_state_t * state) { u32 flags; u32 changed; u8 gcr, cscier; hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); u32 gcr_reg = HD64461_PCC0GCR; u32 cscier_reg = HD64461_PCC0CSCIER; printk(KERN_INFO "hd64461: entering hd64461_set_socket\n"); /* no interruptions please */ local_irq_save(flags); /* compair old power status with new */ if (state->Vpp != sp->state.Vpp || state->Vcc != sp->state.Vcc) { if (!hd64461_set_voltage(state->Vcc, state->Vpp)) { local_irq_restore(flags); printk(KERN_INFO "hd64461_set_socket: We've produced an EINVAL\n"); return -EINVAL; } } /* lets only push the changes */ changed = sp->state.csc_mask ^ state->csc_mask; cscier = inb(cscier_reg); /* set it so interrupt occurs when values of CD1 and CD2 are changed */ if (changed & SS_DETECT) { if (state->csc_mask & SS_DETECT) cscier |= HD64461_PCCCSCIER_CDE; else cscier &= ~HD64461_PCCCSCIER_CDE; } /* set so interrupt occurs when pin changes from low -> high */ if (changed & SS_READY) { if (state->csc_mask & SS_READY) cscier |= HD64461_PCCCSCIER_RE; else cscier &= ~HD64461_PCCCSCIER_RE; } /* set so interrupt occurs when BVD1 & BVD2 are set to bat_dead */ if (changed & SS_BATDEAD) { if (state->csc_mask & SS_BATDEAD) cscier |= HD64461_PCCCSCIER_BDE; else cscier &= ~HD64461_PCCCSCIER_BDE; } /* set so interrupt occurs when BVD1 & BVD2 are set to bat_warn */ if (changed & SS_BATWARN) { if (state->csc_mask & SS_BATWARN) cscier |= HD64461_PCCCSCIER_BWE; else cscier &= ~HD64461_PCCCSCIER_BWE; } /* set so "pccard connection" interrupt initializes PCC0SCR and PCC0GCR */ if (changed & SS_STSCHG) { if (state->csc_mask & SS_STSCHG) cscier |= HD64461_PCCCSCIER_SCE; else cscier &= ~HD64461_PCCCSCIER_SCE; } outb(cscier, cscier_reg); changed = sp->state.flags ^ state->flags; gcr = inb(gcr_reg); if (changed & SS_IOCARD) { if (state->flags & SS_IOCARD) { if (s->sock == 1) { printk(KERN_INFO "socket 1 can be only IC Memory card\n"); } else { /* Reset the card and set as IO card */ printk(KERN_INFO "hd64461_set_socket: Lets reset and set to IO card \n"); gcr |= HD64461_PCCGCR_PCCT; sp->IC_memory = 0; } } else { /* Reset and set as memory card */ gcr &= ~HD64461_PCCGCR_PCCT; sp->IC_memory = 1; } } /* if bit 3 = 0 while pccard accessed, output 1 on pccreg */ if (changed & SS_RESET) { if (state->flags & SS_RESET) gcr |= HD64461_PCCGCR_PCCR; else gcr &= ~HD64461_PCCGCR_PCCR; } /* Set low level of external buffer */ if (changed & SS_OUTPUT_ENA) { if (state->flags & SS_OUTPUT_ENA) gcr |= HD64461_PCCGCR_DRVE; else gcr &= ~HD64461_PCCGCR_DRVE; } outb(gcr, gcr_reg); sp->state = *state; /* enable interruptions */ local_irq_restore(flags); printk(KERN_INFO "hd64461_set_socket: We've passed the routine successfully\n"); return 0; } static int hd64461_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io) { /* this is not needed due to static mappings */ return 0; } static int hd64461_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) { hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); struct pccard_mem_map *smem; int map = mem->map; unsigned long saddr; printk(KERN_INFO "hd64461: entering hd64461_set_mem_map\n"); if (map >= MAX_WIN) return -EINVAL; /* lets setup pointers to memory */ smem = &sp->mem_maps[map]; saddr = sp->mem_base + mem->card_start; if (!(mem->flags & MAP_ATTRIB)) saddr += HD64461_PCC_WINDOW; mem->static_start = saddr; *smem = *mem; return 0; } /* * * functions needed for operations **************************************/ static struct pccard_operations hd64461_operations = { .init = hd64461_init, .suspend = hd64461_suspend, .get_status = hd64461_get_status, .set_socket = hd64461_set_socket, .set_io_map = hd64461_set_io_map, .set_mem_map = hd64461_set_mem_map, }; /* hd64461_interrupt() * * Here we check what caused the interrupt and * pass it on to pcmcia parser * ***************************************/ static irqreturn_t hd64461_interrupt(int irq, void *dev) { hd64461_socket_t *sp = (hd64461_socket_t *) dev; unsigned events = 0; unsigned char cscr; cscr = inb(HD64461_PCC0CSCR); /* * Just because we know pcmcia_card_irq is generating interrupt doesn't * mean that the slot interrupt isn't also active. So make damn sure before passing on IRQ. */ if (cscr & HD64461_PCCCSCR_IREQ) { if (!(cscr & HD64461_PCCCSCR_SC)) { cscr &= ~HD64461_PCCCSCR_IREQ; /* silence interrupt source and hand over interrupt */ outb(cscr, HD64461_PCC0CSCR); //printk(KERN_INFO "HD64461_SS: Interrupt caused by pcmcia card\n"); return IRQ_NONE; } } printk(KERN_INFO "HD64461_SS: Interrupt caused by Slot 0\n"); /* if both CD1 and CD2 has changed */ if (cscr & HD64461_PCCCSCR_CDC) { /* silence it by writing a 0 to bit 3 */ cscr &= ~HD64461_PCCCSCR_CDC; /* we've detected something being inserted or unplugged */ events |= SS_DETECT; /* if CD1 and CD2 don't both display 1, we need to clean up */ if (((inb(HD64461_PCC0ISR)) & HD64461_PCCISR_PCD_MASK) != 0) { cscr &= ~(HD64461_PCCCSCR_RC | HD64461_PCCCSCR_BW | HD64461_PCCCSCR_BD | HD64461_PCCCSCR_SC); } } /* MEMORY CARD */ if (sp->IC_memory) { if (cscr & HD64461_PCCCSCR_RC) { /* ? */ cscr &= ~HD64461_PCCCSCR_RC; events |= SS_READY; } if (cscr & HD64461_PCCCSCR_BW) { /* battery warning */ cscr &= ~HD64461_PCCCSCR_BW; events |= SS_BATWARN; } if (cscr & HD64461_PCCCSCR_BD) { /* battery dead */ cscr &= ~HD64461_PCCCSCR_BD; events |= SS_BATDEAD; } } else { /* IO CARD */ if (cscr & HD64461_PCCCSCR_SC) { /* status changed */ cscr &= ~HD64461_PCCCSCR_SC; events |= SS_STSCHG; } } outb(cscr, HD64461_PCC0CSCR); /* make sure we push these changes into pcmcia events */ if (events) { pcmcia_parse_events(&sp->socket, events); printk(KERN_INFO "hd64461_interrupt: we are pushing changed events!\n"); } return IRQ_HANDLED; } /* *hd_64461_init_socket() * * Add values to socket and link it with pcmcia operations *********************************************************/ int hd64461_init_socket(int sock, int irq, unsigned long mem_base,unsigned long io_offset) { hd64461_socket_t *sp = &hd64461_sockets[sock]; unsigned gcr_reg = HD64461_PCC0GCR; u8 gcr; int i, err; outb(0, HD64461_PCC0CSCIER); memset(sp, 0, sizeof(*sp)); sp->IC_memory = 1; sp->irq = irq; sp->mem_base = mem_base; sp->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP | SS_CAP_PAGE_REGS; sp->socket.resource_ops = &pccard_static_ops; sp->socket.map_size = HD64461_PCC_WINDOW; /* 16MB fixed window size */ sp->socket.pci_irq = irq; sp->socket.io_offset = 0; sp->socket.owner = THIS_MODULE; sp->socket.ops = &hd64461_operations; for (i = 0; i != MAX_WIN; i++) sp->mem_maps[i].map = i; if ((request_irq(irq, hd64461_interrupt, IRQF_SHARED, "hd64461_ss-irq", sp)) < 0) { printk(KERN_INFO "hd64461_init: request for irq %d: failed\n", sp->irq); return -1; } gcr = inb(gcr_reg); /* continuous 16MB memory and 16MB I/O space */ gcr |= HD64461_PCCGCR_PMMOD; /* output to pin 25 and 24 when common memory is accessed */ gcr &= ~(HD64461_PCCGCR_PA25 | HD64461_PCCGCR_PA24); outb(gcr, gcr_reg); return 0; } void hd64461_exit_socket(int sock) { hd64461_socket_t *sp = &hd64461_sockets[sock]; unsigned cscier_reg = HD64461_PCC0CSCIER; printk(KERN_INFO "hd64461_exit_socket: cleaning up irq %d and %d\n", sp->irq, sp->socket.pci_irq); outb(0, cscier_reg); hd64461_suspend(&sp->socket); } static int __devexit hd64461_pcmcia_drv_remove(struct platform_device *dev) { /* Libpata handles CF slot, so we only handle PCMCIA slot */ pcmcia_unregister_socket(&hd64461_sockets[0].socket); hd64461_exit_socket(0); return 0; } #ifdef CONFIG_PM static int hd64461_pcmcia_drv_suspend(struct platform_device *dev, pm_message_t state) { int ret = 0; int i; u32 cscier_reg = HD64461_PCC0CSCIER; hd64461_sockets[0].cscier = inb(cscier_reg); outb(0, cscier_reg); ret = pcmcia_socket_dev_suspend(&dev->dev, state); return ret; } static int hd64461_pcmcia_drv_resume(struct platform_device *dev) { int ret = 0; int i; u32 cscier_reg = HD64461_PCC0CSCIER; outb(hd64461_sockets[0].cscier, cscier_reg); ret = pcmcia_socket_dev_resume(&dev->dev); return ret; } #endif static struct platform_driver hd64461_pcmcia_driver = { .remove = __devexit_p(hd64461_pcmcia_drv_remove), #ifdef CONFIG_PM .suspend = hd64461_pcmcia_drv_suspend, .resume = hd64461_pcmcia_drv_resume, #endif .driver = { .name = "hd64461-pcmcia", }, }; static struct platform_device *hd64461_pcmcia_device; static int __init init_hd64461_ss(void) { int i; printk(KERN_INFO "hd64461_ss_init: pcmcia driver for hd64461 chipset started\n"); if (platform_driver_register(&hd64461_pcmcia_driver)) goto failed1; /* HD64461_IRQ_PCC0 + 3 = 64 + 14 + 1 = 79 */ i = hd64461_init_socket(0, HD64461_IRQ_PCC0, HD64461_PCC0_BASE, 0x0a000000); if (i < 0) goto failed2; printk(KERN_INFO "hd64461_ss_init: init_socket returned with %d\n",i); hd64461_pcmcia_device = platform_device_alloc("hd64461-pcmcia",-1); if(!hd64461_pcmcia_device) { printk(KERN_INFO "hd64461_ss_init: Cannot find pcmcia device!\n"); return -ENODEV; } i = platform_device_add(hd64461_pcmcia_device); if (i) { platform_device_put(hd64461_pcmcia_device); printk(KERN_INFO "hd64461_ss_init: Cannot add pcmcia device, return value %d\n",i); return -ENODEV; } /* Lets register the pcmcia socket */ printk(KERN_INFO "hd64461_ss_init: setting socket device\n"); hd64461_sockets[0].socket.dev.parent = &hd64461_pcmcia_device->dev; printk(KERN_INFO "hd64461_ss_init: registering socket hd64461_sockets[0].socket\n"); i = pcmcia_register_socket(&hd64461_sockets[0].socket); printk(KERN_INFO "hd64461_ss_init: return value %d from pcmcia_register_socket\n", i); return 0; /* Unregister driver nothing else */ failed1: printk(KERN_INFO "hd64461_ss_init: Failed registering pcmcia platform driver\n"); platform_driver_unregister(&hd64461_pcmcia_driver); return -EINVAL; /* Unregister driver nothing else */ failed2: printk(KERN_INFO "hd64461_ss_init: Failed to startup socket 0\n"); platform_driver_unregister(&hd64461_pcmcia_driver); return i; } static void __exit exit_hd64461_ss(void) { /* Only remove if there's something to remove */ if (hd64461_pcmcia_device) { platform_device_unregister(hd64461_pcmcia_device); platform_driver_unregister(&hd64461_pcmcia_driver); } } module_init(init_hd64461_ss); module_exit(exit_hd64461_ss); MODULE_AUTHOR("Kristoffer Ericson <kri...@gm...>"); MODULE_DESCRIPTION("PCMCIA driver for Hitachi HD64461 companion chip"); MODULE_LICENSE("GPL"); |
From: Kristoffer E. <kri...@gm...> - 2007-11-22 23:20:02
|
Greetings, Sorry, forgot to attach sources. Best wishes Kristoffer Ericson /* * drivers/pcmcia/hd64461_ss.c * * PCMCIA platform driver for Hitachi HD64461 companion chip * Copyright (C) 2006-2007 Kristoffer Ericson <kri...@gm...> * * This driver is based on hd64461_ss.c that was maintained in LinuxSH cvs before merger with mainline * by * COPYRIGHT (C) 2002-2005 Andriy Skulysh <ask...@im...> * COPYRIGHT (C) ? Greg Banks <gb...@po...> * COPYRIGHT (C) 2000 YAEGASHI Takeshi * * Please note that although the hd64461 chipset supports two sockets (0 & 1) this driver only * supports the PCMCIA one. The CF slot cannot handle anything other than memory cards, so its * better to leave support for that on libata. * */ #include <linux/autoconf.h> #include <linux/types.h> #include <linux/module.h> #include <linux/init.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/ioport.h> #include <linux/mm.h> #include <linux/vmalloc.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <pcmcia/cs_types.h> #include <pcmcia/cs.h> #include <pcmcia/ss.h> #include <pcmcia/bulkmem.h> #include <pcmcia/cistpl.h> #include "cs_internal.h" #include <asm/io.h> #include <asm/hd64461.h> #include <asm/hp6xx.h> #define MODNAME "HD64461_ss" /* * * Our socket implementation **************************************/ typedef struct hd64461_socket_t { u8 cscier; unsigned int irq; unsigned long mem_base; socket_state_t state; pccard_mem_map mem_maps[MAX_WIN]; unsigned char IC_memory; struct pcmcia_socket socket; } hd64461_socket_t; /* socket declaration */ static hd64461_socket_t hd64461_sockets[CONFIG_HD64461_PCMCIA_SOCKETS]; /* * hd64461_set_voltage(int Vcc, int Vpp) * * returns : %1 on success (no error checking!) */ static int hd64461_set_voltage(int Vcc, int Vpp) { u8 gcr, scr; u16 stbcr; u32 gcr_reg = HD64461_PCC0GCR; u32 scr_reg = HD64461_PCC0SCR; gcr = inb(gcr_reg); scr = inb(scr_reg); /* Handling voltage control pins */ switch (Vcc) { case 0: gcr |= HD64461_PCCGCR_VCC0; scr |= HD64461_PCCSCR_VCC1; break; case 33: gcr |= HD64461_PCCGCR_VCC0; scr &= ~HD64461_PCCSCR_VCC1; break; case 50: gcr &= ~HD64461_PCCGCR_VCC0; scr &= ~HD64461_PCCSCR_VCC1; break; } outb(gcr, gcr_reg); outb(scr, scr_reg); stbcr = inw(HD64461_STBCR); if (Vcc > 0) { stbcr &= ~HD64461_STBCR_SPC0ST; } else { stbcr |= HD64461_STBCR_SPC0ST; } outw(stbcr, HD64461_STBCR); return 1; } static int hd64461_init(struct pcmcia_socket *s) { u16 gpadr; hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); printk(KERN_INFO "Entering hd64461_init from pcmcia_register_socket\n"); sp->state.Vcc = 0; sp->state.Vpp = 0; hd64461_set_voltage(0, 0); gpadr = inw(HD64461_GPADR); gpadr &= ~HD64461_GPADR_PCMCIA0; outw(gpadr, HD64461_GPADR); return 0; } static int hd64461_suspend(struct pcmcia_socket *s) { u16 gpadr; u8 gcr; u32 gcr_reg = HD64461_PCC0GCR; gcr = inb(gcr_reg); gcr &= ~HD64461_PCCGCR_DRVE; outb(gcr, gcr_reg); hd64461_set_voltage(0, 0); gpadr = inw(HD64461_GPADR); gpadr |= HD64461_GPADR_PCMCIA0; outw(gpadr, HD64461_GPADR); return 0; } /* * hd64461_get_status(struct pcmcia_socket *s, u32 * value) * * */ static int hd64461_get_status(struct pcmcia_socket *s, u32 * value) { u8 isr; u32 status = 0; hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); /* get status of pcmcia socket */ isr = inb(HD64461_PCC0ISR); /* is card inserted and powerd? */ if ((isr & HD64461_PCCISR_PCD_MASK) == 0) { status |= SS_DETECT; /* If its an memory card, lets find out the voltage */ if (sp->IC_memory) { switch (isr & HD64461_PCCISR_BVD_MASK) { case HD64461_PCCISR_BVD_BATGOOD: break; case HD64461_PCCISR_BVD_BATWARN: status |= SS_BATWARN; break; default: status |= SS_BATDEAD; break; } if (isr & HD64461_PCCISR_READY) status |= SS_READY; if (isr & HD64461_PCCISR_MWP) status |= SS_WRPROT; } else { if (isr & HD64461_PCCISR_BVD1) status |= SS_STSCHG; } switch (isr & (HD64461_PCCISR_VS2 | HD64461_PCCISR_VS1)) { case HD64461_PCCISR_VS1: printk(KERN_INFO MODNAME ": cannot handle X.XV card, ignored\n"); status = 0; break; case 0: case HD64461_PCCISR_VS2: status |= SS_3VCARD; break; case HD64461_PCCISR_VS2 | HD64461_PCCISR_VS1: break; } if ((sp->state.Vcc != 0) || (sp->state.Vpp != 0)) status |= SS_POWERON; } *value = status; return 0; } static int hd64461_set_socket(struct pcmcia_socket *s, socket_state_t * state) { u32 flags; u32 changed; u8 gcr, cscier; hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); u32 gcr_reg = HD64461_PCC0GCR; u32 cscier_reg = HD64461_PCC0CSCIER; printk(KERN_INFO "hd64461: entering hd64461_set_socket\n"); /* no interruptions please */ local_irq_save(flags); /* compair old power status with new */ if (state->Vpp != sp->state.Vpp || state->Vcc != sp->state.Vcc) { if (!hd64461_set_voltage(state->Vcc, state->Vpp)) { local_irq_restore(flags); printk(KERN_INFO "hd64461_set_socket: We've produced an EINVAL\n"); return -EINVAL; } } /* lets only push the changes */ changed = sp->state.csc_mask ^ state->csc_mask; cscier = inb(cscier_reg); /* set it so interrupt occurs when values of CD1 and CD2 are changed */ if (changed & SS_DETECT) { if (state->csc_mask & SS_DETECT) cscier |= HD64461_PCCCSCIER_CDE; else cscier &= ~HD64461_PCCCSCIER_CDE; } /* set so interrupt occurs when pin changes from low -> high */ if (changed & SS_READY) { if (state->csc_mask & SS_READY) cscier |= HD64461_PCCCSCIER_RE; else cscier &= ~HD64461_PCCCSCIER_RE; } /* set so interrupt occurs when BVD1 & BVD2 are set to bat_dead */ if (changed & SS_BATDEAD) { if (state->csc_mask & SS_BATDEAD) cscier |= HD64461_PCCCSCIER_BDE; else cscier &= ~HD64461_PCCCSCIER_BDE; } /* set so interrupt occurs when BVD1 & BVD2 are set to bat_warn */ if (changed & SS_BATWARN) { if (state->csc_mask & SS_BATWARN) cscier |= HD64461_PCCCSCIER_BWE; else cscier &= ~HD64461_PCCCSCIER_BWE; } /* set so "pccard connection" interrupt initializes PCC0SCR and PCC0GCR */ if (changed & SS_STSCHG) { if (state->csc_mask & SS_STSCHG) cscier |= HD64461_PCCCSCIER_SCE; else cscier &= ~HD64461_PCCCSCIER_SCE; } outb(cscier, cscier_reg); changed = sp->state.flags ^ state->flags; gcr = inb(gcr_reg); if (changed & SS_IOCARD) { if (state->flags & SS_IOCARD) { if (s->sock == 1) { printk(KERN_INFO "socket 1 can be only IC Memory card\n"); } else { /* Reset the card and set as IO card */ printk(KERN_INFO "hd64461_set_socket: Lets reset and set to IO card \n"); gcr |= HD64461_PCCGCR_PCCT; sp->IC_memory = 0; } } else { /* Reset and set as memory card */ gcr &= ~HD64461_PCCGCR_PCCT; sp->IC_memory = 1; } } /* if bit 3 = 0 while pccard accessed, output 1 on pccreg */ if (changed & SS_RESET) { if (state->flags & SS_RESET) gcr |= HD64461_PCCGCR_PCCR; else gcr &= ~HD64461_PCCGCR_PCCR; } /* Set low level of external buffer */ if (changed & SS_OUTPUT_ENA) { if (state->flags & SS_OUTPUT_ENA) gcr |= HD64461_PCCGCR_DRVE; else gcr &= ~HD64461_PCCGCR_DRVE; } outb(gcr, gcr_reg); sp->state = *state; /* enable interruptions */ local_irq_restore(flags); printk(KERN_INFO "hd64461_set_socket: We've passed the routine successfully\n"); return 0; } static int hd64461_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io) { /* this is not needed due to static mappings */ return 0; } static int hd64461_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) { hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); struct pccard_mem_map *smem; int map = mem->map; unsigned long saddr; printk(KERN_INFO "hd64461: entering hd64461_set_mem_map\n"); if (map >= MAX_WIN) return -EINVAL; /* lets setup pointers to memory */ smem = &sp->mem_maps[map]; saddr = sp->mem_base + mem->card_start; if (!(mem->flags & MAP_ATTRIB)) saddr += HD64461_PCC_WINDOW; mem->static_start = saddr; *smem = *mem; return 0; } /* * * functions needed for operations **************************************/ static struct pccard_operations hd64461_operations = { .init = hd64461_init, .suspend = hd64461_suspend, .get_status = hd64461_get_status, .set_socket = hd64461_set_socket, .set_io_map = hd64461_set_io_map, .set_mem_map = hd64461_set_mem_map, }; /* hd64461_interrupt() * * Here we check what caused the interrupt and * pass it on to pcmcia parser * ***************************************/ static irqreturn_t hd64461_interrupt(int irq, void *dev) { hd64461_socket_t *sp = (hd64461_socket_t *) dev; unsigned events = 0; unsigned char cscr; cscr = inb(HD64461_PCC0CSCR); /* was this generated by pcmcia_card? If so, just discard */ if (cscr & HD64461_PCCCSCR_IREQ) return IRQ_NONE; printk(KERN_INFO "HD64461_SS: Interrupt caused by Slot 0\n"); /* if both CD1 and CD2 has changed */ if (cscr & HD64461_PCCCSCR_CDC) { /* silence it by writing a 0 to bit 3 */ cscr &= ~HD64461_PCCCSCR_CDC; /* we've detected something being inserted or unplugged */ events |= SS_DETECT; /* if CD1 and CD2 don't both display 1, we need to clean up */ if (((inb(HD64461_PCC0ISR)) & HD64461_PCCISR_PCD_MASK) != 0) { cscr &= ~(HD64461_PCCCSCR_RC | HD64461_PCCCSCR_BW | HD64461_PCCCSCR_BD | HD64461_PCCCSCR_SC); } } /* MEMORY CARD */ if (sp->IC_memory) { if (cscr & HD64461_PCCCSCR_RC) { /* ? */ cscr &= ~HD64461_PCCCSCR_RC; events |= SS_READY; } if (cscr & HD64461_PCCCSCR_BW) { /* battery warning */ cscr &= ~HD64461_PCCCSCR_BW; events |= SS_BATWARN; } if (cscr & HD64461_PCCCSCR_BD) { /* battery dead */ cscr &= ~HD64461_PCCCSCR_BD; events |= SS_BATDEAD; } } else { /* IO CARD */ if (cscr & HD64461_PCCCSCR_SC) { /* status changed */ cscr &= ~HD64461_PCCCSCR_SC; events |= SS_STSCHG; } } outb(cscr, HD64461_PCC0CSCR); /* make sure we push these changes into pcmcia events */ if (events) pcmcia_parse_events(&sp->socket, events); return IRQ_HANDLED; } /* *hd_64461_init_socket() * * Add values to socket and link it with pcmcia operations *********************************************************/ int hd64461_init_socket(int sock, int irq, unsigned long mem_base,unsigned long io_offset) { hd64461_socket_t *sp = &hd64461_sockets[sock]; unsigned gcr_reg = HD64461_PCC0GCR; u8 gcr; int i, err; outb(0, HD64461_PCC0CSCIER); memset(sp, 0, sizeof(*sp)); sp->IC_memory = 1; sp->irq = irq; sp->mem_base = mem_base; sp->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP | SS_CAP_PAGE_REGS; sp->socket.resource_ops = &pccard_static_ops; sp->socket.map_size = HD64461_PCC_WINDOW; /* 16MB fixed window size */ sp->socket.pci_irq = irq; sp->socket.io_offset = io_offset; sp->socket.owner = THIS_MODULE; sp->socket.ops = &hd64461_operations; for (i = 0; i != MAX_WIN; i++) sp->mem_maps[i].map = i; if ((request_irq(irq, hd64461_interrupt, IRQF_SHARED, "hd64461_ss-irq", sp)) < 0) { printk(KERN_INFO "hd64461_init: request for irq %d: failed\n", sp->irq); return -1; } gcr = inb(gcr_reg); /* continuous 16MB memory and 16MB I/O space */ gcr |= HD64461_PCCGCR_PMMOD; /* output to pin 25 and 24 when common memory is accessed */ gcr &= ~(HD64461_PCCGCR_PA25 | HD64461_PCCGCR_PA24); outb(gcr, gcr_reg); return 0; } void hd64461_exit_socket(int sock) { hd64461_socket_t *sp = &hd64461_sockets[sock]; unsigned cscier_reg = HD64461_PCC0CSCIER; printk(KERN_INFO "hd64461_exit_socket: cleaning up irq %d and %d\n", sp->irq, sp->socket.pci_irq); outb(0, cscier_reg); hd64461_suspend(&sp->socket); } static int __devexit hd64461_pcmcia_drv_remove(struct platform_device *dev) { /* Libpata handles CF slot, so we only handle PCMCIA slot */ pcmcia_unregister_socket(&hd64461_sockets[0].socket); hd64461_exit_socket(0); return 0; } #ifdef CONFIG_PM static int hd64461_pcmcia_drv_suspend(struct platform_device *dev, pm_message_t state) { int ret = 0; int i; u32 cscier_reg = HD64461_PCC0CSCIER; hd64461_sockets[0].cscier = inb(cscier_reg); outb(0, cscier_reg); ret = pcmcia_socket_dev_suspend(&dev->dev, state); return ret; } static int hd64461_pcmcia_drv_resume(struct platform_device *dev) { int ret = 0; int i; u32 cscier_reg = HD64461_PCC0CSCIER; outb(hd64461_sockets[0].cscier, cscier_reg); ret = pcmcia_socket_dev_resume(&dev->dev); return ret; } #endif static struct platform_driver hd64461_pcmcia_driver = { .remove = __devexit_p(hd64461_pcmcia_drv_remove), #ifdef CONFIG_PM .suspend = hd64461_pcmcia_drv_suspend, .resume = hd64461_pcmcia_drv_resume, #endif .driver = { .name = "hd64461-pcmcia", }, }; static struct platform_device *hd64461_pcmcia_device; static int __init init_hd64461_ss(void) { int i; printk(KERN_INFO "hd64461_ss_init: pcmcia driver for hd64461 chipset started\n"); if (platform_driver_register(&hd64461_pcmcia_driver)) goto failed1; /* HD64461_IRQ_PCC0 + 3 = 64 + 14 + 1 = 79 */ i = hd64461_init_socket(0, HD64461_IRQ_PCC0, HD64461_PCC0_BASE, 0x0a000000); if (i < 0) goto failed2; printk(KERN_INFO "hd64461_ss_init: init_socket returned with %d\n",i); hd64461_pcmcia_device = platform_device_alloc("hd64461-pcmcia",-1); if(!hd64461_pcmcia_device) { printk(KERN_INFO "hd64461_ss_init: Cannot find pcmcia device!\n"); return -ENODEV; } i = platform_device_add(hd64461_pcmcia_device); if (i) { platform_device_put(hd64461_pcmcia_device); printk(KERN_INFO "hd64461_ss_init: Cannot add pcmcia device, return value %d\n",i); return -ENODEV; } /* Lets register the pcmcia socket */ printk(KERN_INFO "hd64461_ss_init: setting socket device\n"); hd64461_sockets[0].socket.dev.parent = &hd64461_pcmcia_device->dev; printk(KERN_INFO "hd64461_ss_init: registering socket hd64461_sockets[0].socket\n"); i = pcmcia_register_socket(&hd64461_sockets[0].socket); printk(KERN_INFO "hd64461_ss_init: return value %d from pcmcia_register_socket\n", i); return 0; /* Unregister driver nothing else */ failed1: printk(KERN_INFO "hd64461_ss_init: Failed registering pcmcia platform driver\n"); platform_driver_unregister(&hd64461_pcmcia_driver); return -EINVAL; /* Unregister driver nothing else */ failed2: printk(KERN_INFO "hd64461_ss_init: Failed to startup socket 0\n"); platform_driver_unregister(&hd64461_pcmcia_driver); return i; } static void __exit exit_hd64461_ss(void) { /* Only remove if there's something to remove */ if (hd64461_pcmcia_device) { platform_device_unregister(hd64461_pcmcia_device); platform_driver_unregister(&hd64461_pcmcia_driver); } } module_init(init_hd64461_ss); module_exit(exit_hd64461_ss); MODULE_AUTHOR("Kristoffer Ericson <kri...@gm...>"); MODULE_DESCRIPTION("PCMCIA driver for Hitachi HD64461 companion chip"); MODULE_LICENSE("GPL"); |
From: Kristoffer E. <kri...@gm...> - 2007-11-22 22:33:09
|
Greetings, Dominik, I'm getting a kernel oops with the error message "Nobody cared". I've added the return IRQ_NONE if the generated interrupt came from pcmcia_card_irq (so I only collect pcmcia_slot_irq for status changes). Is it correct to assume that the error has to do with pcmcia subsystem failing somehow to aquire the shared IRQ? As I've said before I assume that the pcmcia subsystem should aquire the pcmcia_card_irq and setup proper handler and that I only need to take care of card status changes. Just want to confirm this. Best wishes Kristoffer Ericson |
From: Kristoffer E. <kri...@gm...> - 2007-11-19 19:44:40
|
On Mon, 19 Nov 2007 09:49:41 +0100 Dominik Brodowski <li...@do...> wrote: > Hi, > > On Mon, Nov 19, 2007 at 01:19:00AM -0800, Kristoffer Ericson wrote: > > > Actually, why do you bother? The PCMCIA subsystem is capable of working with > > > shared IRQs... > > > > > So I should have same interrupt for both? Isn't it important to know > > where the IRQ came from? Thats what puzzles me. > > Well, each IRQ handler needs to check whether it is indeed the one which was > called. So, inside hd6441_interrupt() you'd need to do the following > > cscr = inb(cscr_reg); > if !(cscr & HD64461_PCCCSCR_IRQ) > return IRQ_NONE; > > to avoid handling ("IRQ_HANDLED") an interrupt which wasn't caused by this > device. > Oki, sounds logical. But do I need to setup io_irq "IRQ's" or does PCMCIA code register one for me? From what I've read so far I believe I need to register the "slot IRQ" and handler, while pcmcia setups the pcmcia_card handler. Correct? > > > > int hd64461_init_socket(int sock, int irq, int io_irq, unsigned long mem_base,unsigned long io_offset) > > > > { > > > > sp->irq = irq; > > > ... > > > > sp->socket.pci_irq = io_irq; > > > ... > > > > if ((request_irq(irq, hd64461_interrupt, IRQF_DISABLED, "hd64461_ss-irq", sp)) < 0) { > > > > > > I think this should be io_irq here -- the "socket" IRQ which is demuxed to 79 > > > is io_irq; and the "card" one stays at 78. (Better use these terms than > > > "pcmcia" interrupt -- which is ambiguous). > > > > > Oki, so basicly IRQ 78 for socket IRQ? I'll changed the > > IRQF_DISABLED -> IRQF_SHARED then. > > Yes, you have two alternatives: either fix up the demux by requesting io_irq > here, or not bothering about demux and using IRQF_SHARED. Considering how much trouble the demux is giving me, I would much rather go for IRQF_SHARED. > > > It does, thx! Btw, do you have any good suggestion on which drivers to look > > at for good reference? > > Not really, but pd6729.c may be a good place to look at, for Komuro knows > really much about the PCMCIA subsystem. Oki, I'll take a look at that. > > Dominik |
From: Kristoffer E. <kri...@gm...> - 2007-11-19 00:19:35
|
On Sun, 18 Nov 2007 19:03:37 +0100 Dominik Brodowski <li...@do...> wrote: > Hi, > > On Fri, Nov 16, 2007 at 12:36:52AM +0100, Kristoffer Ericson wrote: > > Im in the process of both bugtracking and rewriting the hp6xx pcmcia > > driver. It stopped working approx 2.6.17/2.6.18 but was in bad shape > > before then so it sure needs a rewrite. Need to fix the bug first though. > > > > Anyhow. When inserting a card I get unexpected IRQ at vector blabla. Im not > > surprised by this but more in how its suppose to be done. > > Please note that my issues are mainly related to IRQ, so thats why Im not > > adding major code examples. > > > > HP Jornada 6xx has an hd64461 chipset (arch/sh/cchips/hd6446x/hd64461.c) > > where we have IRQ 36 that symbolizes 16 devices. > > We use an demuxer to mask out where the interrupt is actually coming from > > and then passes it to the correct interrupt handler. > > > > Now PCMCIA has IRQ 78 (demuxed from IRQ 36) usually. Since we want to > > divide what comes from the slot and pcmcia_card we create a software > > demuxer. IRQ 78 -> demuxer (if PCMCIA then IRQ=79 otherwise cardstatus > > IRQ=78). > > Actually, why do you bother? The PCMCIA subsystem is capable of working with > shared IRQs... > So I should have same interrupt for both? Isn't it important to know where the IRQ came from? Thats what puzzles me. > > static void hd64461_enable_irq(unsigned int irq) > > { > > hd64461_enable_int(irq); > > } > > > > static void hd64461_disable_irq(unsigned int irq) > > { > > hd64461_disable_int(irq); > > } > > > > static unsigned int hd64461_startup_irq(unsigned int irq) > > { > > hd64461_enable_irq(irq); > > return 0; > > } > > > > static void hd64461_shutdown_irq(unsigned int irq) > > { > > hd64461_disable_irq(irq); > > } > > > > static void hd64461_mask_and_ack_irq(unsigned int irq) > > { > > hd64461_disable_irq(irq); > > } > > > > static void hd64461_end_irq(unsigned int irq) > > { > > hd64461_enable_irq(irq); > > } > > Since these functions seem to be (at least almost) the same, could you unify > this? > Yeah, good point. > > static int hd64461_pcmcia_irq_demux(int irq, void *dev) > > { > > hd64461_socket_t *sp = (hd64461_socket_t *) dev; > > unsigned char cscr; > > unsigned cscr_reg = HD64461_PCC0CSCR; > > > > /* irq should be 78 here */ > > printk(KERN_INFO "hd64461_pcmcia_irq_demux(irq= %d)\n", irq); > > > > /* If interrupt was due to pcmcia interrupt, then change it to 81 */ > > 81? I thought 79 > Just a bad comment, I've tried using all kinds of irqs. Currently its set to 78 main and demux 79. > > int hd64461_init_socket(int sock, int irq, int io_irq, unsigned long mem_base,unsigned long io_offset) > > { > > sp->irq = irq; > ... > > sp->socket.pci_irq = io_irq; > ... > > if ((request_irq(irq, hd64461_interrupt, IRQF_DISABLED, "hd64461_ss-irq", sp)) < 0) { > > I think this should be io_irq here -- the "socket" IRQ which is demuxed to 79 > is io_irq; and the "card" one stays at 78. (Better use these terms than > "pcmcia" interrupt -- which is ambiguous). > Oki, so basicly IRQ 78 for socket IRQ? I'll changed the IRQF_DISABLED -> IRQF_SHARED then. > > printk(KERN_INFO "hd64461_init: request for irq %d: failed\n", sp->irq); > > return -1; > > } > > > > /* setup io_irq chip data and move it through demux */ > > set_irq_chip(io_irq, &hd64461_ss_irq_chip); > > hd64461_register_irq_demux(sp->irq, hd64461_pcmcia_irq_demux,sp); > > Regarding the demux', see my comment above. > If shared IRQ's work nicely, I would much rather use that obviously. That would get rid of the entire demux. > > /* HD64461_IRQ_PCC0 = 64 + 14 = 78 */ > > /* HD64461_IRQ_PCC0 + 3 = 64 + 14 + 1 = 79 */ > + 1 > > Hope this helps a bit, It does, thx! Btw, do you have any good suggestion on which drivers to look at for good reference? > > Dominik -- Kristoffer Ericson <Kri...@Gm...> |
From: Adrian M. <ad...@ne...> - 2007-11-17 11:01:44
|
On Sat, 2007-11-17 at 08:02 +0100, Manuel Lauss wrote: > Paul Mundt schrieb: > > > It would be good if people with legacy SH-4 devices could test their > > workloads with these optimizations in place, I'd like to get this pushed > > out and move the rest of it to an assembly fast-path derived from > > Stuart's patch. > > My SH7760 seems to like it, I see no ill effects after a few days of compiling > and playing ScummVM. > Paul, It looks like a perfectly good patch to me but for reasons I haven't been able to work out patch won't apply it, rejecting all three hunks. Possibly a problem with my mailer? Could you send it me as an attachment and I'll try again? |
From: Manuel L. <ma...@ro...> - 2007-11-17 07:02:46
|
Paul Mundt schrieb: > It would be good if people with legacy SH-4 devices could test their > workloads with these optimizations in place, I'd like to get this pushed > out and move the rest of it to an assembly fast-path derived from > Stuart's patch. My SH7760 seems to like it, I see no ill effects after a few days of compiling and playing ScummVM. Thanks, Manuel Lauss |
From: Kristoffer E. <kri...@gm...> - 2007-11-15 23:32:28
|
Greetings, Glad to see list back again :) Im in the process of both bugtracking and rewriting the hp6xx pcmcia driver. It stopped working approx 2.6.17/2.6.18 but was in bad shape before then so it sure needs a rewrite. Need to fix the bug first though. Anyhow. When inserting a card I get unexpected IRQ at vector blabla. Im not surprised by this but more in how its suppose to be done. Please note that my issues are mainly related to IRQ, so thats why Im not adding major code examples. HP Jornada 6xx has an hd64461 chipset (arch/sh/cchips/hd6446x/hd64461.c) where we have IRQ 36 that symbolizes 16 devices. We use an demuxer to mask out where the interrupt is actually coming from and then passes it to the correct interrupt handler. Now PCMCIA has IRQ 78 (demuxed from IRQ 36) usually. Since we want to divide what comes from the slot and pcmcia_card we create a software demuxer. IRQ 78 -> demuxer (if PCMCIA then IRQ=79 otherwise cardstatus IRQ=78). reference : ------------ static int hd64461_pcmcia_irq_demux(int irq, void *dev) { hd64461_socket_t *sp = (hd64461_socket_t *) dev; unsigned char cscr; unsigned cscr_reg = HD64461_PCC0CSCR; /* irq should be 78 here */ printk(KERN_INFO "hd64461_pcmcia_irq_demux(irq= %d)\n", irq); /* If interrupt was due to pcmcia interrupt, then change it to 79 */ cscr = inb(cscr_reg); if (cscr & HD64461_PCCCSCR_IREQ) { cscr &= ~HD64461_PCCCSCR_IREQ; outb(cscr, cscr_reg); irq = sp->socket.pci_irq; } printk(KERN_INFO "hd64461_pcmcia_irq_demux(transformed into %d)\n",irq); return irq; } It doesn't end there though. Since there is a different approach to mask_ack/disable/enable the pcmcia interrupt we set a different chip type for the 79 IRQ. reference: ---------- set_irq_chip(io_irq, &hd64461_ss_irq_chip); We need to turn off the pcmcia interrupt source and also turn off the hd64461 (36) IRQ. We expect it to go IRQ 79 (off) -> IRQ 78 (off) -> IRQ 36. Since we've passed the irq_io parameter to the pcmcia driver we expect it to grab that IRQ and install a proper handler. This doesn't happen, so we end up with a bad IRQ (since we don't have an handler). I've tried to look at the other drivers to see how they handle stuff but it seems to differ alot and they have very different solutions. So any help is greatly appreciated! I assume its needed to seperate if interrupt is caused by pcmcia card or pcmcia slot? Best wishes Kristoffer Ericson /* * drivers/pcmcia/hd64461_ss.c * * PCMCIA platform driver for Hitachi HD64461 companion chip * Copyright (C) 2006-2007 Kristoffer Ericson <kri...@gm...> * * * This driver is based on hd64461_ss.c that was maintained in LinuxSH cvs before merger with mainline * by * COPYRIGHT (C) 2002-2005 Andriy Skulysh <ask...@im...> * and * COPYRIGHT (C) ? Greg Banks <gb...@po...> * and * COPYRIGHT (C) 2000 YAEGASHI Takeshi * * Please note that although the hd64461 chipset supports two sockets (0 & 1) this driver only * supports the PCMCIA one. The CF slot cannot handle anything other than memory cards, so its * better to leave support for that on libata. * */ #include <linux/autoconf.h> #include <linux/types.h> #include <linux/module.h> #include <linux/init.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/ioport.h> #include <linux/mm.h> #include <linux/vmalloc.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <pcmcia/cs_types.h> #include <pcmcia/cs.h> #include <pcmcia/ss.h> #include <pcmcia/bulkmem.h> #include <pcmcia/cistpl.h> #include "cs_internal.h" #include <asm/io.h> #include <asm/hd64461.h> #include <asm/hp6xx.h> #define MODNAME "HD64461_ss" /* * * Our socket implementation **************************************/ typedef struct hd64461_socket_t { u8 cscier; unsigned int irq; unsigned long mem_base; socket_state_t state; pccard_mem_map mem_maps[MAX_WIN]; unsigned char IC_memory; struct pcmcia_socket socket; } hd64461_socket_t; /* socket declaration */ static hd64461_socket_t hd64461_sockets[CONFIG_HD64461_PCMCIA_SOCKETS]; /* * .CHIP functions for our handler ***************************************/ static void hd64461_enable_int(unsigned int irq) { u8 cscier; u32 cscier_reg = HD64461_PCC0CSCIER; cscier = inb(cscier_reg); cscier &= ~HD64461_PCCCSCIER_IREQE_MASK; /* 0x60 */ cscier |= HD64461_PCCCSCIER_IREQE_LEVEL; /* 0x20 */ outb(cscier, cscier_reg); } static void hd64461_disable_int(unsigned int irq) { u8 cscier; u32 cscier_reg = HD64461_PCC0CSCIER; cscier = inb(cscier_reg); cscier &= ~HD64461_PCCCSCIER_IREQE_MASK; /* 0x60 */ outb(cscier, cscier_reg); } static void hd64461_enable_irq(unsigned int irq) { hd64461_enable_int(irq); } static void hd64461_disable_irq(unsigned int irq) { hd64461_disable_int(irq); } static unsigned int hd64461_startup_irq(unsigned int irq) { hd64461_enable_irq(irq); return 0; } static void hd64461_shutdown_irq(unsigned int irq) { hd64461_disable_irq(irq); } static void hd64461_mask_and_ack_irq(unsigned int irq) { hd64461_disable_irq(irq); } static void hd64461_end_irq(unsigned int irq) { hd64461_enable_irq(irq); } static struct irq_chip hd64461_ss_irq_chip = { .name = "hd64461_ss-irq", .startup = hd64461_startup_irq, .shutdown = hd64461_shutdown_irq, .enable = hd64461_enable_irq, .disable = hd64461_disable_irq, .ack = hd64461_mask_and_ack_irq, .end = hd64461_end_irq }; /* End of .CHIP functions *************************/ /* * hd64461_set_voltage(int Vcc, int Vpp) * * returns : %1 on success (no error checking!) */ static int hd64461_set_voltage(int Vcc, int Vpp) { u8 gcr, scr; u16 stbcr; u32 gcr_reg = HD64461_PCC0GCR; u32 scr_reg = HD64461_PCC0SCR; gcr = inb(gcr_reg); scr = inb(scr_reg); /* Handling voltage control pins */ switch (Vcc) { case 0: gcr |= HD64461_PCCGCR_VCC0; scr |= HD64461_PCCSCR_VCC1; break; case 33: gcr |= HD64461_PCCGCR_VCC0; scr &= ~HD64461_PCCSCR_VCC1; break; case 50: gcr &= ~HD64461_PCCGCR_VCC0; scr &= ~HD64461_PCCSCR_VCC1; break; } outb(gcr, gcr_reg); outb(scr, scr_reg); stbcr = inw(HD64461_STBCR); if (Vcc > 0) { stbcr &= ~HD64461_STBCR_SPC0ST; } else { stbcr |= HD64461_STBCR_SPC0ST; } outw(stbcr, HD64461_STBCR); return 1; } static int hd64461_init(struct pcmcia_socket *s) { u16 gpadr; hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); sp->state.Vcc = 0; sp->state.Vpp = 0; hd64461_set_voltage(0, 0); gpadr = inw(HD64461_GPADR); gpadr &= ~HD64461_GPADR_PCMCIA0; outw(gpadr, HD64461_GPADR); return 0; } static int hd64461_suspend(struct pcmcia_socket *s) { u16 gpadr; u8 gcr; u32 gcr_reg = HD64461_PCC0GCR; gcr = inb(gcr_reg); gcr &= ~HD64461_PCCGCR_DRVE; outb(gcr, gcr_reg); hd64461_set_voltage(0, 0); gpadr = inw(HD64461_GPADR); gpadr |= HD64461_GPADR_PCMCIA0; outw(gpadr, HD64461_GPADR); return 0; } /* * hd64461_get_status(struct pcmcia_socket *s, u32 * value) * * */ static int hd64461_get_status(struct pcmcia_socket *s, u32 * value) { u8 isr; u32 status = 0; hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); /* get status of pcmcia socket */ isr = inb(HD64461_PCC0ISR); /* is card inserted and powerd? */ if ((isr & HD64461_PCCISR_PCD_MASK) == 0) { status |= SS_DETECT; /* If its an memory card, lets find out the voltage */ if (sp->IC_memory) { switch (isr & HD64461_PCCISR_BVD_MASK) { case HD64461_PCCISR_BVD_BATGOOD: break; case HD64461_PCCISR_BVD_BATWARN: status |= SS_BATWARN; break; default: status |= SS_BATDEAD; break; } if (isr & HD64461_PCCISR_READY) status |= SS_READY; if (isr & HD64461_PCCISR_MWP) status |= SS_WRPROT; } else { if (isr & HD64461_PCCISR_BVD1) status |= SS_STSCHG; } switch (isr & (HD64461_PCCISR_VS2 | HD64461_PCCISR_VS1)) { case HD64461_PCCISR_VS1: printk(KERN_INFO MODNAME ": cannot handle X.XV card, ignored\n"); status = 0; break; case 0: case HD64461_PCCISR_VS2: status |= SS_3VCARD; break; case HD64461_PCCISR_VS2 | HD64461_PCCISR_VS1: break; } if ((sp->state.Vcc != 0) || (sp->state.Vpp != 0)) status |= SS_POWERON; } *value = status; return 0; } static int hd64461_set_socket(struct pcmcia_socket *s, socket_state_t * state) { u32 flags; u32 changed; u8 gcr, cscier; hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); u32 gcr_reg = HD64461_PCC0GCR; u32 cscier_reg = HD64461_PCC0CSCIER; /* no interruptions please */ local_irq_save(flags); /* compair old power status with new */ if (state->Vpp != sp->state.Vpp || state->Vcc != sp->state.Vcc) { if (!hd64461_set_voltage(state->Vcc, state->Vpp)) { local_irq_restore(flags); return -EINVAL; } } /* lets only push the changes */ changed = sp->state.csc_mask ^ state->csc_mask; cscier = inb(cscier_reg); /* set is so interrupt occurs when values of CD1 and CD2 are changed */ if (changed & SS_DETECT) { if (state->csc_mask & SS_DETECT) cscier |= HD64461_PCCCSCIER_CDE; else cscier &= ~HD64461_PCCCSCIER_CDE; } /* set so interrupt occurs when pin changes from low -> high */ if (changed & SS_READY) { if (state->csc_mask & SS_READY) cscier |= HD64461_PCCCSCIER_RE; else cscier &= ~HD64461_PCCCSCIER_RE; } /* set so interrupt occurs when BVD1 & BVD2 are set to bat_dead */ if (changed & SS_BATDEAD) { if (state->csc_mask & SS_BATDEAD) cscier |= HD64461_PCCCSCIER_BDE; else cscier &= ~HD64461_PCCCSCIER_BDE; } /* set so interrupt occurs when BVD1 & BVD2 are set to bat_warn */ if (changed & SS_BATWARN) { if (state->csc_mask & SS_BATWARN) cscier |= HD64461_PCCCSCIER_BWE; else cscier &= ~HD64461_PCCCSCIER_BWE; } /* set so "pccard connection" interrupt initializes PCC0SCR and PCC0GCR */ if (changed & SS_STSCHG) { if (state->csc_mask & SS_STSCHG) cscier |= HD64461_PCCCSCIER_SCE; else cscier &= ~HD64461_PCCCSCIER_SCE; } outb(cscier, cscier_reg); changed = sp->state.flags ^ state->flags; gcr = inb(gcr_reg); if (changed & SS_IOCARD) { if (state->flags & SS_IOCARD) { if (s->sock == 1) { printk(KERN_ERR "socket 1 can be only IC Memory card\n"); } else { /* Reset the card and set as IO card */ gcr |= HD64461_PCCGCR_PCCT; sp->IC_memory = 0; } } else { /* Reset and set as memory card */ gcr &= ~HD64461_PCCGCR_PCCT; sp->IC_memory = 1; } } /* if bit 3 = 0 while pccard accessed, output 1 on pccreg */ if (changed & SS_RESET) { if (state->flags & SS_RESET) gcr |= HD64461_PCCGCR_PCCR; else gcr &= ~HD64461_PCCGCR_PCCR; } /* Set low level of external buffer */ if (changed & SS_OUTPUT_ENA) { if (state->flags & SS_OUTPUT_ENA) gcr |= HD64461_PCCGCR_DRVE; else gcr &= ~HD64461_PCCGCR_DRVE; } outb(gcr, gcr_reg); sp->state = *state; /* enable interruptions */ local_irq_restore(flags); return 0; } static int hd64461_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io) { /* this is not needed due to static mappings */ return 0; } static int hd64461_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) { hd64461_socket_t *sp = container_of(s, struct hd64461_socket_t, socket); struct pccard_mem_map *smem; int map = mem->map; unsigned long saddr; if (map >= MAX_WIN) return -EINVAL; /* lets setup pointers to memory */ smem = &sp->mem_maps[map]; saddr = sp->mem_base + mem->card_start; if (!(mem->flags & MAP_ATTRIB)) saddr += HD64461_PCC_WINDOW; mem->static_start = saddr; *smem = *mem; return 0; } static int hd64461_pcmcia_irq_demux(int irq, void *dev) { hd64461_socket_t *sp = (hd64461_socket_t *) dev; unsigned char cscr; unsigned cscr_reg = HD64461_PCC0CSCR; /* irq should be 78 here */ printk(KERN_INFO "hd64461_pcmcia_irq_demux(irq= %d)\n", irq); /* If interrupt was due to pcmcia interrupt, then change it to 81 */ cscr = inb(cscr_reg); if (cscr & HD64461_PCCCSCR_IREQ) { cscr &= ~HD64461_PCCCSCR_IREQ; outb(cscr, cscr_reg); irq = sp->socket.pci_irq; } printk(KERN_INFO "hd64461_pcmcia_irq_demux(transformed into %d)\n",irq); return irq; } /* * * functions needed for operations **************************************/ static struct pccard_operations hd64461_operations = { .init = hd64461_init, .suspend = hd64461_suspend, .get_status = hd64461_get_status, .set_socket = hd64461_set_socket, .set_io_map = hd64461_set_io_map, .set_mem_map = hd64461_set_mem_map, }; /* hd64461_interrupt() * * Here we check what caused the interrupt and * pass it on to pcmcia parser * ***************************************/ static irqreturn_t hd64461_interrupt(int irq, void *dev) { hd64461_socket_t *sp = (hd64461_socket_t *) dev; unsigned events = 0; unsigned char cscr; unsigned cscr_reg = HD64461_PCC0CSCR; cscr = inb(cscr_reg); /* if both CD1 and CD2 has changed */ if (cscr & HD64461_PCCCSCR_CDC) { /* silence it by writing a 0 to bit 3 */ cscr &= ~HD64461_PCCCSCR_CDC; /* we've detected something being inserted or unplugged */ events |= SS_DETECT; /* if CD1 and CD2 don't both display 1, we need to clean up */ if (((inb(HD64461_PCC0ISR)) & HD64461_PCCISR_PCD_MASK) != 0) { cscr &= ~(HD64461_PCCCSCR_RC | HD64461_PCCCSCR_BW | HD64461_PCCCSCR_BD | HD64461_PCCCSCR_SC); } } /* MEMORY CARD */ if (sp->IC_memory) { if (cscr & HD64461_PCCCSCR_RC) { /* ? */ cscr &= ~HD64461_PCCCSCR_RC; events |= SS_READY; } if (cscr & HD64461_PCCCSCR_BW) { /* battery warning */ cscr &= ~HD64461_PCCCSCR_BW; events |= SS_BATWARN; } if (cscr & HD64461_PCCCSCR_BD) { /* battery dead */ cscr &= ~HD64461_PCCCSCR_BD; events |= SS_BATDEAD; } } else { /* IO CARD */ if (cscr & HD64461_PCCCSCR_SC) { /* status changed */ cscr &= ~HD64461_PCCCSCR_SC; events |= SS_STSCHG; } } outb(cscr, cscr_reg); /* make sure we push these changes into pcmcia events */ if (events) pcmcia_parse_events(&sp->socket, events); return IRQ_HANDLED; } /* *hd_64461_init_socket() * * Add values to socket and link it with pcmcia operations *********************************************************/ int hd64461_init_socket(int sock, int irq, int io_irq, unsigned long mem_base,unsigned long io_offset) { hd64461_socket_t *sp = &hd64461_sockets[sock]; unsigned gcr_reg = HD64461_PCC0GCR; u8 gcr; int i, err; outb(0, HD64461_PCC0CSCIER); memset(sp, 0, sizeof(*sp)); sp->IC_memory = 1; sp->irq = irq; sp->mem_base = mem_base; sp->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP | SS_CAP_PAGE_REGS; sp->socket.resource_ops = &pccard_static_ops; sp->socket.map_size = HD64461_PCC_WINDOW; /* 16MB fixed window size */ sp->socket.pci_irq = io_irq; sp->socket.io_offset = io_offset; sp->socket.owner = THIS_MODULE; sp->socket.ops = &hd64461_operations; for (i = 0; i != MAX_WIN; i++) sp->mem_maps[i].map = i; if ((request_irq(irq, hd64461_interrupt, IRQF_DISABLED, "hd64461_ss-irq", sp)) < 0) { printk(KERN_INFO "hd64461_init: request for irq %d: failed\n", sp->irq); return -1; } /* setup io_irq chip data and move it through demux */ set_irq_chip(io_irq, &hd64461_ss_irq_chip); hd64461_register_irq_demux(sp->irq, hd64461_pcmcia_irq_demux,sp); gcr = inb(gcr_reg); /* set so we get '1' on pin 24 when common memory is accessed */ gcr |= HD64461_PCCGCR_PMMOD; /* set so we get continuous 16MB memory */ gcr &= ~(HD64461_PCCGCR_PA25 | HD64461_PCCGCR_PA24); outb(gcr, gcr_reg); return 0; } void hd64461_exit_socket(int sock) { hd64461_socket_t *sp = &hd64461_sockets[sock]; unsigned cscier_reg = HD64461_PCC0CSCIER; printk(KERN_INFO "hd64461_exit_socket: cleaning up irq %d and %d\n", sp->irq, sp->socket.pci_irq); outb(0, cscier_reg); hd64461_suspend(&sp->socket); if (sp->irq) { if (sock == 0) hd64461_unregister_irq_demux(sp->irq); free_irq(sp->irq, sp); if (sock == 0) irq_desc[sp->socket.pci_irq].chip = &no_irq_type; } } static int __devexit hd64461_pcmcia_drv_remove(struct platform_device *dev) { /* Libpata handles CF slot, so we only handle PCMCIA slot */ pcmcia_unregister_socket(&hd64461_sockets[0].socket); hd64461_exit_socket(0); return 0; } #ifdef CONFIG_PM static int hd64461_pcmcia_drv_suspend(struct platform_device *dev, pm_message_t state) { int ret = 0; int i; for (i = 0; i != CONFIG_HD64461_PCMCIA_SOCKETS; i++) { u32 cscier_reg = HD64461_PCC0CSCIER; hd64461_sockets[i].cscier = inb(cscier_reg); outb(0, cscier_reg); ret = pcmcia_socket_dev_suspend(&dev->dev, state); } return ret; } static int hd64461_pcmcia_drv_resume(struct platform_device *dev) { int ret = 0; int i; u32 cscier_reg = HD64461_PCC0CSCIER; outb(hd64461_sockets[0].cscier, cscier_reg); ret = pcmcia_socket_dev_resume(&dev->dev); return ret; } #endif static struct platform_driver hd64461_pcmcia_driver = { .remove = __devexit_p(hd64461_pcmcia_drv_remove), #ifdef CONFIG_PM .suspend = hd64461_pcmcia_drv_suspend, .resume = hd64461_pcmcia_drv_resume, #endif .driver = { .name = "hd64461-pcmcia", }, }; static struct platform_device *hd64461_pcmcia_device; static int __init init_hd64461_ss(void) { int i; printk(KERN_INFO "hd64461_ss_init: pcmcia driver for hd64461 chipset started\n"); if (platform_driver_register(&hd64461_pcmcia_driver)) goto failed1; /* HD64461_IRQ_PCC0 = 64 + 14 = 78 */ /* HD64461_IRQ_PCC0 + 3 = 64 + 14 + 1 = 79 */ i = hd64461_init_socket(0, HD64461_IRQ_PCC0, HD64461_IRQ_PCC0 + 1, HD64461_PCC0_BASE, 0xba000000); if (i < 0) goto failed2; printk(KERN_INFO "hd64461_ss_init: init_socket returned with %d\n",i); hd64461_pcmcia_device = platform_device_alloc("hd64461-pcmcia",-1); if(!hd64461_pcmcia_device) { printk(KERN_INFO "hd64461_ss_init: Cannot find pcmcia device!\n"); return -ENODEV; } i = platform_device_add(hd64461_pcmcia_device); if (i) { platform_device_put(hd64461_pcmcia_device); printk(KERN_INFO "hd64461_ss_init: Cannot add pcmcia device, return value %d\n",i); return -ENODEV; } /* Lets register the pcmcia socket */ printk(KERN_INFO "hd64461_ss_init: setting socket device\n"); hd64461_sockets[0].socket.dev.parent = &hd64461_pcmcia_device->dev; printk(KERN_INFO "hd64461_ss_init: registering socket hd64461_sockets[0].socket\n"); i = pcmcia_register_socket(&hd64461_sockets[0].socket); if (i) { printk(KERN_INFO "hd64461_ss_init: registration failed, return value %d\n", i); return i; } return 0; /* Unregister driver nothing else */ failed1: printk(KERN_INFO "hd64461_ss_init: Failed registering pcmcia platform driver\n"); platform_driver_unregister(&hd64461_pcmcia_driver); return -EINVAL; /* Unregister driver nothing else */ failed2: printk(KERN_INFO "hd64461_ss_init: Failed to startup socket 0\n"); platform_driver_unregister(&hd64461_pcmcia_driver); return i; } static void __exit exit_hd64461_ss(void) { /* Only remove if there's something to remove */ if (hd64461_pcmcia_device) { platform_device_unregister(hd64461_pcmcia_device); platform_driver_unregister(&hd64461_pcmcia_driver); } } module_init(init_hd64461_ss); module_exit(exit_hd64461_ss); MODULE_AUTHOR("Kristoffer Ericson <kri...@gm...>"); MODULE_DESCRIPTION("PCMCIA driver for Hitachi HD64461 companion chip"); MODULE_LICENSE("GPL"); |
From: Kristoffer E. <kri...@gm...> - 2007-11-15 23:14:06
|
On Wed, 14 Nov 2007 14:08:41 +0900 Paul Mundt <le...@li...> wrote: > On Tue, Nov 13, 2007 at 11:52:38PM +0100, Kristoffer Ericson wrote: > > Just starting looking at pcmcia code again. When compairing to hd64465 > > code I found this segment: > > > Both hd64461 and hd64465 do totally bogus IRQ handling, most of which > should be moved over to arch/sh/cchips and corrected to work with the new > API. Agreed. I would ask these questions on the pcmcia mailinglist, but they seem quite inactive. And despite trying to get membership to their mailinglist, I only get 'your mail needs to be looked at by administrator..' and then nothing. The hd64461 approach to pcmcia is to add an demux to make us detect where an interrupt is coming from (pcmcia IRQ or slot IRQ). I haven't seen any examples of s/w demuxes anywhere else. Other drivers tend to usually use polling interrupts. Im finding it hard to think out the best solution though. I have a theory why we are getting this bug: --------------------------------------------------------------------------- We set chip data for our io_irq (to get proper ack/disable/mask) and expect the pcmcia driver to aquire it without a problem. But by setting the chip data we make it alot harder (marked as already used?) for the pcmcia driver to get the irq. Since we don't have any handler we will generate a bad irq every time IRQ is triggerd. A possible solution would be to simply add the pcmcia disable/enable/ack code to the standard IRQ chip but I don't think thats the correct solution since we effectivly add code that only affect 1 / 16 IRQ's. Another approach would be to have it first run the pcmcia chip data and after that the hd64461 data. That way we would get IRQ_generated -> ack_mask by pcmcia chip -> ack_mask by pcmcia chip. I can't say I fully understand how the pcmcia code works, but I know enough to see that its the IRQ handling thats causing the issue. > > > static void hs_mask_and_ack_irq(unsigned int irq) > > { > > hs_socket_disable_ireq(hs_mapped_irq[irq].sock); > > if (hs_mapped_irq[irq].old_handler != &no_irq_type) > > hs_mapped_irq[irq].chip->ack(irq); > > } > > > Again, this is simply crap. You are better off deleting everything that > mentions 'irq' in the hd6446x pcmcia drivers and rewriting it completely. Thanks for confirming that the code is bad. > > We have proper APIs in place for chaining the handlers, demux, etc. all > of which hd6446x tries to side-step. Surprisingly that doesn't work very > well. Look at the other PCMCIA drivers (ie, not hd6446x) for examples on > how to implement a less fucked up driver. I've spent the day looking through the current IRQ API so I've started to clean it up. Been googling and checking kernel source to find out what exactly chaining IRQ means. To me it looks like it basicly locks the IRQ, so that it cannot be aquired. That is desired for example hd64461 IRQ since in itself its not an IRQ, its only an representation of different devices (through demux). > > Also, your keyboard was blessed with an enter key, please consider using > it when writing email. Point taken :) |
From: Magnus D. <mag...@gm...> - 2007-11-14 08:33:49
|
On Nov 13, 2007 7:46 PM, Magnus Damm <mag...@gm...> wrote: > On Nov 13, 2007 12:15 AM, shinkoi2005 <shi...@gm...> wrote: > > > I'm glad that it works on your R2D-1. Both my R2D-1 boards do not have > > > working CF. Just to double-check - are using a R2D with one or two pci > > > slots? > > My R2D-1 has two pci slots. > > The picture is the following. > > <http://tree.celinuxforum.org/pubwiki/moin.cgi/RTS7751R2DHandlingManual> > > Ok, that looks like the same model as I have. > > > > Can you please post the BVERREG and VERREG register values from your > > > R2D-1? Then I'll post mine when I get back into the office. > > My R2D-1's VERREG and BVERREG is the folloing. > > R2D VERREG:0x0033, BVERREG:0x0011 > > My two R2D-1 boards say: > R2D VERREG:0x0033, BVERREG:0x0011 (00:00:e1:6b:5f:c2) > R2D VERREG:0x0034, BVERREG:0x0011 (00:00:87:6b:af:69) > > The boards do not work with the only CF card we have in the office at > the moment. I'll bring a pile of different CF cards from home tomorrow > to check if the actual CF card is strange. I've seen interrupt > problems with certain older CF cards on other platforms earlier so > this wouldn't surprise me at all. Ok, so i've tested with a bunch of different CF cards and the R2D-1 FPGA seems to support fewer CF models than R2D-PLUS. Here it goes, just booting - tested with 2.6.24-rc2-git: Mitsubishi 22.5 MB - R2D-PLUS: bad, R2D-1: bad Viking 24 MB - R2D-PLUS: ok, R2D-1:ok SanDisk 128MB - R2D-PLUS: ok, R2D-1: ok PQI 40x 128MB - R2D-PLUS: ok, R2D-1: bad SanDisk Ultra II 512 MB - R2D-PLUS: ok, R2D-1: ok I-O DATA x115 512 MB - R2D-PLUS: ok, R2D-1: ok IBM Microdrive 1 GB - R2D-PLUS: ok, R2D-1: ok I'll post a patch that enables polling on R2D-1. / magnus |
From: Paul M. <le...@li...> - 2007-11-14 05:09:11
|
On Tue, Nov 13, 2007 at 11:52:38PM +0100, Kristoffer Ericson wrote: > Just starting looking at pcmcia code again. When compairing to hd64465 > code I found this segment: > Both hd64461 and hd64465 do totally bogus IRQ handling, most of which should be moved over to arch/sh/cchips and corrected to work with the new API. > static void hs_mask_and_ack_irq(unsigned int irq) > { > hs_socket_disable_ireq(hs_mapped_irq[irq].sock); > if (hs_mapped_irq[irq].old_handler != &no_irq_type) > hs_mapped_irq[irq].chip->ack(irq); > } > Again, this is simply crap. You are better off deleting everything that mentions 'irq' in the hd6446x pcmcia drivers and rewriting it completely. We have proper APIs in place for chaining the handlers, demux, etc. all of which hd6446x tries to side-step. Surprisingly that doesn't work very well. Look at the other PCMCIA drivers (ie, not hd6446x) for examples on how to implement a less fucked up driver. Also, your keyboard was blessed with an enter key, please consider using it when writing email. |