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: Greg B. <gb...@po...> - 2000-10-13 01:21:38
|
NIIBE Yutaka wrote: > > NIIBE Yutaka wrote: > > I think that wired TLB entry is better. Some (or most) drivers don't > > expect TLB fault would occur with I/O access functions. > > Reading test10-pre2, I've changed my mind. It reads: > > --- v2.4.0-test9/linux/arch/i386/mm/fault.c Wed May 24 18:38:26 2000 > +++ linux/arch/i386/mm/fault.c Thu Oct 12 12:57:31 2000 > @@ -130,6 +130,19 @@ > __asm__("movl %%cr2,%0":"=r" (address)); > > tsk = current; > + > + /* > + * We fault-in kernel-space virtual memory on-demand. The > + * 'reference' page table is init_mm.pgd. > + * > + * NOTE! We MUST NOT take any locks for this case. We may > + * be in an interrupt or a critical region, and should > + * only copy the information from the master page table, > + * nothing more. > + */ > + if (address >= TASK_SIZE) > + goto vmalloc_fault; > + > ------------------------------- > > It explicitly says this fault may occur in a interrupt handler or in a > critical region. I _was_ afraid of exactly on this issue (TLB falut > in interrupt handler or a critical region), I now understand that we > should implement the TLB fault handler with this condition. > > Please go ahead on your original TLB implementation. Please include > ChangeLog entries when commit. > > I'll do the changes of optimizing PGD and removing set_pgdir for SuperH. Ok. Last night I submitted the host bridge driver to David Hinds. Greg. -- These are my opinions not PPIs. |
From: NIIBE Y. <gn...@ch...> - 2000-10-13 00:53:38
|
NIIBE Yutaka wrote: > I think that wired TLB entry is better. Some (or most) drivers don't > expect TLB fault would occur with I/O access functions. Reading test10-pre2, I've changed my mind. It reads: --- v2.4.0-test9/linux/arch/i386/mm/fault.c Wed May 24 18:38:26 2000 +++ linux/arch/i386/mm/fault.c Thu Oct 12 12:57:31 2000 @@ -130,6 +130,19 @@ __asm__("movl %%cr2,%0":"=r" (address)); tsk = current; + + /* + * We fault-in kernel-space virtual memory on-demand. The + * 'reference' page table is init_mm.pgd. + * + * NOTE! We MUST NOT take any locks for this case. We may + * be in an interrupt or a critical region, and should + * only copy the information from the master page table, + * nothing more. + */ + if (address >= TASK_SIZE) + goto vmalloc_fault; + ------------------------------- It explicitly says this fault may occur in a interrupt handler or in a critical region. I _was_ afraid of exactly on this issue (TLB falut in interrupt handler or a critical region), I now understand that we should implement the TLB fault handler with this condition. Please go ahead on your original TLB implementation. Please include ChangeLog entries when commit. I'll do the changes of optimizing PGD and removing set_pgdir for SuperH. -- |
From: Greg B. <gb...@po...> - 2000-10-12 06:24:10
|
NIIBE Yutaka wrote: > > Greg Banks wrote: > > This means that PCMCIA IO-space mappings are loaded > > into the TLB in exactly the same way as other mappings. > > In particular, wired TLB entries are *not* used. But > > the downside is a small number of extra instructions in > > the main path for all TLB misses (PCMCIA and non-PCMCIA > > alike). > > > > My question is, is this approach acceptable? Is the > > performance hit in the TLB miss handler worth freeing > > up the TLB slots when PCMCIA is not being heavily used? > > I think that wired TLB entry is better. Some (or most) drivers don't > expect TLB fault would occur with I/O access functions. Well, it doesn't seem to be hurting the IDE driver. Also, I've recently seen a lot of WinCE driver code and it uses virtual mappings to access *all* IO registers, not just PCMCIA IO-space, despite being able to do it directly for most devices. There's no special support in the device drivers for handling TLB misses during register accesses; it seems to just work. Anyway I'll look at reworking the mapping code to use wired TLB entries. Greg. -- These are my opinions not PPIs. |
From: Greg B. <gb...@po...> - 2000-10-12 06:17:00
|
NIIBE Yutaka wrote: > > My network connection is quite bad these days, because of the > restructuring of my company. I think I can be "in sync" this weekend. I wondered where you'd been ;-) > > For the patch by Greg, here's my comment. Thanks. > > +++ kernel/arch/sh/config.in Fri Sep 29 03:13:26 2000 > +++ kernel/arch/sh/kernel/Makefile Wed Sep 27 03:28:54 2000 > +++ kernel/arch/sh/kernel/sh_ksyms.c Tue Oct 10 19:56:39 2000 > +++ kernel/include/asm-sh/io.h Wed Sep 27 10:11:34 2000 > +++ kernel/include/asm-sh/mmu_context.h Sun Oct 1 13:18:06 2000 > +++ kernel/include/asm-sh/machvec.h Sat Sep 23 05:34:00 2000 > +++ kernel/include/asm-sh/io_hd64461.h Sat Sep 23 05:21:26 2000 > +++ kernel/arch/sh/mm/fault.c Sun Oct 1 13:56:02 2000 > > OK. > > +++ kernel/arch/sh/kernel/io_hd64465.c Sun Oct 1 04:57:59 2000 > +++ kernel/arch/sh/kernel/mach_foobar.c Sat Sep 30 10:59:41 2000 > +++ kernel/arch/sh/kernel/setup_hd64465.c Tue Oct 10 20:02:53 2000 > +++ kernel/include/asm-sh/hd64465.h Sat Sep 30 11:00:17 2000 > +++ kernel/include/asm-sh/io_hd64465.h Tue Oct 10 20:18:29 2000 > > OK. > > +++ kernel/drivers/pcmcia/Config.in Mon Sep 25 23:41:41 2000 > +++ kernel/drivers/pcmcia/Makefile Mon Sep 25 23:54:05 2000 > +++ kernel/drivers/pcmcia/hd64465_ss.c Tue Oct 10 20:14:28 2000 > > OK for me. (Actually I don't care. :-) Could you please send this part > to PCMCIA driver maintainer directly? I'll do that once we resolve the dispatch_virtual_irq() issue. > > Please check them in. > ---------------------------------------------- > > +++ kernel/arch/sh/kernel/io.c Fri Sep 29 09:44:43 2000 > +++ kernel/arch/sh/kernel/io_generic.c Tue Sep 26 01:59:37 2000 > > For those, I'm not sure now. EXPORT_SYMBOL shoule be here or in sh_ksyms.c. I wasn't sure either, and it doesn't particularly bother me where they go, as long as they do go somewhere. Your call. > > +++ kernel/include/asm-sh/irq.h Tue Oct 10 22:27:45 2000 > > Basically OK. But I'm not sure about the implementation of > dispatch_virtual_irq. Neither am I ;-) I'm pretty unhappy about needing to use it at all, but that need arises from the braindead nature of the HD64465 PCMCIA features. Note that the current code is my *third* attempt at delivering IRQs properly. If you can suggest a better way I'd be happy to follow it. As for implementation issues, I know it doesn't handle IRQ_DISABLED at all. I can add that easily enough. > +++ kernel/arch/sh/kernel/irq.c Tue Oct 10 19:56:23 2000 > +int dispatch_virtual_irq(unsigned int irq, struct pt_regs * regs) > > Please let me think for a while for this. Sure. > +++ kernel/include/asm-sh/ide.h Fri Sep 29 06:10:52 2000 > +#define NO_ONBOARD_IDE 1 > > Umm... it looks not good. Pending. I agree, ugly. At the time it seemed necessary because the IDE code was probing non-existant ISA ports looking for the standard ide0 and ide1 ports, and this was oopsing. I've since fixed the ISA port mapping code so that probing non-existant ports is harmless; perhaps NO_ONBOARD_IDE code can go away now. All it does now is prevent wastage of those ports in systems which support IDE on PCMCIA but have no native IDE of their own (a system like this is sitting on my desk now). > > +++ kernel/include/asm-sh/pgtable.h Sun Oct 1 12:01:12 2000 > > Currently I don't understand this. Please give me more time. I should have provided more comments ;-) Basically, I grab 4 of the unused (either by hw or sw) bits of the PTE and use them to store bits which get shifted into the TC and SA bits of the PTEA by the TLB miss handler. The rest is just fancy footwork to provide an interface for encoding those bits. Greg. -- These are my opinions not PPIs. |
From: NIIBE Y. <gn...@ch...> - 2000-10-12 04:34:29
|
Greg Banks wrote: > This means that PCMCIA IO-space mappings are loaded > into the TLB in exactly the same way as other mappings. > In particular, wired TLB entries are *not* used. But > the downside is a small number of extra instructions in > the main path for all TLB misses (PCMCIA and non-PCMCIA > alike). > > My question is, is this approach acceptable? Is the > performance hit in the TLB miss handler worth freeing > up the TLB slots when PCMCIA is not being heavily used? I think that wired TLB entry is better. Some (or most) drivers don't expect TLB fault would occur with I/O access functions. -- |
From: NIIBE Y. <gn...@ch...> - 2000-10-12 04:27:28
|
My network connection is quite bad these days, because of the restructuring of my company. I think I can be "in sync" this weekend. For the patch by Greg, here's my comment. +++ kernel/arch/sh/config.in Fri Sep 29 03:13:26 2000 +++ kernel/arch/sh/kernel/Makefile Wed Sep 27 03:28:54 2000 +++ kernel/arch/sh/kernel/sh_ksyms.c Tue Oct 10 19:56:39 2000 +++ kernel/include/asm-sh/io.h Wed Sep 27 10:11:34 2000 +++ kernel/include/asm-sh/mmu_context.h Sun Oct 1 13:18:06 2000 +++ kernel/include/asm-sh/machvec.h Sat Sep 23 05:34:00 2000 +++ kernel/include/asm-sh/io_hd64461.h Sat Sep 23 05:21:26 2000 +++ kernel/arch/sh/mm/fault.c Sun Oct 1 13:56:02 2000 OK. +++ kernel/arch/sh/kernel/io_hd64465.c Sun Oct 1 04:57:59 2000 +++ kernel/arch/sh/kernel/mach_foobar.c Sat Sep 30 10:59:41 2000 +++ kernel/arch/sh/kernel/setup_hd64465.c Tue Oct 10 20:02:53 2000 +++ kernel/include/asm-sh/hd64465.h Sat Sep 30 11:00:17 2000 +++ kernel/include/asm-sh/io_hd64465.h Tue Oct 10 20:18:29 2000 OK. +++ kernel/drivers/pcmcia/Config.in Mon Sep 25 23:41:41 2000 +++ kernel/drivers/pcmcia/Makefile Mon Sep 25 23:54:05 2000 +++ kernel/drivers/pcmcia/hd64465_ss.c Tue Oct 10 20:14:28 2000 OK for me. (Actually I don't care. :-) Could you please send this part to PCMCIA driver maintainer directly? Please check them in. ---------------------------------------------- +++ kernel/arch/sh/kernel/io.c Fri Sep 29 09:44:43 2000 +++ kernel/arch/sh/kernel/io_generic.c Tue Sep 26 01:59:37 2000 For those, I'm not sure now. EXPORT_SYMBOL shoule be here or in sh_ksyms.c. +++ kernel/include/asm-sh/irq.h Tue Oct 10 22:27:45 2000 Basically OK. But I'm not sure about the implementation of dispatch_virtual_irq. +++ kernel/arch/sh/kernel/irq.c Tue Oct 10 19:56:23 2000 +int dispatch_virtual_irq(unsigned int irq, struct pt_regs * regs) Please let me think for a while for this. +++ kernel/include/asm-sh/ide.h Fri Sep 29 06:10:52 2000 +#define NO_ONBOARD_IDE 1 Umm... it looks not good. Pending. +++ kernel/include/asm-sh/pgtable.h Sun Oct 1 12:01:12 2000 Currently I don't understand this. Please give me more time. -- |
From: Greg B. <gb...@po...> - 2000-10-11 10:59:11
|
G'day I've uploaded a new version of my HD64465 PCMCIA patch to sourceforge http://sourceforge.net/patch/download.php?id=101674 Niibe-san, I want to check if you're happy about an architectural aspect of my patch, which Peter Hung and I have been discussing. I've used the MMU to set up mappings for PCMCIA IO-space. My approach has been to use get_vm_area() to allocate a region of kernel-only VM, then setup mappings using remap_page_range() (i.e. like ioremap() does on x86). I've extended the PTE bits to encode the TC and SA bits needed for PCMCIA mappings, and extended the TLB miss handler to load the PTEA register by shifting and masking bits from the PTE. To supply TC&SA bits for PCMCIA mappings, a special pgprot_t value is constructed by the PCMCIA host bridge driver and passed to remap_page_range(). This means that PCMCIA IO-space mappings are loaded into the TLB in exactly the same way as other mappings. In particular, wired TLB entries are *not* used. But the downside is a small number of extra instructions in the main path for all TLB misses (PCMCIA and non-PCMCIA alike). My question is, is this approach acceptable? Is the performance hit in the TLB miss handler worth freeing up the TLB slots when PCMCIA is not being heavily used? Greg. -- These are my opinions not PPIs. |
From: Greg B. <gb...@po...> - 2000-10-06 22:37:15
|
G'day NIIBE Yutaka wrote: > > Greg Banks wrote: > > I've just uploaded to the Sourceforge patch manager a patch (101674) > > which contains my PCMCIA support code for the HD64465. I've even added > > an example machine vector entry for a HD64465-based `FOOBAR' machine, > > which you can use to add '65 support to your machine. The latest verion of my patch, now available on sourceforge, is capable of mounting a file system on a PCMCIA-ATA flash card, and reading & writing files. Some parts of the code need cleaning up, e.g. the hack which gets around the problem of autoprobing twice-virtual interrupts from the PC card. Niibe-san, have you been able to take a look at it? Greg. -- These are my opinions not PPIs. |
From: Bryan R. <br...@ix...> - 2000-10-03 23:57:07
|
Hello, I am having trouble linking an SH4 vmlinux from the latest CVS kernel sources. Has anyone else run into this: sh-linux-gnu-ld -EL -T arch/sh/vmlinux.lds -e _stext arch/sh/kernel/head.o arch/sh/kernel/init_task.o init/main.o init/version.o \ --start-group \ arch/sh/kernel/kernel.o arch/sh/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o arch/sh/overdrive/overdrive.o \ drivers/block/block.o drivers/char/char.o drivers/misc/misc.o drivers/net/net.o drivers/media/media.o drivers/parport/parport.a \ net/network.o \ /home/bryan/src/sh/kernel/arch/sh/lib/lib.a /home/bryan/src/sh/kernel/lib/lib.a /home/bryan/src/sh/kernel/arch/sh/lib/lib.a /usr/local/sh.new/lib/gcc-lib/sh-linux-gnu/2.95.2/m4/libgcc.a \ --end-group \ -o vmlinux make: *** [vmlinux] Segmentation fault Does the latest CVS kernel require some new version of binutils/gcc to correctly compile/link, or is this a kernel bug (upstream or otherwise)? Thanks, Bryan -- Bryan Rittmeyer mailto:br...@ix... Ixia Communications 26601 W. Agoura Rd. Calabasas, CA 91302 |
From: NIIBE Y. <gn...@ch...> - 2000-10-03 00:52:10
|
NIIBE Yutaka wrote: > Because the ABI is different, we have our independent BFD-name for > newer Binutils. I've committed this, then I sent Linus the update of our kernel to prepare the support for new Binutils. I've sent a small patch to binutils. I think that we're ready to move to new tool-chain. With Stuart patch, I've tried GNU C Library 2.1.94, works, but it's not compatible, we need to update the version number. When I'll test through the system, I'll send notice to linux-sh. -- |
From: Stuart M. <Stu...@st...> - 2000-10-02 10:34:10
|
On Sep 30, 12:10pm, gn...@ch... wrote: > Subject: Re: [linuxsh-dev] Other changes > > Stuart Menefy wrote: > > I was pondering the syscall syscall a few weeks ago, when some software I > > was porting needed it, and I don't really see the need for it. I guess > > the advantage is it will appear as a syscall in an strace listing, the > > disadvantage is it won't appear as a 'normal' broken down system call in > > the strace output. And that was the only benefit I could see for it. > > Agreed. > > > So the approch I took was to do the whole thing in glibc, there doesn't > > appear to be any need for it in the kernel. > > Good. > > > Or am I missing something? > > I just put it as Kaz' kernel has the system call. I think the libc > approach is better. I withdraw the change in the kernel. > > I'll include your change of GNU C Library. Is it OK for you? Sounds good to me. I've got a couple more gcc changes I'd like to incorporate (making -with-cpu work and adding inline support for ffs), which I'll tidy up and post in the new few days. Stuart |
From: Greg B. <gb...@po...> - 2000-09-30 08:35:38
|
NIIBE Yutaka wrote: > > Greg Banks wrote: > > I've just uploaded to the Sourceforge patch manager a patch (101674) > > which contains my PCMCIA support code for the HD64465. I've even added > > an example machine vector entry for a HD64465-based `FOOBAR' machine, > > which you can use to add '65 support to your machine. > [...] > > > > > > https://sourceforge.net/patch/?func=detailpatch&patch_id=101674&group_id=2682 > > I looked through the patches by Peter. I've tried to look yours, but > it seems that it's gzipped(?), I can't look that. Well it was. I thought I'd better gzip it because it was so large. But it seems to be causing confusion, so the new version I just uploaded is not gzip'ed anymore. > > How things are different between HD64463 and HD64465? I've attached a list of differences (thanks to Mitch for working this out). > > If there's no objection, I'd like to incorportate Peter's patch one by > one. I see the include files (the definition of HD6446x) and frame > buffer driver are sane to be included. > > How do you think? I think you should read my patch. I've attached a summary of what it does. I've also attached a boot log showing what the code does, which is really cool. Mitch and I are having lots of fun on this current project, and seeing a PCMCIA Ethernet interface appear for the first time was a real buzz ;-) That url again: http://sourceforge.net/patch/?func=detailpatch&patch_id=101674&group_id=2682 BTW, congratulations on the doner kebab ;-) Greg. -- These are my opinions not PPIs. |
From: Peter H. <pe...@xl...> - 2000-09-30 04:42:33
|
On Sat, Sep 30, 2000 at 01:12:10PM +0900, NIIBE Yutaka wrote: > I looked through the patches by Peter. I've tried to look yours, but > it seems that it's gzipped(?), I can't look that. Yes it is a gzip file. (Greg Bank tell me) > How things are different between HD64463 and HD64465? The different between them is HD64465 has pci controller but HD64463 does't. HD64463 has something (framebuffer?) but HD64465 does't. > If there's no objection, I'd like to incorportate Peter's patch one by > one. I see the include files (the definition of HD6446x) and frame > buffer driver are sane to be included. Thanks. Do you need new patch for linux-2.4.0-test6? (I had merge to test6 recently) The frame of PCMCIA driver for CallistoPro is finish yet and need some test. If it is Ok, i will upload to sourceforge. - PhantomCat -- Peter Hung * Email : pe...@xl... Engineer @ XLinux Inc. * Phone : 886-919-616-535 |
From: NIIBE Y. <gn...@ch...> - 2000-09-30 04:12:17
|
Greg Banks wrote: > I've just uploaded to the Sourceforge patch manager a patch (101674) > which contains my PCMCIA support code for the HD64465. I've even added > an example machine vector entry for a HD64465-based `FOOBAR' machine, > which you can use to add '65 support to your machine. [...] > BTW, I have more 64465 support code which I can't release yet. Sorry. > > > https://sourceforge.net/patch/?func=detailpatch&patch_id=101674&group_id=2682 I looked through the patches by Peter. I've tried to look yours, but it seems that it's gzipped(?), I can't look that. How things are different between HD64463 and HD64465? If there's no objection, I'd like to incorportate Peter's patch one by one. I see the include files (the definition of HD6446x) and frame buffer driver are sane to be included. How do you think? -- |
From: NIIBE Y. <gn...@ch...> - 2000-09-30 03:39:27
|
Bryan Rittmeyer wrote: > I think this one should be good to go into the CVS archive. Should I > submit it through the SourceSafe patch manager or can you take care of > it, Niibe-san? Thanks. Applied and committed. -- |
From: NIIBE Y. <gn...@ch...> - 2000-09-30 03:11:05
|
Stuart Menefy wrote: > I was pondering the syscall syscall a few weeks ago, when some software I > was porting needed it, and I don't really see the need for it. I guess > the advantage is it will appear as a syscall in an strace listing, the > disadvantage is it won't appear as a 'normal' broken down system call in > the strace output. And that was the only benefit I could see for it. Agreed. > So the approch I took was to do the whole thing in glibc, there doesn't > appear to be any need for it in the kernel. Good. > Or am I missing something? I just put it as Kaz' kernel has the system call. I think the libc approach is better. I withdraw the change in the kernel. I'll include your change of GNU C Library. Is it OK for you? -- |
From: NIIBE Y. <gn...@ch...> - 2000-09-30 03:06:19
|
Hi Mitch, When I was in Germany last week, I've eaten _real_ Donner Kebab, it's great. Mitch Davis wrote: > Looking at your mail, this code keeps its dollar: > > > "mov $r0, $r4\n\t" /* return value to arg of exit */ > > - "mov %2, $r3\n\t" /* exit */ > > + "mov %1, $r3\n\t" /* exit */ > > "trapa #0x11\n" This "$" is used by the assembler only. > This code does not: > > > { > > - register long r0 __asm__("$r0") = func; > > - register long r4 __asm__("$r4") = arg0; > > - register long r5 __asm__("$r5") = arg1; > > - register long r6 __asm__("$r6") = arg2; > > - register long r7 __asm__("$r7") = arg3; > > + register long r0 __asm__("r0") = func; > > + register long r4 __asm__("r4") = arg0; > > + register long r5 __asm__("r5") = arg1; > > + register long r6 __asm__("r6") = arg2; > > + register long r7 __asm__("r7") = arg3; > > __asm__ __volatile__("trapa #0x3f" This "$" is used for C compiler, which I think not needed, or it is good not to have. I'm not sure, which is good. When I incorporated the patch by Jesper (the T-flag patch) with "t", I found that it would be more consistent using such like "r0" for C compiler. You know, the use of "$t" is bogus. We never use such specification with assembler (since there are specific instruction for T-flag (clrt, movt...). How do you think? -- |
From: Bryan R. <br...@ix...> - 2000-09-29 21:42:42
|
NIIBE Yutaka wrote: > I think that "memscan" is bogus here, as we define memscan==>memchr in > asm-sh/string.h, isn't it? Except that, all is OK. Yes, you're correct. Sorry about that mistake. Here's the new patch: ------ --- sh_ksyms-orig.c Tue Sep 26 13:46:27 2000 +++ sh_ksyms.c Tue Sep 26 14:35:22 2000 @@ -17,6 +17,7 @@ #include <asm/hardirq.h> #include <asm/delay.h> #include <asm/irq.h> +#include <asm/pgtable.h> extern void dump_thread(struct pt_regs *, struct user *); extern int dump_fpu(elf_fpregset_t *); @@ -36,6 +37,21 @@ EXPORT_SYMBOL(strpbrk); EXPORT_SYMBOL(strstr); EXPORT_SYMBOL(strlen); + +/* mem exports */ +EXPORT_SYMBOL(memcpy); +EXPORT_SYMBOL(memset); +EXPORT_SYMBOL(memmove); + +/* this is not provided by arch/sh/lib/*.S but is + potentially needed by modules (af_packet.o/unix.o + use memcmp, for instance) */ +EXPORT_SYMBOL(memcmp); + +/* needed by some modules */ +EXPORT_SYMBOL(flush_dcache_page); #ifdef CONFIG_VT ----- I think this one should be good to go into the CVS archive. Should I submit it through the SourceSafe patch manager or can you take care of it, Niibe-san? Regards, Bryan -- Bryan Rittmeyer mailto:br...@ix... Ixia Communications 26601 W. Agoura Rd. Calabasas, CA 91302 |
From: Stuart M. <Stu...@st...> - 2000-09-29 18:05:56
|
Folks I was pondering the syscall syscall a few weeks ago, when some software I was porting needed it, and I don't really see the need for it. I guess the advantage is it will appear as a syscall in an strace listing, the disadvantage is it won't appear as a 'normal' broken down system call in the strace output. And that was the only benefit I could see for it. So the approch I took was to do the whole thing in glibc, there doesn't appear to be any need for it in the kernel. Or am I missing something? Stuart --- /dev/null Tue May 5 21:32:27 1998 +++ sysdeps/unix/sysv/linux/sh/syscall.S Thu Sep 14 23:53:58 2000 @@ -0,0 +1,66 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <sysdep.h> + +ENTRY (syscall) + mov r4, r3 // syscall number + mov r5, r4 // p1 + mov r6, r5 // p2 + mov r7, r6 // p3 + mov.l @$r15, $r7 // p4 + mov.l @(4,$r15), $r0 // p5 + mov.l @(8,$r15), $r1 // p6 + mov.l @(12,$r15), $r2 // p7 + trapa #0x17 + mov r0, r1 + mov #-12, r2 + shad r2, r1 + not r1, r1 // r1=0 means r0 = -1 to -4095 + tst r1, r1 // i.e. error in linux + bf 1f + mov.l .L2, r1 +#ifdef PIC + mov r0, r4 + mov.l r12, @-r15 + sts.l pr, @-r15 + mov.l 0f, r12 + mova 0f, r0 + add r0, r12 + mova .L2, r0 + add r0, r1 + jsr @r1 + nop + lds.l @r15+, pr + rts + mov.l @r15+, r12 + .align 2 +0: + .long _GLOBAL_OFFSET_TABLE_ +#else + jmp @r1 + mov r0, r4 +#endif +1: + rts + nop + + .align 2 +.L2: + .long PLTJMP(C_SYMBOL_NAME(__syscall_error)) +PSEUDO_END (syscall) |
From: Mitch D. <md...@po...> - 2000-09-29 17:53:33
|
NIIBE Yutaka wrote: > > Support "syscall" syscall and assembler change. The register name > in the input/output/clobber list, no "$" would be correct. Hi Niibe-san, A couple of months ago, registers did not have dollar signs on the front. But then the decision was made to add dollars (which I think is a good idea). For a while we had code with both styles, but we got that sorted out. Now I see code without dollars again - sometimes. Looking at your mail, this code keeps its dollar: > "mov $r0, $r4\n\t" /* return value to arg of exit */ > - "mov %2, $r3\n\t" /* exit */ > + "mov %1, $r3\n\t" /* exit */ > "trapa #0x11\n" This code does not: > { > - register long r0 __asm__("$r0") = func; > - register long r4 __asm__("$r4") = arg0; > - register long r5 __asm__("$r5") = arg1; > - register long r6 __asm__("$r6") = arg2; > - register long r7 __asm__("$r7") = arg3; > + register long r0 __asm__("r0") = func; > + register long r4 __asm__("r4") = arg0; > + register long r5 __asm__("r5") = arg1; > + register long r6 __asm__("r6") = arg2; > + register long r7 __asm__("r7") = arg3; > __asm__ __volatile__("trapa #0x3f" I am very confused. I am not questioning your wisdom, but I do wish I knew what the rationale is - when should one use a dollar, when should one not, and what should we do in the future. Regards, Mitch. |
From: NIIBE Y. <gn...@ch...> - 2000-09-29 13:36:57
|
Support "syscall" syscall and assembler change. The register name in the input/output/clobber list, no "$" would be correct. 2000-09-29 NIIBE Yutaka <gn...@m1...> * arch/sh/kernel/sys_sh.c (sys_syscall): New function. * arch/sh/kernel/entry.S (sys_call_table:0): Assign sys_syscall. * include/asm-sh/unistd.h (__NR_syscall): New macro. (setup): Removed. 2000-09-28 NIIBE Yutaka <gn...@m1...> * include/asm-sh/system.h (switch_to): Add T-flag to the clobber list of asm statements. * arch/sh/kernel/entry.S (sys_fcntl64): Added. * include/asm/unistd.h (__NR_fcntl64): Added. 2000-09-27 NIIBE Yutaka <gn...@m1...> * include/asm/unistd.h (_syscall0, _syscall1, _syscall2, _syscall3, _syscall4, _syscall5): Don't put "$" prefix for register name. * include/asm-sh/system.h (switch_to): Likewise. * arch/sh/kernel/sh_bios.c (sh_bios_call): Likewise. * arch/sh/kernel/process.c (kernel_thread): Likewise. Use __sc0 and __sc3. Index: arch/sh/kernel/entry.S =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/entry.S,v retrieving revision 1.25 diff -u -r1.25 entry.S --- arch/sh/kernel/entry.S 2000/09/09 01:45:20 1.25 +++ arch/sh/kernel/entry.S 2000/09/29 13:26:05 @@ -937,7 +937,7 @@ #endif ENTRY(sys_call_table) - .long SYMBOL_NAME(sys_ni_syscall) /* 0 - old "setup()" system call*/ + .long SYMBOL_NAME(sys_syscall) /* 0 */ .long SYMBOL_NAME(sys_exit) .long SYMBOL_NAME(sys_fork) .long SYMBOL_NAME(sys_read) @@ -1158,6 +1158,7 @@ .long SYMBOL_NAME(sys_mincore) .long SYMBOL_NAME(sys_madvise) .long SYMBOL_NAME(sys_getdents64) /* 220 */ + .long SYMBOL_NAME(sys_fcntl64) /* * NOTE!! This doesn't have to be exact - we just have @@ -1165,7 +1166,7 @@ * entries. Don't panic if you notice that this hasn't * been shrunk every time we add a new system call. */ - .rept NR_syscalls-220 + .rept NR_syscalls-221 .long SYMBOL_NAME(sys_ni_syscall) .endr Index: arch/sh/kernel/process.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/process.c,v retrieving revision 1.13 diff -u -r1.13 process.c --- arch/sh/kernel/process.c 2000/09/06 00:22:10 1.13 +++ arch/sh/kernel/process.c 2000/09/29 13:26:05 @@ -136,11 +136,12 @@ */ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) { /* Don't use this in BL=1(cli). Or else, CPU resets! */ - register unsigned long __sc0 __asm__ ("$r3") = __NR_clone; - register unsigned long __sc4 __asm__ ("$r4") = (long) flags | CLONE_VM; - register unsigned long __sc5 __asm__ ("$r5") = 0; - register unsigned long __sc8 __asm__ ("$r8") = (long) arg; - register unsigned long __sc9 __asm__ ("$r9") = (long) fn; + register unsigned long __sc0 __asm__ ("r0"); + register unsigned long __sc3 __asm__ ("r3") = __NR_clone; + register unsigned long __sc4 __asm__ ("r4") = (long) flags | CLONE_VM; + register unsigned long __sc5 __asm__ ("r5") = 0; + register unsigned long __sc8 __asm__ ("r8") = (long) arg; + register unsigned long __sc9 __asm__ ("r9") = (long) fn; __asm__("trapa #0x12\n\t" /* Linux/SH system call */ "tst #0xff, $r0\n\t" /* child or parent? */ @@ -148,13 +149,13 @@ "jsr @$r9\n\t" /* call fn */ " mov $r8, $r4\n\t" /* push argument */ "mov $r0, $r4\n\t" /* return value to arg of exit */ - "mov %2, $r3\n\t" /* exit */ + "mov %1, $r3\n\t" /* exit */ "trapa #0x11\n" "1:" : "=z" (__sc0) - : "0" (__sc0), "i" (__NR_exit), - "r" (__sc4), "r" (__sc5), "r" (__sc8), "r" (__sc9) - : "memory"); + : "i" (__NR_exit), "r" (__sc3), "r" (__sc4), "r" (__sc5), + "r" (__sc8), "r" (__sc9) + : "memory", "t"); return __sc0; } Index: arch/sh/kernel/sh_bios.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/sh_bios.c,v retrieving revision 1.2 diff -u -r1.2 sh_bios.c --- arch/sh/kernel/sh_bios.c 2000/07/26 04:37:32 1.2 +++ arch/sh/kernel/sh_bios.c 2000/09/29 13:26:05 @@ -20,11 +20,11 @@ static __inline__ long sh_bios_call(long func, long arg0, long arg1, long arg2, long arg3) { - register long r0 __asm__("$r0") = func; - register long r4 __asm__("$r4") = arg0; - register long r5 __asm__("$r5") = arg1; - register long r6 __asm__("$r6") = arg2; - register long r7 __asm__("$r7") = arg3; + register long r0 __asm__("r0") = func; + register long r4 __asm__("r4") = arg0; + register long r5 __asm__("r5") = arg1; + register long r6 __asm__("r6") = arg2; + register long r7 __asm__("r7") = arg3; __asm__ __volatile__("trapa #0x3f" : "=z" (r0) : "0" (r0), "r" (r4), "r" (r5), "r" (r6), "r" (r7) Index: arch/sh/kernel/sys_sh.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/sys_sh.c,v retrieving revision 1.4 diff -u -r1.4 sys_sh.c --- arch/sh/kernel/sys_sh.c 2000/07/06 03:58:37 1.4 +++ arch/sh/kernel/sys_sh.c 2000/09/29 13:26:05 @@ -8,6 +8,7 @@ * Taken from i386 version. */ +#include <linux/sys.h> #include <linux/errno.h> #include <linux/sched.h> #include <linux/mm.h> @@ -20,6 +21,7 @@ #include <linux/mman.h> #include <linux/file.h> #include <linux/utsname.h> +#include <linux/unistd.h> #include <asm/uaccess.h> #include <asm/ipc.h> @@ -194,4 +196,43 @@ current->state = TASK_INTERRUPTIBLE; schedule(); return -ERESTARTNOHAND; +} + +typedef asmlinkage int (*syscall_t)(void *a0,...); + +/* + * Do the indirect syscall syscall. + * Only support less than three arguments. + * + * XXX: Should check the compiler's output: There shoule be no use of stack. + */ +asmlinkage int sys_syscall(unsigned long nr, unsigned long r5, + unsigned long r6, unsigned long r7) +{ + extern syscall_t *sys_call_table; + syscall_t syscall; + + if (nr > NR_syscalls) + return -ENOSYS; + + if (nr == __NR_syscall) + return -EINVAL; + + syscall = sys_call_table[nr]; + if (syscall == NULL) + return -ENOSYS; + + { + register long __r3 __asm__ ("r3") = nr; + register long __r4 __asm__ ("r4") = r5; + register long __r5 __asm__ ("r5") = r6; + register long __r6 __asm__ ("r6") = r7; + + asm volatile("jmp @%0; nop" + : : "z" (syscall), + "r" (__r3), "r" (__r4), + "r" (__r5), "r" (__r6)); + } + /* NEVER reached */ + return 0; } Index: include/asm-sh/system.h =================================================================== RCS file: /cvsroot/linuxsh/kernel/include/asm-sh/system.h,v retrieving revision 1.9 diff -u -r1.9 system.h --- include/asm-sh/system.h 2000/09/26 01:32:31 1.9 +++ include/asm-sh/system.h 2000/09/29 13:26:12 @@ -21,12 +21,12 @@ #define prepare_to_switch() do { } while(0) #define switch_to(prev,next,last) do { \ register struct task_struct *__last; \ - register unsigned long *__ts1 __asm__ ("$r1") = &prev->thread.sp; \ - register unsigned long *__ts2 __asm__ ("$r2") = &prev->thread.pc; \ - register unsigned long *__ts4 __asm__ ("$r4") = (unsigned long *)prev; \ - register unsigned long *__ts5 __asm__ ("$r5") = (unsigned long *)next; \ - register unsigned long *__ts6 __asm__ ("$r6") = &next->thread.sp; \ - register unsigned long __ts7 __asm__ ("$r7") = next->thread.pc; \ + register unsigned long *__ts1 __asm__ ("r1") = &prev->thread.sp; \ + register unsigned long *__ts2 __asm__ ("r2") = &prev->thread.pc; \ + register unsigned long *__ts4 __asm__ ("r4") = (unsigned long *)prev; \ + register unsigned long *__ts5 __asm__ ("r5") = (unsigned long *)next; \ + register unsigned long *__ts6 __asm__ ("r6") = &next->thread.sp; \ + register unsigned long __ts7 __asm__ ("r7") = next->thread.pc; \ __asm__ __volatile__ (".balign 4\n\t" \ "stc.l $gbr, @-$r15\n\t" \ "sts.l $pr, @-$r15\n\t" \ @@ -63,7 +63,7 @@ :"0" (prev), \ "r" (__ts1), "r" (__ts2), \ "r" (__ts4), "r" (__ts5), "r" (__ts6), "r" (__ts7) \ - :"r3"); \ + :"r3", "t"); \ last = __last; \ } while (0) #endif Index: include/asm-sh/unistd.h =================================================================== RCS file: /cvsroot/linuxsh/kernel/include/asm-sh/unistd.h,v retrieving revision 1.6 diff -u -r1.6 unistd.h --- include/asm-sh/unistd.h 2000/08/23 01:37:38 1.6 +++ include/asm-sh/unistd.h 2000/09/29 13:26:12 @@ -9,7 +9,7 @@ * This file contains the system call numbers. */ -#define __NR_setup 0 /* used only by init, to get system going */ +#define __NR_syscall 0 #define __NR_exit 1 #define __NR_fork 2 #define __NR_read 3 @@ -85,7 +85,7 @@ #define __NR_sigpending 73 #define __NR_sethostname 74 #define __NR_setrlimit 75 -#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ +#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ #define __NR_getrusage 77 #define __NR_gettimeofday 78 #define __NR_settimeofday 79 @@ -230,6 +230,7 @@ #define __NR_mincore 218 #define __NR_madvise 219 #define __NR_getdents64 220 +#define __NR_fcntl64 221 /* user-visible error numbers are in the range -1 - -125: see <asm-sh/errno.h> */ @@ -249,7 +250,7 @@ #define _syscall0(type,name) \ type name(void) \ { \ -register long __sc0 __asm__ ("$r3") = __NR_##name; \ +register long __sc0 __asm__ ("r3") = __NR_##name; \ __asm__ __volatile__ ("trapa #0x10" \ : "=z" (__sc0) \ : "0" (__sc0) \ @@ -260,8 +261,8 @@ #define _syscall1(type,name,type1,arg1) \ type name(type1 arg1) \ { \ -register long __sc0 __asm__ ("$r3") = __NR_##name; \ -register long __sc4 __asm__ ("$r4") = (long) arg1; \ +register long __sc0 __asm__ ("r3") = __NR_##name; \ +register long __sc4 __asm__ ("r4") = (long) arg1; \ __asm__ __volatile__ ("trapa #0x11" \ : "=z" (__sc0) \ : "0" (__sc0), "r" (__sc4) \ @@ -272,9 +273,9 @@ #define _syscall2(type,name,type1,arg1,type2,arg2) \ type name(type1 arg1,type2 arg2) \ { \ -register long __sc0 __asm__ ("$r3") = __NR_##name; \ -register long __sc4 __asm__ ("$r4") = (long) arg1; \ -register long __sc5 __asm__ ("$r5") = (long) arg2; \ +register long __sc0 __asm__ ("r3") = __NR_##name; \ +register long __sc4 __asm__ ("r4") = (long) arg1; \ +register long __sc5 __asm__ ("r5") = (long) arg2; \ __asm__ __volatile__ ("trapa #0x12" \ : "=z" (__sc0) \ : "0" (__sc0), "r" (__sc4), "r" (__sc5) \ @@ -285,10 +286,10 @@ #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ type name(type1 arg1,type2 arg2,type3 arg3) \ { \ -register long __sc0 __asm__ ("$r3") = __NR_##name; \ -register long __sc4 __asm__ ("$r4") = (long) arg1; \ -register long __sc5 __asm__ ("$r5") = (long) arg2; \ -register long __sc6 __asm__ ("$r6") = (long) arg3; \ +register long __sc0 __asm__ ("r3") = __NR_##name; \ +register long __sc4 __asm__ ("r4") = (long) arg1; \ +register long __sc5 __asm__ ("r5") = (long) arg2; \ +register long __sc6 __asm__ ("r6") = (long) arg3; \ __asm__ __volatile__ ("trapa #0x13" \ : "=z" (__sc0) \ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) \ @@ -299,11 +300,11 @@ #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ { \ -register long __sc0 __asm__ ("$r3") = __NR_##name; \ -register long __sc4 __asm__ ("$r4") = (long) arg1; \ -register long __sc5 __asm__ ("$r5") = (long) arg2; \ -register long __sc6 __asm__ ("$r6") = (long) arg3; \ -register long __sc7 __asm__ ("$r7") = (long) arg4; \ +register long __sc0 __asm__ ("r3") = __NR_##name; \ +register long __sc4 __asm__ ("r4") = (long) arg1; \ +register long __sc5 __asm__ ("r5") = (long) arg2; \ +register long __sc6 __asm__ ("r6") = (long) arg3; \ +register long __sc7 __asm__ ("r7") = (long) arg4; \ __asm__ __volatile__ ("trapa #0x14" \ : "=z" (__sc0) \ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), \ @@ -315,12 +316,12 @@ #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ { \ -register long __sc3 __asm__ ("$r3") = __NR_##name; \ -register long __sc4 __asm__ ("$r4") = (long) arg1; \ -register long __sc5 __asm__ ("$r5") = (long) arg2; \ -register long __sc6 __asm__ ("$r6") = (long) arg3; \ -register long __sc7 __asm__ ("$r7") = (long) arg4; \ -register long __sc0 __asm__ ("$r0") = (long) arg5; \ +register long __sc3 __asm__ ("r3") = __NR_##name; \ +register long __sc4 __asm__ ("r4") = (long) arg1; \ +register long __sc5 __asm__ ("r5") = (long) arg2; \ +register long __sc6 __asm__ ("r6") = (long) arg3; \ +register long __sc7 __asm__ ("r7") = (long) arg4; \ +register long __sc0 __asm__ ("r0") = (long) arg5; \ __asm__ __volatile__ ("trapa #0x15" \ : "=z" (__sc0) \ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \ @@ -345,7 +346,6 @@ */ #define __NR__exit __NR_exit static __inline__ _syscall0(int,pause) -static __inline__ _syscall1(int,setup,int,magic) static __inline__ _syscall0(int,sync) static __inline__ _syscall0(pid_t,setsid) static __inline__ _syscall3(int,write,int,fd,const char *,buf,off_t,count) |
From: NIIBE Y. <gn...@ch...> - 2000-09-28 11:03:44
|
Jesper Skov writes: > Below some changes to a few assembly statements that do not properly > clobber the T status bit. [...] > 2000-09-11 Jesper Skov <js...@re...> > > * include/asm-sh/unistd.h: Add T-flag to the clobber list of asm > statements. > * include/asm-sh/string.h: Same. > * include/asm-sh/delay.h: Same. > * include/asm-sh/checksum.h: Same. > * include/asm-sh/bitops.h: Same. > * arch/sh/kernel/time.c: Same. > * arch/sh/kernel/sh_bios.c: Same. > * arch/sh/kernel/irq_imask.c: Same. > * arch/sh/kernel/process.c: Same. > * include/asm-sh/uaccess.h: Same. Plus clobber memory in > copy_to_user and clear_user. I've incorporated these changes except the ones of unistd.h and sh_bios.c. The "trapa" doesn't change the T register. -- |
From: NIIBE Y. <gn...@ch...> - 2000-09-28 02:00:58
|
YAEGASHI Takeshi wrote: > Introduced new machine vectors(hp620, hp680, hp690) and now we > could support all of them more easily. Looks good for me. One thing I think we need improve is: > --- kernel/include/asm-sh/machvec.h:1.1.1.2 Tue Aug 1 23:23:17 2000 > +++ kernel/include/asm-sh/machvec.h Sun Sep 17 14:58:36 2000 > @@ -65,6 +65,9 @@ > > unsigned int mv_hw_se : 1; > unsigned int mv_hw_hp600 : 1; > + unsigned int mv_hw_hp620 : 1; > + unsigned int mv_hw_hp680 : 1; > + unsigned int mv_hw_hp690 : 1; > unsigned int mv_hw_hd64461 : 1; > }; > > @@ -74,6 +77,9 @@ > #ifdef CONFIG_SH_GENERIC > #define MACH_SE (sh_mv.mv_hw_se) > #define MACH_HP600 (sh_mv.mv_hw_hp600) > +#define MACH_HP620 (sh_mv.mv_hw_hp620) > +#define MACH_HP680 (sh_mv.mv_hw_hp680) > +#define MACH_HP690 (sh_mv.mv_hw_hp690) > #define MACH_HD64461 (sh_mv.mv_hw_hd64461) > #else > # ifdef CONFIG_SH_SOLUTION_ENGINE > @@ -85,6 +91,21 @@ > # define MACH_HP600 1 > # else > # define MACH_HP600 0 > +# endif > +# ifdef CONFIG_SH_HP620 > +# define MACH_HP620 1 > +# else > +# define MACH_HP620 0 > +# endif > +# ifdef CONFIG_SH_HP680 > +# define MACH_HP680 1 > +# else > +# define MACH_HP680 0 > +# endif > +# ifdef CONFIG_SH_HP690 > +# define MACH_HP690 1 > +# else > +# define MACH_HP690 0 > # endif > # ifdef CONFIG_HD64461 > # define MACH_HD64461 1 This does not scale well. And it's not need to be a bit, as the hardware is mutually exclusive. Well, consider later. -- |
From: YAEGASHI T. <yae...@ma...> - 2000-09-27 23:04:24
|
Here are the latest HP600 updates. These will be available at Patch Manager of SourceForge. Introduced new machine vectors(hp620, hp680, hp690) and now we could support all of them more easily. -- YAEGASHI Takeshi <yae...@ma...> Index: kernel/arch/sh/config.in diff -u kernel/arch/sh/config.in:1.1.1.9 kernel/arch/sh/config.in:1.11.2.2 --- kernel/arch/sh/config.in:1.1.1.9 Tue Sep 26 22:56:34 2000 +++ kernel/arch/sh/config.in Wed Sep 27 16:21:55 2000 @@ -28,9 +28,16 @@ "Generic CONFIG_SH_GENERIC \ SolutionEngine CONFIG_SH_SOLUTION_ENGINE \ Overdrive CONFIG_SH_OVERDRIVE \ - HP600 CONFIG_SH_HP600 \ + HP620 CONFIG_SH_HP620 \ + HP680 CONFIG_SH_HP680 \ + HP690 CONFIG_SH_HP690 \ CqREEK CONFIG_SH_CQREEK \ BareCPU CONFIG_SH_UNKNOWN" Generic + +if [ "$CONFIG_SH_HP620" = "y" -o "$CONFIG_SH_HP680" = "y" -o \ + "$CONFIG_SH_HP690" = "y" ]; then + define_bool CONFIG_SH_HP600 y +fi choice 'Processor type' \ "SH7707 CONFIG_CPU_SUBTYPE_SH7707 \ Index: kernel/arch/sh/kernel/io_hd64461.c diff -u kernel/arch/sh/kernel/io_hd64461.c:1.1.1.4 kernel/arch/sh/kernel/io_hd64461.c:1.8 --- kernel/arch/sh/kernel/io_hd64461.c:1.1.1.4 Tue Aug 1 23:25:31 2000 +++ kernel/arch/sh/kernel/io_hd64461.c Mon Sep 4 07:25:30 2000 @@ -27,6 +27,12 @@ detail of CF's memory mapped addressing. */ if (0x1f0<=port && port<=0x1f7) return 0xb5000000 + port; if (port == 0x3f6) return 0xb50001fe; + if (port == 0x3f7) return 0xb50001ff; + + /* ide1 */ + if (0x170<=port && port<=0x177) return 0xba0001f0 + port - 0x170; + if (port == 0x376) return 0xba0003f6; + if (port == 0x377) return 0xba0003f7; #endif /* ??? */ Index: kernel/arch/sh/kernel/mach_hp600.c diff -u kernel/arch/sh/kernel/mach_hp600.c:1.1.1.2 kernel/arch/sh/kernel/mach_hp600.c:1.4 --- kernel/arch/sh/kernel/mach_hp600.c:1.1.1.2 Tue Aug 1 23:25:32 2000 +++ kernel/arch/sh/kernel/mach_hp600.c Mon Sep 4 07:25:31 2000 @@ -22,8 +22,8 @@ * The Machine Vector */ -struct sh_machine_vector mv_hp600 __initmv = { - mv_name: "HP600", +struct sh_machine_vector mv_hp620 __initmv = { + mv_name: "hp620", mv_nr_irqs: 80, /* HD64461_IRQBASE+16, see hd64461.h */ @@ -58,6 +58,91 @@ mv_irq_demux: hd64461_irq_demux, mv_hw_hp600: 1, + mv_hw_hp620: 1, mv_hw_hd64461: 1, }; -ALIAS_MV(hp600) +ALIAS_MV(hp620) + + +struct sh_machine_vector mv_hp680 __initmv = { + mv_name: "hp680", + + mv_nr_irqs: 80, /* HD64461_IRQBASE+16, see hd64461.h */ + + mv_inb: hd64461_inb, + mv_inw: hd64461_inw, + mv_inl: hd64461_inl, + mv_outb: hd64461_outb, + mv_outw: hd64461_outw, + mv_outl: hd64461_outl, + + mv_inb_p: hd64461_inb_p, + mv_inw_p: hd64461_inw, + mv_inl_p: hd64461_inl, + mv_outb_p: hd64461_outb_p, + mv_outw_p: hd64461_outw, + mv_outl_p: hd64461_outl, + + mv_insb: hd64461_insb, + mv_insw: hd64461_insw, + mv_insl: hd64461_insl, + mv_outsb: hd64461_outsb, + mv_outsw: hd64461_outsw, + mv_outsl: hd64461_outsl, + + mv_readb: generic_readb, + mv_readw: generic_readw, + mv_readl: generic_readl, + mv_writeb: generic_writeb, + mv_writew: generic_writew, + mv_writel: generic_writel, + + mv_irq_demux: hd64461_irq_demux, + + mv_hw_hp600: 1, + mv_hw_hp680: 1, + mv_hw_hd64461: 1, +}; +ALIAS_MV(hp680) + + +struct sh_machine_vector mv_hp690 __initmv = { + mv_name: "hp690", + + mv_nr_irqs: 80, /* HD64461_IRQBASE+16, see hd64461.h */ + + mv_inb: hd64461_inb, + mv_inw: hd64461_inw, + mv_inl: hd64461_inl, + mv_outb: hd64461_outb, + mv_outw: hd64461_outw, + mv_outl: hd64461_outl, + + mv_inb_p: hd64461_inb_p, + mv_inw_p: hd64461_inw, + mv_inl_p: hd64461_inl, + mv_outb_p: hd64461_outb_p, + mv_outw_p: hd64461_outw, + mv_outl_p: hd64461_outl, + + mv_insb: hd64461_insb, + mv_insw: hd64461_insw, + mv_insl: hd64461_insl, + mv_outsb: hd64461_outsb, + mv_outsw: hd64461_outsw, + mv_outsl: hd64461_outsl, + + mv_readb: generic_readb, + mv_readw: generic_readw, + mv_readl: generic_readl, + mv_writeb: generic_writeb, + mv_writew: generic_writew, + mv_writel: generic_writel, + + mv_irq_demux: hd64461_irq_demux, + + mv_hw_hp600: 1, + mv_hw_hp690: 1, + mv_hw_hd64461: 1, +}; +ALIAS_MV(hp690) Index: kernel/arch/sh/kernel/setup.c diff -u kernel/arch/sh/kernel/setup.c:1.1.1.7 kernel/arch/sh/kernel/setup.c:1.3 --- kernel/arch/sh/kernel/setup.c:1.1.1.7 Mon Aug 7 02:11:20 2000 +++ kernel/arch/sh/kernel/setup.c Fri Sep 1 22:10:25 2000 @@ -49,6 +49,7 @@ */ struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 0, 0, 0, }; +struct screen_info screen_info; #ifdef CONFIG_BLK_DEV_RAM extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */ @@ -269,6 +270,7 @@ int mv_mmio_enable = 0; unsigned long bootmap_size; unsigned long start_pfn, max_pfn, max_low_pfn; + extern struct sh_machine_vector mv_unknown; #ifdef CONFIG_SH_EARLY_PRINTK sh_console_init(); @@ -298,7 +300,6 @@ #ifdef CONFIG_SH_GENERIC if (mv == NULL) { - extern struct sh_machine_vector mv_unknown; mv = &mv_unknown; if (*mv_name != '\0') { printk("Warning: Unsupported machine %s, using unknown\n", @@ -344,6 +345,9 @@ sh_mv.mv_writeb = generic_writeb; sh_mv.mv_writew = generic_writew; sh_mv.mv_writel = generic_writel; + sh_mv.mv_ioremap = generic_ioremap; + sh_mv.mv_ioremap_nocache = generic_ioremap_nocache; + sh_mv.mv_iounmap = generic_iounmap; } #endif Index: kernel/arch/sh/kernel/setup_hd64461.c diff -u kernel/arch/sh/kernel/setup_hd64461.c:1.1.1.4 kernel/arch/sh/kernel/setup_hd64461.c:1.6 --- kernel/arch/sh/kernel/setup_hd64461.c:1.1.1.4 Tue Aug 1 23:25:31 2000 +++ kernel/arch/sh/kernel/setup_hd64461.c Thu Sep 28 07:22:57 2000 @@ -120,11 +120,17 @@ printk(KERN_INFO "HD64461 configured at 0x%x on irq %d(mapped into %d to %d)\n", CONFIG_HD64461_IOBASE, CONFIG_HD64461_IRQ, HD64461_IRQBASE, HD64461_IRQBASE+15); +#if 0 #ifdef CONFIG_CPU_SUBTYPE_SH7709 /* IRQ line for HD64461 should be set level trigger mode("10"). */ /* And this should be done earlier than the kernel starts. */ - ctrl_outw(0x0200, INTC_ICR1); /* when connected to IRQ4. */ +#define HD64461_IRQ_SHIFT ((CONFIG_HD64461_IRQ-IRQ0_IRQ)*2) + ctrl_outw(((ctrl_inw(INTC_ICR1) + & (~(0x3<<HD64461_IRQ_SHIFT))) + | (0x2<<HD64461_IRQ_SHIFT)), INTC_ICR1); /* when connected to IRQx. */ #endif +#endif + outw(0x2240, INTC_ICR1); outw(0xffff, HD64461_NIMR); for (i = HD64461_IRQBASE; i < HD64461_IRQBASE + 16; i++) { @@ -135,7 +141,7 @@ #ifdef CONFIG_HD64461_ENABLER printk(KERN_INFO "HD64461: enabling PCMCIA devices\n"); - outb(0x04, HD64461_PCC1CSCIER); + outb(0x4c, HD64461_PCC1CSCIER); outb(0x00, HD64461_PCC1CSCR); #endif Index: kernel/arch/sh/kernel/time.c diff -u kernel/arch/sh/kernel/time.c:1.1.1.5 kernel/arch/sh/kernel/time.c:1.8.2.2 --- kernel/arch/sh/kernel/time.c:1.1.1.5 Tue Sep 26 22:56:34 2000 +++ kernel/arch/sh/kernel/time.c Wed Sep 27 16:21:57 2000 @@ -416,12 +416,18 @@ tmp = (frqcr & 0x2000) >> 11; tmp |= frqcr & 0x0003; pfc = pfc_table[tmp]; - if (MACH_HP600) { + if (MACH_HP620) { + master_clock = cpu_clock/4; + bus_clock = master_clock; + } + else if (MACH_HP680 || MACH_HP690) { master_clock = cpu_clock/6; - } else { + bus_clock = master_clock; + } + else { master_clock = cpu_clock; + bus_clock = master_clock/pfc; } - bus_clock = master_clock/pfc; } #elif defined(__SH4__) { @@ -447,6 +453,9 @@ current_cpu_data.master_clock = master_clock; current_cpu_data.bus_clock = bus_clock; current_cpu_data.module_clock = module_clock; + + /* Stop TMU0 */ + ctrl_outb(0, TMU_TSTR); /* Start TMU0 */ ctrl_outb(TMU_TOCR_INIT, TMU_TOCR); Index: kernel/drivers/char/hp600_keyb.c diff -u kernel/drivers/char/hp600_keyb.c:1.1.1.5 kernel/drivers/char/hp600_keyb.c:1.6 --- kernel/drivers/char/hp600_keyb.c:1.1.1.5 Tue Sep 26 22:55:41 2000 +++ kernel/drivers/char/hp600_keyb.c Tue Sep 26 05:29:04 2000 @@ -1,13 +1,17 @@ /* - * $Id$ + * $Id$ * Copyright (C) 2000 YAEGASHI Takeshi - * HP600 keyboard scan routine and translate table + * HP600 keyboard scan routine and translation table + * Copyright (C) 2000 Niibe Yutaka + * HP620 keyboard translation table */ #include <linux/kernel.h> #include <linux/sched.h> #include <linux/init.h> -#include <linux/delay.h> + +#include <asm/machvec.h> +#include <asm/delay.h> #include <asm/io.h> #include "scan_keyb.h" @@ -18,54 +22,104 @@ #define PGDR 0xa400012c #define PHDR 0xa400012e -static const unsigned char hp690_japanese_table[]={ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x29, 0x70, 0x3a, - 0x3f, 0x3e, 0x40, 0x41, 0x42, 0x3d, 0x3c, 0x3b, +static const unsigned char hp620_japanese_table[] = { + 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, - 0x00, 0x00, 0x00, 0x2c, 0x00, 0x1c, 0x28, 0x35, - 0x31, 0x30, 0x32, 0x33, 0x34, 0x2f, 0x2e, 0x2d, + 0x18, 0x19, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x50, - 0x7b, 0x38, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, + 0x26, 0x1a, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xf9, 0x73, 0x53, 0x39, 0x00, 0x1d, + 0x27, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, + 0x2a, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1e, 0x00, 0x2b, 0x1b, 0x27, - 0x23, 0x22, 0x24, 0x25, 0x26, 0x21, 0x20, 0x1f, + 0x35, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3a, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x34, - 0x00, 0x00, 0x00, 0x0f, 0x00, 0x36, 0x7d, 0x48, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, + 0x00, 0x28, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x2d, 0x2e, 0x00, 0x30, 0x31, 0x32, 0x33, - 0x00, 0x00, 0x00, 0x10, 0x00, 0x0e, 0x1a, 0x19, - 0x15, 0x14, 0x16, 0x17, 0x18, 0x13, 0x12, 0x11, + 0x48, 0x4d, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x2c, 0x38, 0x00, 0x39, 0x00, 0x29, 0x00, - 0x00, 0x00, 0x00, 0x02, 0x00, 0x0d, 0x0c, 0x0b, - 0x07, 0x06, 0x08, 0x09, 0x0a, 0x05, 0x04, 0x03, + 0x4b, 0x50, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; + +static const unsigned char hp680_japanese_table[] = { + 0x3a, 0x70, 0x29, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x3b, 0x3c, 0x3d, 0x42, 0x41, 0x40, 0x3e, 0x3f, + + 0x35, 0x28, 0x1c, 0x00, 0x2c, 0x00, 0x00, 0x00, + 0x2d, 0x2e, 0x2f, 0x34, 0x33, 0x32, 0x30, 0x31, + + 0x50, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x38, 0x7b, + + 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, + 0x1d, 0x00, 0x39, 0x53, 0x73, 0xf9, 0x00, 0x00, + + 0x27, 0x1b, 0x2b, 0x00, 0x1e, 0x00, 0x00, 0x00, + 0x1f, 0x20, 0x21, 0x26, 0x25, 0x24, 0x22, 0x23, + + 0x48, 0x7d, 0x36, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -static const unsigned char hp690_switch[]= { - 0xfd, 0xff, - 0xdf, 0xff, - 0x7f, 0xff, - 0xff, 0xfe, - 0xff, 0xfd, - 0xff, 0xf7, - 0xff, 0xbf, - 0xff, 0x7f, + 0x19, 0x1a, 0x0e, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x11, 0x12, 0x13, 0x18, 0x17, 0x16, 0x14, 0x15, + + 0x0b, 0x0c, 0x0d, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x03, 0x04, 0x05, 0x0a, 0x09, 0x08, 0x06, 0x07, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; + +static int hp620_japanese_scan_kbd(unsigned char *s) +{ + int i; + unsigned char matrix_switch[] = { + 0xfd, 0xff, 0xdf, 0xff, + 0x7f, 0xff, 0xff, 0xfe, + 0xff, 0xfd, 0xff, 0xf7, + 0xff, 0xbf, 0xff, 0x7f, + }, *t=matrix_switch; + + for(i=0; i<8; i++) { + ctrl_outb(*t++, PDDR); + ctrl_outb(*t++, PEDR); + *s++=ctrl_inb(PCDR); + *s++=ctrl_inb(PFDR); + } -static void hp690_japanese_scan_kbd(unsigned char *s) + ctrl_outb(0xff, PDDR); + ctrl_outb(0xff, PEDR); + + *s++=ctrl_inb(PGDR); + *s++=ctrl_inb(PHDR); + + return 0; +} + + +static int hp680_japanese_scan_kbd(unsigned char *s) { int i; - unsigned const char *t=hp690_switch; + unsigned char matrix_switch[] = { + 0xfd, 0xff, 0xdf, 0xff, + 0x7f, 0xff, 0xff, 0xfe, + 0xff, 0xfd, 0xff, 0xf7, + 0xff, 0xbf, 0xff, 0x7f, + }, *t=matrix_switch; - for(i=0; i<9; i++) { + for(i=0; i<8; i++) { ctrl_outb(*t++, PDDR); ctrl_outb(*t++, PEDR); *s++=ctrl_inb(PCDR); @@ -77,14 +131,22 @@ *s++=ctrl_inb(PGDR); *s++=ctrl_inb(PHDR); + + return 0; } void __init hp600_kbd_init_hw(void) { scan_kbd_init(); - register_scan_keyboard(hp690_japanese_scan_kbd, - hp690_japanese_table, 18); + + if (MACH_HP620) + register_scan_keyboard(hp620_japanese_scan_kbd, + hp620_japanese_table, 18); + else if (MACH_HP680 || MACH_HP690) + register_scan_keyboard(hp680_japanese_scan_kbd, + hp680_japanese_table, 18); + printk(KERN_INFO "HP600 matrix scan keyboard registered\n"); } Index: kernel/drivers/char/scan_keyb.c diff -u kernel/drivers/char/scan_keyb.c:1.1.1.4 kernel/drivers/char/scan_keyb.c:1.8 --- kernel/drivers/char/scan_keyb.c:1.1.1.4 Sun Sep 3 01:01:41 2000 +++ kernel/drivers/char/scan_keyb.c Tue Sep 26 03:09:18 2000 @@ -18,33 +18,40 @@ #include <linux/miscdevice.h> #include <linux/malloc.h> #include <linux/kbd_kern.h> +#include <linux/timer.h> +#define SCANHZ (HZ/20) + struct scan_keyboard { struct scan_keyboard *next; - void (*scan)(unsigned char *buffer); + int (*scan)(unsigned char *buffer); const unsigned char *table; unsigned char *s0, *s1; int length; }; - + +static int scan_jiffies=0; static struct scan_keyboard *keyboards=NULL; -static struct tq_struct task_scan_kbd; +struct timer_list scan_timer; static void check_kbd(const unsigned char *table, unsigned char *new, unsigned char *old, int length) { int need_tasklet_schedule=0; - unsigned char xor, bit; + unsigned int xor, bit; while(length-->0) { if((xor=*new^*old)==0) { table+=8; } else { - for(bit=0x80; bit!=0; bit>>=1) { + for(bit=0x01; bit<0x100; bit<<=1) { if(xor&bit) { handle_scancode(*table, !(*new&bit)); need_tasklet_schedule=1; +#if 0 + printk("0x%x %s\n", *table, (*new&bit)?"released":"pressed"); +#endif } table++; } @@ -57,26 +64,39 @@ } -static void scan_kbd(void *dummy) +static void scan_kbd(unsigned long dummy) { struct scan_keyboard *kbd; + scan_jiffies++; + for(kbd=keyboards; kbd!=NULL; kbd=kbd->next) { - if(jiffies&1) { - kbd->scan(kbd->s0); - check_kbd(kbd->table, kbd->s0, kbd->s1, kbd->length); + if(scan_jiffies&1) { + if(!kbd->scan(kbd->s0)) + check_kbd(kbd->table, + kbd->s0, kbd->s1, kbd->length); + else + memcpy(kbd->s0, kbd->s1, kbd->length); } else { - kbd->scan(kbd->s1); - check_kbd(kbd->table, kbd->s1, kbd->s0, kbd->length); + if(!kbd->scan(kbd->s1)) + check_kbd(kbd->table, + kbd->s1, kbd->s0, kbd->length); + else + memcpy(kbd->s1, kbd->s0, kbd->length); } } - queue_task(&task_scan_kbd, &tq_timer); + + init_timer(&scan_timer); + scan_timer.expires = jiffies + SCANHZ; + scan_timer.data = 0; + scan_timer.function = scan_kbd; + add_timer(&scan_timer); } -int register_scan_keyboard(void (*scan)(unsigned char *buffer), +int register_scan_keyboard(int (*scan)(unsigned char *buffer), const unsigned char *table, int length) { @@ -98,8 +118,8 @@ if (kbd->s1 == NULL) goto error_free_s0; - kbd->scan(kbd->s0); - kbd->scan(kbd->s1); + memset(kbd->s0, -1, kbd->length); + memset(kbd->s1, -1, kbd->length); kbd->next=keyboards; keyboards=kbd; @@ -119,11 +139,11 @@ void __init scan_kbd_init(void) { + init_timer(&scan_timer); + scan_timer.expires = jiffies + SCANHZ; + scan_timer.data = 0; + scan_timer.function = scan_kbd; + add_timer(&scan_timer); - task_scan_kbd.next=NULL; - task_scan_kbd.sync=0; - task_scan_kbd.routine=scan_kbd; - task_scan_kbd.data=NULL; - queue_task(&task_scan_kbd, &tq_timer); printk(KERN_INFO "Generic scan keyboard driver initialized\n"); } Index: kernel/drivers/char/scan_keyb.h diff -u kernel/drivers/char/scan_keyb.h:1.1.1.3 kernel/drivers/char/scan_keyb.h:1.2 --- kernel/drivers/char/scan_keyb.h:1.1.1.3 Fri Jul 7 11:39:53 2000 +++ kernel/drivers/char/scan_keyb.h Thu Sep 14 10:49:52 2000 @@ -6,7 +6,7 @@ * Generic scan keyboard driver */ -int register_scan_keyboard(void (*scan)(unsigned char *buffer), +int register_scan_keyboard(int (*scan)(unsigned char *buffer), const unsigned char *table, int length); Index: kernel/drivers/video/hitfb.c diff -u kernel/drivers/video/hitfb.c:1.1.1.5 kernel/drivers/video/hitfb.c:1.5 --- kernel/drivers/video/hitfb.c:1.1.1.5 Thu Aug 10 01:15:02 2000 +++ kernel/drivers/video/hitfb.c Tue Sep 26 04:50:38 2000 @@ -22,9 +22,11 @@ #include <linux/nubus.h> #include <linux/init.h> +#include <asm/machvec.h> #include <asm/uaccess.h> #include <asm/pgtable.h> #include <asm/io.h> +#include <asm/hd64461.h> #include <linux/fb.h> @@ -32,20 +34,6 @@ #include <video/fbcon-cfb8.h> #include <video/fbcon-cfb16.h> -#include <asm/hd64461.h> - -#define CONFIG_SH_LCD_VIDEOBASE CONFIG_HD64461_IOBASE+0x2000000 - -/* These are for HP Jornada 680/690. - It is desired that they are configurable... */ -#define CONFIG_SH_LCD_VIDEOSIZE 1024*1024 -#define CONFIG_SH_LCD_HORZ 640 -#define CONFIG_SH_LCD_VERT 240 -#define CONFIG_SH_LCD_DEFAULTBPP 16 - -struct hitfb_info { - struct fb_info_gen gen; -}; struct hitfb_par { @@ -53,55 +41,79 @@ int bpp; }; -static struct hitfb_info fb_info; -static struct hitfb_par current_par; -static int current_par_valid = 0; -static struct display disp; -static union { +struct hitfb_info { + struct fb_info_gen gen; + struct display disp; + struct hitfb_par current_par; + struct fb_var_screeninfo default_var; + int current_par_valid; + unsigned long hit_videobase, hit_videosize; + union { #ifdef FBCON_HAS_CFB16 - u16 cfb16[16]; + u16 cfb16[16]; #endif -} fbcon_cmap; - -unsigned long hit_videobase, hit_videosize; -static struct fb_var_screeninfo default_var; + } fbcon_cmap; +} fb_info = { + {}, + {}, + {}, + {}, + 0, 0, 0, + {}, +}; -int hitfb_init(void); -static void hitfb_set_par(struct hitfb_par *par, const struct fb_info *info); -static void hitfb_encode_var(struct fb_var_screeninfo *var, - struct hitfb_par *par, - const struct fb_info *info); +static void hitfb_set_par(const void *fb_par, struct fb_info_gen *info); +static int hitfb_encode_var(struct fb_var_screeninfo *var, const void *fb_par, + struct fb_info_gen *info); static void hitfb_detect(void) { struct hitfb_par par; + unsigned short lcdclor, ldr3, ldvntr; + + fb_info.hit_videobase = CONFIG_HD64461_IOBASE + 0x02000000; + fb_info.hit_videosize = (MACH_HP680 || MACH_HP690) ? 1024*1024 : 512*1024; - hit_videobase = CONFIG_SH_LCD_VIDEOBASE; - hit_videosize = CONFIG_SH_LCD_VIDEOSIZE; + lcdclor = inw(HD64461_LCDCLOR); + ldvntr = inw(HD64461_LDVNTR); + ldr3 = inw(HD64461_LDR3); + + switch(ldr3&15) { + default: + case 4: + par.bpp = 8; + par.x = lcdclor; + break; + case 8: + par.bpp = 16; + par.x = lcdclor/2; + break; + } - par.x = CONFIG_SH_LCD_HORZ; - par.y = CONFIG_SH_LCD_VERT; - par.bpp = CONFIG_SH_LCD_DEFAULTBPP; + par.y = ldvntr+1; hitfb_set_par(&par, NULL); - hitfb_encode_var(&default_var, &par, NULL); + hitfb_encode_var(&fb_info.default_var, &par, NULL); } -static int hitfb_encode_fix(struct fb_fix_screeninfo *fix, - struct hitfb_par *par, - const struct fb_info *info) + +static int hitfb_encode_fix(struct fb_fix_screeninfo *fix, const void *fb_par, + struct fb_info_gen *info) { + const struct hitfb_par *par = fb_par; + memset(fix, 0, sizeof(struct fb_fix_screeninfo)); strcpy(fix->id, "Hitachi HD64461"); - fix->smem_start = hit_videobase; - fix->smem_len = hit_videosize; + fix->smem_start = fb_info.hit_videobase; + fix->smem_len = fb_info.hit_videosize; fix->type = FB_TYPE_PACKED_PIXELS; fix->type_aux = 0; - fix->visual = FB_VISUAL_TRUECOLOR; + fix->visual = (par->bpp == 8) ? + FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; fix->xpanstep = 0; fix->ypanstep = 0; fix->ywrapstep = 0; @@ -120,10 +132,11 @@ } -static int hitfb_decode_var(struct fb_var_screeninfo *var, - struct hitfb_par *par, - const struct fb_info *info) +static int hitfb_decode_var(const struct fb_var_screeninfo *var, void *fb_par, + struct fb_info_gen *info) { + struct hitfb_par *par = fb_par; + par->x = var->xres; par->y = var->yres; par->bpp = var->bits_per_pixel; @@ -131,10 +144,11 @@ } -static void hitfb_encode_var(struct fb_var_screeninfo *var, - struct hitfb_par *par, - const struct fb_info *info) +static int hitfb_encode_var(struct fb_var_screeninfo *var, const void *fb_par, + struct fb_info_gen *info) { + const struct hitfb_par *par = fb_par; + memset(var, 0, sizeof(*var)); var->xres = par->x; @@ -191,25 +205,28 @@ var->green.msb_right = 0; var->blue.msb_right = 0; var->transp.msb_right = 0; + + return 0; } -static void hitfb_get_par(struct hitfb_par *par, const struct fb_info *info) +static void hitfb_get_par(void *par, struct fb_info_gen *info) { - *par = current_par; + *(struct hitfb_par *)par = fb_info.current_par; } -static void hitfb_set_par(struct hitfb_par *par, const struct fb_info *info) +static void hitfb_set_par(const void *fb_par, struct fb_info_gen *info) { - /* Set the hardware according to 'par'. */ - current_par = *par; - current_par_valid = 1; + const struct hitfb_par *par = fb_par; + fb_info.current_par = *par; + fb_info.current_par_valid = 1; } -static int hitfb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue, - u_int *transp, struct fb_info *info) +static int hitfb_getcolreg(unsigned regno, unsigned *red, unsigned *green, + unsigned *blue, unsigned *transp, + struct fb_info *info) { if (regno > 255) return 1; @@ -224,8 +241,9 @@ } -static int hitfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *info) +static int hitfb_setcolreg(unsigned regno, unsigned red, unsigned green, + unsigned blue, unsigned transp, + struct fb_info *info) { if (regno > 255) return 1; @@ -236,10 +254,10 @@ outw(blue>>10, HD64461_CPTWDR); if(regno<16) { - switch(current_par.bpp) { + switch(fb_info.current_par.bpp) { #ifdef FBCON_HAS_CFB16 case 16: - fbcon_cmap.cfb16[regno] = + fb_info.fbcon_cmap.cfb16[regno] = ((red & 0xf800) ) | ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11); @@ -250,17 +268,33 @@ return 0; } + -static int hitfb_blank(int blank_mode, const struct fb_info *info) +static int hitfb_pan_display(const struct fb_var_screeninfo *var, + struct fb_info_gen *info) { + if (!fb_info.current_par_valid) + return -EINVAL; + return 0; } -static void hitfb_set_disp(const void *par, struct display *disp, - struct fb_info_gen *info) +static int hitfb_blank(int blank_mode, struct fb_info_gen *info) { - disp->screen_base = (void *)hit_videobase; + if (!fb_info.current_par_valid) + return 1; + + return 0; +} + + +static void hitfb_set_disp(const void *fb_par, struct display *disp, + struct fb_info_gen *info) +{ + const struct hitfb_par *par = fb_par; + + disp->screen_base = (void *)fb_info.hit_videobase; switch(((struct hitfb_par *)par)->bpp) { #ifdef FBCON_HAS_CFB8 case 8: @@ -270,7 +304,7 @@ #ifdef FBCON_HAS_CFB16 case 16: disp->dispsw = &fbcon_cfb16; - disp->dispsw_data = fbcon_cmap.cfb16; + disp->dispsw_data = fb_info.fbcon_cmap.cfb16; break; #endif default: @@ -288,18 +322,20 @@ hitfb_set_par, hitfb_getcolreg, hitfb_setcolreg, - NULL, + hitfb_pan_display, hitfb_blank, hitfb_set_disp }; + static struct fb_ops hitfb_ops = { - owner: THIS_MODULE, - fb_get_fix: fbgen_get_fix, - fb_get_var: fbgen_get_var, - fb_set_var: fbgen_set_var, - fb_get_cmap: fbgen_get_cmap, - fb_set_cmap: fbgen_set_cmap, + owner: THIS_MODULE, + fb_get_fix: fbgen_get_fix, + fb_get_var: fbgen_get_var, + fb_set_var: fbgen_set_var, + fb_get_cmap: fbgen_get_cmap, + fb_set_cmap: fbgen_set_cmap, + fb_pan_display: fbgen_pan_display, }; @@ -309,7 +345,7 @@ fb_info.gen.info.node = -1; fb_info.gen.info.flags = FBINFO_FLAG_DEFAULT; fb_info.gen.info.fbops = &hitfb_ops; - fb_info.gen.info.disp = &disp; + fb_info.gen.info.disp = &fb_info.disp; fb_info.gen.info.changevar = NULL; fb_info.gen.info.switch_con = &fbgen_switch; fb_info.gen.info.updatevar = &fbgen_update_var; @@ -318,9 +354,9 @@ fb_info.gen.fbhw = &hitfb_switch; fb_info.gen.fbhw->detect(); - fbgen_get_var(&disp.var, -1, &fb_info.gen.info); - disp.var.activate = FB_ACTIVATE_NOW; - fbgen_do_set_var(&disp.var, 1, &fb_info.gen); + fbgen_get_var(&fb_info.disp.var, -1, &fb_info.gen.info); + fb_info.disp.var.activate = FB_ACTIVATE_NOW; + fbgen_do_set_var(&fb_info.disp.var, 1, &fb_info.gen); fbgen_set_disp(-1, &fb_info.gen); fbgen_install_cmap(0, &fb_info.gen); @@ -347,6 +383,13 @@ void cleanup_module(void) { - hitfb_cleanup(void); + hitfb_cleanup(void); } #endif + + +/* + * Local variables: + * c-basic-offset: 4 + * End: + */ Index: kernel/include/asm-sh/hd64461.h diff -u kernel/include/asm-sh/hd64461.h:1.1.1.4 kernel/include/asm-sh/hd64461.h:1.4 --- kernel/include/asm-sh/hd64461.h:1.1.1.4 Tue Aug 1 23:23:17 2000 +++ kernel/include/asm-sh/hd64461.h Mon Sep 4 07:25:33 2000 @@ -11,11 +11,23 @@ #define HD64461_SYSCR 0x10002 #define HD64461_SCPUCR 0x10004 -#define HD64461_CPTWAR 0x11030 -#define HD64461_CPTWDR 0x11032 -#define HD64461_CPTRAR 0x11034 -#define HD64461_CPTRDR 0x11036 +#define HD64461_LCDCBAR 0x11000 +#define HD64461_LCDCLOR 0x11002 +#define HD64461_LCDCCRR 0x11004 +#define HD64461_LDR1 0x11010 +#define HD64461_LDR2 0x11012 +#define HD64461_LDHNCR 0x11014 +#define HD64461_LDHNSR 0x11016 +#define HD64461_LDVNTR 0x11018 +#define HD64461_LDVNDR 0x1101a +#define HD64461_LDVSPR 0x1101c +#define HD64461_LDR3 0x1101e +#define HD64461_CPTWAR 0x11030 +#define HD64461_CPTWDR 0x11032 +#define HD64461_CPTRAR 0x11034 +#define HD64461_CPTRDR 0x11036 + #define HD64461_PCC0ISR 0x12000 #define HD64461_PCC0GCR 0x12002 #define HD64461_PCC0CSCR 0x12004 @@ -29,6 +41,23 @@ #define HD64461_P0OCR 0x1202a #define HD64461_P1OCR 0x1202c #define HD64461_PGCR 0x1202e + +#define HD64461_GPACR 0x14000 +#define HD64461_GPBCR 0x14002 +#define HD64461_GPCCR 0x14004 +#define HD64461_GPDCR 0x14006 +#define HD64461_GPADR 0x14010 +#define HD64461_GPBDR 0x14012 +#define HD64461_GPCDR 0x14014 +#define HD64461_GPDDR 0x14016 +#define HD64461_GPAICR 0x14020 +#define HD64461_GPBICR 0x14022 +#define HD64461_GPCICR 0x14024 +#define HD64461_GPDICR 0x14026 +#define HD64461_GPAISR 0x14040 +#define HD64461_GPBISR 0x14042 +#define HD64461_GPCISR 0x14044 +#define HD64461_GPDISR 0x14046 #define HD64461_NIRR 0x15000 #define HD64461_NIMR 0x15002 Index: kernel/include/asm-sh/ide.h diff -u kernel/include/asm-sh/ide.h:1.1.1.4 kernel/include/asm-sh/ide.h:1.6 --- kernel/include/asm-sh/ide.h:1.1.1.4 Sun Sep 3 01:01:18 2000 +++ kernel/include/asm-sh/ide.h Mon Sep 4 07:25:33 2000 @@ -28,7 +28,7 @@ { switch (base) { case 0x01f0: return 77; - case 0x0170: return 77; + case 0x0170: return 78; default: return 0; } Index: kernel/include/asm-sh/io_hd64461.h diff -u kernel/include/asm-sh/io_hd64461.h:1.1.1.2 kernel/include/asm-sh/io_hd64461.h:1.3 --- kernel/include/asm-sh/io_hd64461.h:1.1.1.2 Tue Sep 26 22:55:16 2000 +++ kernel/include/asm-sh/io_hd64461.h Tue Sep 26 23:06:46 2000 @@ -14,23 +14,23 @@ #include <asm/io_generic.h> -extern unsigned long hd64461_inb(unsigned int port); -extern unsigned long hd64461_inw(unsigned int port); -extern unsigned long hd64461_inl(unsigned int port); +unsigned long hd64461_inb(unsigned int port); +unsigned long hd64461_inw(unsigned int port); +unsigned long hd64461_inl(unsigned int port); -extern void hd64461_outb(unsigned long value, unsigned int port); -extern void hd64461_outw(unsigned long value, unsigned int port); -extern void hd64461_outl(unsigned long value, unsigned int port); +void hd64461_outb(unsigned long value, unsigned int port); +void hd64461_outw(unsigned long value, unsigned int port); +void hd64461_outl(unsigned long value, unsigned int port); -extern unsigned long hd64461_inb_p(unsigned int port); -extern void hd64461_outb_p(unsigned long value, unsigned int port); +unsigned long hd64461_inb_p(unsigned int port); +void hd64461_outb_p(unsigned long value, unsigned int port); -extern void hd64461_insb(unsigned int port, void *addr, unsigned long count); -extern void hd64461_insw(unsigned int port, void *addr, unsigned long count); -extern void hd64461_insl(unsigned int port, void *addr, unsigned long count); -extern void hd64461_outsb(unsigned int port, const void *addr, unsigned long count); -extern void hd64461_outsw(unsigned int port, const void *addr, unsigned long count); -extern void hd64461_outsl(unsigned int port, const void *addr, unsigned long count); +void hd64461_insb(unsigned int port, void *addr, unsigned long count); +void hd64461_insw(unsigned int port, void *addr, unsigned long count); +void hd64461_insl(unsigned int port, void *addr, unsigned long count); +void hd64461_outsb(unsigned int port, const void *addr, unsigned long count); +void hd64461_outsw(unsigned int port, const void *addr, unsigned long count); +void hd64461_outsl(unsigned int port, const void *addr, unsigned long count); #ifdef __WANT_IO_DEF Index: kernel/include/asm-sh/machvec.h diff -u kernel/include/asm-sh/machvec.h:1.1.1.2 kernel/include/asm-sh/machvec.h:1.4.2.2 --- kernel/include/asm-sh/machvec.h:1.1.1.2 Tue Aug 1 23:23:17 2000 +++ kernel/include/asm-sh/machvec.h Sun Sep 17 14:58:36 2000 @@ -65,6 +65,9 @@ unsigned int mv_hw_se : 1; unsigned int mv_hw_hp600 : 1; + unsigned int mv_hw_hp620 : 1; + unsigned int mv_hw_hp680 : 1; + unsigned int mv_hw_hp690 : 1; unsigned int mv_hw_hd64461 : 1; }; @@ -74,6 +77,9 @@ #ifdef CONFIG_SH_GENERIC #define MACH_SE (sh_mv.mv_hw_se) #define MACH_HP600 (sh_mv.mv_hw_hp600) +#define MACH_HP620 (sh_mv.mv_hw_hp620) +#define MACH_HP680 (sh_mv.mv_hw_hp680) +#define MACH_HP690 (sh_mv.mv_hw_hp690) #define MACH_HD64461 (sh_mv.mv_hw_hd64461) #else # ifdef CONFIG_SH_SOLUTION_ENGINE @@ -85,6 +91,21 @@ # define MACH_HP600 1 # else # define MACH_HP600 0 +# endif +# ifdef CONFIG_SH_HP620 +# define MACH_HP620 1 +# else +# define MACH_HP620 0 +# endif +# ifdef CONFIG_SH_HP680 +# define MACH_HP680 1 +# else +# define MACH_HP680 0 +# endif +# ifdef CONFIG_SH_HP690 +# define MACH_HP690 1 +# else +# define MACH_HP690 0 # endif # ifdef CONFIG_HD64461 # define MACH_HD64461 1 |
From: NIIBE Y. <gn...@ch...> - 2000-09-27 05:37:51
|
Because the ABI is different, we have our independent BFD-name for newer Binutils. New BFD names are: elf32-sh-linux <--- for Little endian elf32-shbig-linux <--- for big endian Hence, we will need following change. Checksum.S changes are for new CPP, it's nothing bad with old CPP anyway. We still need more tweaks for new GCC/Binuitsl (say a week or so), so, not commited yet. Just for your reference. Err... well, we need to patch config.guess and such. 2000-09-27 NIIBE Yutaka <gn...@m1...> * arch/sh/lib/checksum.S (SRC, DST): Don't use variable arguments. * arch/sh/vmlinux.lds.S: Use new format name elf32-sh-linux and elf32-shbig-linux. * arch/sh/boot/compressed/Makefile (piggy.o): Likewise. Index: arch/sh/vmlinux.lds.S =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/vmlinux.lds.S,v retrieving revision 1.9 diff -u -p -r1.9 vmlinux.lds.S --- arch/sh/vmlinux.lds.S 2000/08/30 00:52:49 1.9 +++ arch/sh/vmlinux.lds.S 2000/09/27 05:28:00 @@ -4,9 +4,9 @@ */ #include <linux/config.h> #ifdef CONFIG_CPU_LITTLE_ENDIAN -OUTPUT_FORMAT("elf32-shl", "elf32-shl", "elf32-shl") +OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") #else -OUTPUT_FORMAT("elf32-sh", "elf32-sh", "elf32-sh") +OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") #endif OUTPUT_ARCH(sh) ENTRY(_start) Index: arch/sh/boot/compressed/Makefile =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/boot/compressed/Makefile,v retrieving revision 1.5 diff -u -p -r1.5 Makefile --- arch/sh/boot/compressed/Makefile 2000/07/20 15:47:07 1.5 +++ arch/sh/boot/compressed/Makefile 2000/09/27 05:28:00 @@ -36,7 +36,7 @@ piggy.o: $(SYSTEM) $(OBJCOPY) -R .empty_zero_page $(SYSTEM) $$tmppiggy; \ gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \ echo "SECTIONS { .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data) input_data_end = .; }}" > $$tmppiggy.lnk; \ - $(LD) -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-shl -T $$tmppiggy.lnk; \ + $(LD) -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-sh-linux -T $$tmppiggy.lnk; \ rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk clean: Index: arch/sh/lib/checksum.S =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/lib/checksum.S,v retrieving revision 1.6 diff -u -p -r1.6 checksum.S --- arch/sh/lib/checksum.S 2000/07/31 12:27:13 1.6 +++ arch/sh/lib/checksum.S 2000/09/27 05:28:00 @@ -159,14 +159,14 @@ unsigned int csum_partial_copy_generic ( * them all but there's no guarantee. */ -#define SRC(y...) \ - 9999: y; \ +#define SRC(x,y) \ + 9999: x,y; \ .section __ex_table, "a"; \ .long 9999b, 6001f ; \ .previous -#define DST(y...) \ - 9999: y; \ +#define DST(x,y) \ + 9999: x,y; \ .section __ex_table, "a"; \ .long 9999b, 6002f ; \ .previous @@ -276,7 +276,7 @@ DST( mov.l r0,@r5 ) DST( mov.l r1,@r5 ) add #4,r5 -SRC( mov.l @r4+,r0 ) +SRC( mov.l @r4+,r0 ) SRC( mov.l @r4+,r1 ) addc r0,r7 DST( mov.l r0,@r5 ) |