* problems with PLB_TEMAC & xilinx_gige driver under linux 2.4 ...
From: rimas @ 2006-09-19 0:06 UTC (permalink / raw)
To: linuxppc-embedded
Greetings,
i am having problems using the xilinx_gige driver under linux 2.4.26 running
on a Virtex-4 FX12 Mini Module board (from avnet). I am using the plb_temac
and hard_temac blocks under ISE/EDK 8.1.02.
the machine boots fine and the network interface seems to work okay but it
randomly panics sometimes (rather quickly if i'm generating network traffic):
Oops: Exception in kernel mode, sig: 4
NIP: C00DA340 XER: 20000000 LR: C00D34F8 SP: C3945B20 REGS: c3945a70 TRAP:
0700
Not tainted
MSR: 00009030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
TASK = c3944000[52] 'telnetd' Last syscall: 4
last math 00000000 last altivec 00000000
GPR00: 00000004 C3945B20 C3944000 C02E49F4 C02E4800 00000004 00000001 C0456260
GPR08: C0177424 00000031 C50D8000 00021F03 0008C8E4 10122AA8 00000000 C01A0000
GPR16: 00000000 0000001A 00000000 C3945F18 00001032 03945BA0 00000000 C00038E0
GPR24: C0004800 00000020 C04C06E0 C01864E0 C3945BB0 0000001F 00000000 C02E49F4
Call backtrace:
C0190000 C00D34F8 C0004748 C000483C C00038E0 C00D398C C00F8094
C00EE04C C01039B0 C0104D70 C0115570 C01163A8 C010A600 C012A61C
C00E52F4 C00E5574 C003AB2C C000369C 100572BC 10005064 10005108
0FD9221C 00000000
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
<0>Rebooting in 180 seconds..
it always causes a trap on the same instruction (c00da340) which is inside of
XTemac_IntrFifoHandler()
c00da330: 81 6a 00 28 lwz r11,40(r10)
c00da334: 0c 0b 00 00 twi 0,r11,0
c00da338: 4c 00 01 2c isync
c00da33c: 81 2a 00 20 lwz r9,32(r10)
c00da340: 0c 09 00 00 twi 0,r9,0
c00da344: 4c 00 01 2c isync
this code corresponds to two consecutive in_be32() calls
extern inline unsigned in_be32(volatile unsigned *addr)
{
unsigned ret;
__asm__ __volatile__("lwz%U1%X1 %0,%1;\n"
"twi 0,%0,0;\n"
"isync" : "=r" (ret) : "m" (*addr));
return ret;
}
resulting from this line of code:
CorePending = XTemac_mGetIpifReg(XTE_IPIER_OFFSET) &
XTemac_mGetIpifReg(XTE_IPISR_OFFSET);
i recently got a new mini module that has the later stepping of the V4FX12
part (PVR 20011470) so I got rid of the patch i had applied to disable the
caches (which was required on the earlier stepping of the part to get the
board to even boot reliably).
I still have the patch applied which sets bits 1 and 3 in the CCR0 register.
does anyone have any clue as to what's going on and what to do about it ?
this problem seems rather non-deterministic and weird, i can't help but think
its likely related to some silicon errata or something but nothing on this
page
http://www.xilinx.com/xlnx/xil_ans_display.jsp?iCountryID=1&iLanguageID=1&getPagePath=20658&BV_SessionID=@@@@0135296752.1158623889@@@@&BV_EngineID=cccdaddikmdkkifcefeceihdffhdfkf.0
seems to apply
any advice is very greatly appreciated !
-rimas
^ permalink raw reply
* Re: [PATCH 1/6] bootwrapper: arch/powerpc/boot code reorg
From: Mark A. Greer @ 2006-09-19 0:45 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17675.30508.252375.59449@cargo.ozlabs.ibm.com>
On Sat, Sep 16, 2006 at 02:01:48PM +1000, Paul Mackerras wrote:
Hi Paul,
> Mark A. Greer writes:
>
> > Yes. Whether you pass the NULL or not hinges on whether its flat tree
> > or not so I made it a dt_op. What are you thinking?
>
> There's basically only two cases: if we have a builtin flat tree, we
> pass that and NULL in r5; if we don't, and we have OF, we pass NULL in
> r3 and the OF entry point in r5. I think that could be handled in
> main.c.
Okay.
> We also lost the "enforce minimum address only for 64-bit" thing in
> the translation, too.
You mean the "if (claim_base < PROG_START)" if stmt, right?
Would adding an "#if defined(__powerpc64__) && defined(PROG_START)" be
sufficient?
I should change simple_alloc to _ALIGN_UP only 4K while I'm at it.
> I believe that just patch 1/6 on its own won't give us a working
> zImage, so we'll have to split up the changes differently when it
> comes time to check this stuff in to git.
You're right. I'll fix that up.
Mark
^ permalink raw reply
* Re: [PATCH 1/6] bootwrapper: arch/powerpc/boot code reorg
From: Mark A. Greer @ 2006-09-19 0:48 UTC (permalink / raw)
To: Mark A. Greer; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20060919004503.GA920@mag.az.mvista.com>
On Mon, Sep 18, 2006 at 05:45:03PM -0700, Mark A. Greer wrote:
> I should change simple_alloc to _ALIGN_UP only 4K while I'm at it.
Er, nevermind, I'll align to the granularity of the alloc size. Duh...
^ permalink raw reply
* Hang with isync
From: Manoj Sharma @ 2006-09-19 1:28 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 743 bytes --]
Hi,
We use linux kernel 2.4.20 on ppc405 and the system hangs once in a while
when isync gets called in this function:
_GLOBAL(_nmask_and_or_msr)
mfmsr r0 /* Get current msr */
andc r0,r0,r3 /* And off the bits set in r3 (first parm) */
or r0,r0,r4 /* Or on the bits in r4 (second parm) */
sync /* Some chip revs have problems here... */
isync
mtmsr r0 /* Update machine state */
isync
blr /* Done */
2.5 onwards, I find that "sync; isync" has been replaced by a macro SYNC
(defined only for 601). I don't find it in any changelog and reason for the
change.
Can someone give some information on this change?
Appreciate any help.
Manoj
<linuxppc-dev@ozlabs.org>
[-- Attachment #2: Type: text/html, Size: 1235 bytes --]
^ permalink raw reply
* [PATCH] Start arch/powerpc/boot code reorganization
From: Paul Mackerras @ 2006-09-19 3:21 UTC (permalink / raw)
To: Mark A. Greer; +Cc: linuxppc-dev
This is a reworked version of Mark's patches 1/6 and 2/6. This boots
on powermac (newworld) and pseries (power5 partition) at least.
I intend to commit this with Mark as the author and a suitable commit
message, unless there are adverse comments.
Paul.
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index afc776f..e737741 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -36,7 +36,8 @@ zliblinuxheader := zlib.h zconf.h zutil.
$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
#$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h)
-src-boot := crt0.S string.S prom.c stdio.c main.c div64.S
+src-boot-$(CONFIG_PPC_MULTIPLATFORM) := of.c
+src-boot := crt0.S string.S stdio.c main.c div64.S $(src-boot-y)
src-boot += $(zlib)
src-boot := $(addprefix $(obj)/, $(src-boot))
obj-boot := $(addsuffix .o, $(basename $(src-boot)))
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index b66634c..d719bb9 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -14,17 +14,12 @@ #include "elf.h"
#include "page.h"
#include "string.h"
#include "stdio.h"
-#include "prom.h"
#include "zlib.h"
+#include "ops.h"
+#include "flatdevtree.h"
extern void flush_cache(void *, unsigned long);
-
-/* Value picked to match that used by yaboot */
-#define PROG_START 0x01400000 /* only used on 64-bit systems */
-#define RAM_END (512<<20) /* Fixme: use OF */
-#define ONE_MB 0x100000
-
extern char _start[];
extern char __bss_start[];
extern char _end[];
@@ -33,14 +28,6 @@ extern char _vmlinux_end[];
extern char _initrd_start[];
extern char _initrd_end[];
-/* A buffer that may be edited by tools operating on a zImage binary so as to
- * edit the command line passed to vmlinux (by setting /chosen/bootargs).
- * The buffer is put in it's own section so that tools may locate it easier.
- */
-static char builtin_cmdline[512]
- __attribute__((section("__builtin_cmdline")));
-
-
struct addr_range {
unsigned long addr;
unsigned long size;
@@ -51,21 +38,16 @@ static struct addr_range vmlinuz;
static struct addr_range initrd;
static unsigned long elfoffset;
+static int is_64bit;
-static char scratch[46912]; /* scratch space for gunzip, from zlib_inflate_workspacesize() */
+/* scratch space for gunzip; 46912 is from zlib_inflate_workspacesize() */
+static char scratch[46912];
static char elfheader[256];
-
-typedef void (*kernel_entry_t)( unsigned long,
- unsigned long,
- void *,
- void *);
-
+typedef void (*kernel_entry_t)(unsigned long, unsigned long, void *);
#undef DEBUG
-static unsigned long claim_base;
-
#define HEAD_CRC 2
#define EXTRA_FIELD 4
#define ORIG_NAME 8
@@ -123,24 +105,6 @@ static void gunzip(void *dst, int dstlen
zlib_inflateEnd(&s);
}
-static unsigned long try_claim(unsigned long size)
-{
- unsigned long addr = 0;
-
- for(; claim_base < RAM_END; claim_base += ONE_MB) {
-#ifdef DEBUG
- printf(" trying: 0x%08lx\n\r", claim_base);
-#endif
- addr = (unsigned long)claim(claim_base, size, 0);
- if ((void *)addr != (void *)-1)
- break;
- }
- if (addr == 0)
- return 0;
- claim_base = PAGE_ALIGN(claim_base + size);
- return addr;
-}
-
static int is_elf64(void *hdr)
{
Elf64_Ehdr *elf64 = hdr;
@@ -169,16 +133,7 @@ static int is_elf64(void *hdr)
vmlinux.size = (unsigned long)elf64ph->p_filesz + elfoffset;
vmlinux.memsize = (unsigned long)elf64ph->p_memsz + elfoffset;
-#if defined(PROG_START)
- /*
- * Maintain a "magic" minimum address. This keeps some older
- * firmware platforms running.
- */
-
- if (claim_base < PROG_START)
- claim_base = PROG_START;
-#endif
-
+ is_64bit = 1;
return 1;
}
@@ -212,47 +167,9 @@ static int is_elf32(void *hdr)
return 1;
}
-void export_cmdline(void* chosen_handle)
-{
- int len;
- char cmdline[2] = { 0, 0 };
-
- if (builtin_cmdline[0] == 0)
- return;
-
- len = getprop(chosen_handle, "bootargs", cmdline, sizeof(cmdline));
- if (len > 0 && cmdline[0] != 0)
- return;
-
- setprop(chosen_handle, "bootargs", builtin_cmdline,
- strlen(builtin_cmdline) + 1);
-}
-
-
-void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
+static void prep_kernel(unsigned long *a1, unsigned long *a2)
{
int len;
- kernel_entry_t kernel_entry;
-
- memset(__bss_start, 0, _end - __bss_start);
-
- prom = (int (*)(void *)) promptr;
- chosen_handle = finddevice("/chosen");
- if (chosen_handle == (void *) -1)
- exit();
- if (getprop(chosen_handle, "stdout", &stdout, sizeof(stdout)) != 4)
- exit();
-
- printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", _start, sp);
-
- /*
- * The first available claim_base must be above the end of the
- * the loaded kernel wrapper file (_start to _end includes the
- * initrd image if it is present) and rounded up to a nice
- * 1 MB boundary for good measure.
- */
-
- claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB);
vmlinuz.addr = (unsigned long)_vmlinux_start;
vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start);
@@ -263,43 +180,51 @@ void start(unsigned long a1, unsigned lo
gunzip(elfheader, sizeof(elfheader),
(unsigned char *)vmlinuz.addr, &len);
} else
- memcpy(elfheader, (const void *)vmlinuz.addr, sizeof(elfheader));
+ memcpy(elfheader, (const void *)vmlinuz.addr,
+ sizeof(elfheader));
if (!is_elf64(elfheader) && !is_elf32(elfheader)) {
printf("Error: not a valid PPC32 or PPC64 ELF file!\n\r");
exit();
}
+ if (platform_ops.image_hdr)
+ platform_ops.image_hdr(elfheader);
- /* We need to claim the memsize plus the file offset since gzip
+ /* We need to alloc the memsize plus the file offset since gzip
* will expand the header (file offset), then the kernel, then
* possible rubbish we don't care about. But the kernel bss must
* be claimed (it will be zero'd by the kernel itself)
*/
printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize);
- vmlinux.addr = try_claim(vmlinux.memsize);
+ vmlinux.addr = (unsigned long)malloc(vmlinux.memsize);
if (vmlinux.addr == 0) {
printf("Can't allocate memory for kernel image !\n\r");
exit();
}
/*
- * Now we try to claim memory for the initrd (and copy it there)
+ * Now we try to alloc memory for the initrd (and copy it there)
*/
initrd.size = (unsigned long)(_initrd_end - _initrd_start);
initrd.memsize = initrd.size;
if ( initrd.size > 0 ) {
- printf("Allocating 0x%lx bytes for initrd ...\n\r", initrd.size);
- initrd.addr = try_claim(initrd.size);
+ printf("Allocating 0x%lx bytes for initrd ...\n\r",
+ initrd.size);
+ initrd.addr = (unsigned long)malloc((u32)initrd.size);
if (initrd.addr == 0) {
- printf("Can't allocate memory for initial ramdisk !\n\r");
+ printf("Can't allocate memory for initial "
+ "ramdisk !\n\r");
exit();
}
- a1 = initrd.addr;
- a2 = initrd.size;
- printf("initial ramdisk moving 0x%lx <- 0x%lx (0x%lx bytes)\n\r",
- initrd.addr, (unsigned long)_initrd_start, initrd.size);
- memmove((void *)initrd.addr, (void *)_initrd_start, initrd.size);
- printf("initrd head: 0x%lx\n\r", *((unsigned long *)initrd.addr));
+ *a1 = initrd.addr;
+ *a2 = initrd.size;
+ printf("initial ramdisk moving 0x%lx <- 0x%lx "
+ "(0x%lx bytes)\n\r", initrd.addr,
+ (unsigned long)_initrd_start, initrd.size);
+ memmove((void *)initrd.addr, (void *)_initrd_start,
+ initrd.size);
+ printf("initrd head: 0x%lx\n\r",
+ *((unsigned long *)initrd.addr));
}
/* Eventually gunzip the kernel */
@@ -311,11 +236,10 @@ void start(unsigned long a1, unsigned lo
(unsigned char *)vmlinuz.addr, &len);
printf("done 0x%lx bytes\n\r", len);
} else {
- memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size);
+ memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,
+ vmlinuz.size);
}
- export_cmdline(chosen_handle);
-
/* Skip over the ELF header */
#ifdef DEBUG
printf("... skipping 0x%lx bytes of ELF header\n\r",
@@ -324,23 +248,107 @@ #endif
vmlinux.addr += elfoffset;
flush_cache((void *)vmlinux.addr, vmlinux.size);
+}
- kernel_entry = (kernel_entry_t)vmlinux.addr;
-#ifdef DEBUG
- printf( "kernel:\n\r"
- " entry addr = 0x%lx\n\r"
- " a1 = 0x%lx,\n\r"
- " a2 = 0x%lx,\n\r"
- " prom = 0x%lx,\n\r"
- " bi_recs = 0x%lx,\n\r",
- (unsigned long)kernel_entry, a1, a2,
- (unsigned long)prom, NULL);
-#endif
+void __attribute__ ((weak)) ft_init(void *dt_blob)
+{
+}
- kernel_entry(a1, a2, prom, NULL);
+/* A buffer that may be edited by tools operating on a zImage binary so as to
+ * edit the command line passed to vmlinux (by setting /chosen/bootargs).
+ * The buffer is put in it's own section so that tools may locate it easier.
+ */
+static char builtin_cmdline[COMMAND_LINE_SIZE]
+ __attribute__((__section__("__builtin_cmdline")));
- printf("Error: Linux kernel returned to zImage bootloader!\n\r");
+static void get_cmdline(char *buf, int size)
+{
+ void *devp;
+ int len = strlen(builtin_cmdline);
- exit();
+ buf[0] = '\0';
+
+ if (len > 0) { /* builtin_cmdline overrides dt's /chosen/bootargs */
+ len = min(len, size-1);
+ strncpy(buf, builtin_cmdline, len);
+ buf[len] = '\0';
+ }
+ else if ((devp = finddevice("/chosen")))
+ getprop(devp, "bootargs", buf, size);
+}
+
+static void set_cmdline(char *buf)
+{
+ void *devp;
+
+ if ((devp = finddevice("/chosen")))
+ setprop(devp, "bootargs", buf, strlen(buf) + 1);
}
+/* Section where ft can be tacked on after zImage is built */
+union blobspace {
+ struct boot_param_header hdr;
+ char space[8*1024];
+} dt_blob __attribute__((__section__("__builtin_ft")));
+
+struct platform_ops platform_ops;
+struct dt_ops dt_ops;
+struct console_ops console_ops;
+
+void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
+{
+ int have_dt = 0;
+ kernel_entry_t kentry;
+ char cmdline[COMMAND_LINE_SIZE];
+
+ memset(__bss_start, 0, _end - __bss_start);
+ memset(&platform_ops, 0, sizeof(platform_ops));
+ memset(&dt_ops, 0, sizeof(dt_ops));
+ memset(&console_ops, 0, sizeof(console_ops));
+
+ /* Override the dt_ops and device tree if there was an flat dev
+ * tree attached to the zImage.
+ */
+ if (dt_blob.hdr.magic == OF_DT_HEADER) {
+ have_dt = 1;
+ ft_init(&dt_blob);
+ }
+
+ if (platform_init(promptr))
+ exit();
+ if (console_ops.open && (console_ops.open() < 0))
+ exit();
+ if (platform_ops.fixups)
+ platform_ops.fixups();
+
+ printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r",
+ _start, sp);
+
+ prep_kernel(&a1, &a2);
+
+ /* If cmdline came from zimage wrapper or if we can edit the one
+ * in the dt, print it out and edit it, if possible.
+ */
+ if ((strlen(builtin_cmdline) > 0) || console_ops.edit_cmdline) {
+ get_cmdline(cmdline, COMMAND_LINE_SIZE);
+ printf("\n\rLinux/PowerPC load: %s", cmdline);
+ if (console_ops.edit_cmdline)
+ console_ops.edit_cmdline(cmdline, COMMAND_LINE_SIZE);
+ printf("\n\r");
+ set_cmdline(cmdline);
+ }
+
+ if (console_ops.close)
+ console_ops.close();
+
+ kentry = (kernel_entry_t) vmlinux.addr;
+ if (have_dt)
+ kentry(dt_ops.ft_addr(), 0, NULL);
+ else
+ /* XXX initrd addr/size should be passed in properties */
+ kentry(a1, a2, promptr);
+
+ /* console closed so printf below may not work */
+ printf("Error: Linux kernel returned to zImage boot wrapper!\n\r");
+ exit();
+}
diff --git a/arch/powerpc/boot/prom.c b/arch/powerpc/boot/prom.c
deleted file mode 100644
index fa00577..0000000
--- a/arch/powerpc/boot/prom.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) Paul Mackerras 1997.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-#include <stdarg.h>
-#include <stddef.h>
-#include "string.h"
-#include "stdio.h"
-#include "prom.h"
-
-int (*prom)(void *);
-phandle chosen_handle;
-ihandle stdout;
-
-int call_prom(const char *service, int nargs, int nret, ...)
-{
- int i;
- struct prom_args {
- const char *service;
- int nargs;
- int nret;
- unsigned int args[12];
- } args;
- va_list list;
-
- args.service = service;
- args.nargs = nargs;
- args.nret = nret;
-
- va_start(list, nret);
- for (i = 0; i < nargs; i++)
- args.args[i] = va_arg(list, unsigned int);
- va_end(list);
-
- for (i = 0; i < nret; i++)
- args.args[nargs+i] = 0;
-
- if (prom(&args) < 0)
- return -1;
-
- return (nret > 0)? args.args[nargs]: 0;
-}
-
-int call_prom_ret(const char *service, int nargs, int nret,
- unsigned int *rets, ...)
-{
- int i;
- struct prom_args {
- const char *service;
- int nargs;
- int nret;
- unsigned int args[12];
- } args;
- va_list list;
-
- args.service = service;
- args.nargs = nargs;
- args.nret = nret;
-
- va_start(list, rets);
- for (i = 0; i < nargs; i++)
- args.args[i] = va_arg(list, unsigned int);
- va_end(list);
-
- for (i = 0; i < nret; i++)
- args.args[nargs+i] = 0;
-
- if (prom(&args) < 0)
- return -1;
-
- if (rets != (void *) 0)
- for (i = 1; i < nret; ++i)
- rets[i-1] = args.args[nargs+i];
-
- return (nret > 0)? args.args[nargs]: 0;
-}
-
-int write(void *handle, void *ptr, int nb)
-{
- return call_prom("write", 3, 1, handle, ptr, nb);
-}
-
-/*
- * Older OF's require that when claiming a specific range of addresses,
- * we claim the physical space in the /memory node and the virtual
- * space in the chosen mmu node, and then do a map operation to
- * map virtual to physical.
- */
-static int need_map = -1;
-static ihandle chosen_mmu;
-static phandle memory;
-
-/* returns true if s2 is a prefix of s1 */
-static int string_match(const char *s1, const char *s2)
-{
- for (; *s2; ++s2)
- if (*s1++ != *s2)
- return 0;
- return 1;
-}
-
-static int check_of_version(void)
-{
- phandle oprom, chosen;
- char version[64];
-
- oprom = finddevice("/openprom");
- if (oprom == (phandle) -1)
- return 0;
- if (getprop(oprom, "model", version, sizeof(version)) <= 0)
- return 0;
- version[sizeof(version)-1] = 0;
- printf("OF version = '%s'\r\n", version);
- if (!string_match(version, "Open Firmware, 1.")
- && !string_match(version, "FirmWorks,3."))
- return 0;
- chosen = finddevice("/chosen");
- if (chosen == (phandle) -1) {
- chosen = finddevice("/chosen@0");
- if (chosen == (phandle) -1) {
- printf("no chosen\n");
- return 0;
- }
- }
- if (getprop(chosen, "mmu", &chosen_mmu, sizeof(chosen_mmu)) <= 0) {
- printf("no mmu\n");
- return 0;
- }
- memory = (ihandle) call_prom("open", 1, 1, "/memory");
- if (memory == (ihandle) -1) {
- memory = (ihandle) call_prom("open", 1, 1, "/memory@0");
- if (memory == (ihandle) -1) {
- printf("no memory node\n");
- return 0;
- }
- }
- printf("old OF detected\r\n");
- return 1;
-}
-
-void *claim(unsigned long virt, unsigned long size, unsigned long align)
-{
- int ret;
- unsigned int result;
-
- if (need_map < 0)
- need_map = check_of_version();
- if (align || !need_map)
- return (void *) call_prom("claim", 3, 1, virt, size, align);
-
- ret = call_prom_ret("call-method", 5, 2, &result, "claim", memory,
- align, size, virt);
- if (ret != 0 || result == -1)
- return (void *) -1;
- ret = call_prom_ret("call-method", 5, 2, &result, "claim", chosen_mmu,
- align, size, virt);
- /* 0x12 == coherent + read/write */
- ret = call_prom("call-method", 6, 1, "map", chosen_mmu,
- 0x12, size, virt, virt);
- return (void *) virt;
-}
diff --git a/arch/powerpc/boot/prom.h b/arch/powerpc/boot/prom.h
deleted file mode 100644
index a57b184..0000000
--- a/arch/powerpc/boot/prom.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef _PPC_BOOT_PROM_H_
-#define _PPC_BOOT_PROM_H_
-
-typedef void *phandle;
-typedef void *ihandle;
-
-extern int (*prom) (void *);
-extern phandle chosen_handle;
-extern ihandle stdout;
-
-int call_prom(const char *service, int nargs, int nret, ...);
-int call_prom_ret(const char *service, int nargs, int nret,
- unsigned int *rets, ...);
-
-extern int write(void *handle, void *ptr, int nb);
-extern void *claim(unsigned long virt, unsigned long size, unsigned long aln);
-
-static inline void exit(void)
-{
- call_prom("exit", 0, 0);
-}
-
-static inline phandle finddevice(const char *name)
-{
- return (phandle) call_prom("finddevice", 1, 1, name);
-}
-
-static inline int getprop(void *phandle, const char *name,
- void *buf, int buflen)
-{
- return call_prom("getprop", 4, 1, phandle, name, buf, buflen);
-}
-
-
-static inline int setprop(void *phandle, const char *name,
- void *buf, int buflen)
-{
- return call_prom("setprop", 4, 1, phandle, name, buf, buflen);
-}
-
-#endif /* _PPC_BOOT_PROM_H_ */
diff --git a/arch/powerpc/boot/stdio.c b/arch/powerpc/boot/stdio.c
index b5aa522..6d5f638 100644
--- a/arch/powerpc/boot/stdio.c
+++ b/arch/powerpc/boot/stdio.c
@@ -10,7 +10,7 @@ #include <stdarg.h>
#include <stddef.h>
#include "string.h"
#include "stdio.h"
-#include "prom.h"
+#include "ops.h"
size_t strnlen(const char * s, size_t count)
{
@@ -320,6 +320,6 @@ printf(const char *fmt, ...)
va_start(args, fmt);
n = vsprintf(sprint_buf, fmt, args);
va_end(args);
- write(stdout, sprint_buf, n);
+ console_ops.write(sprint_buf, n);
return n;
}
diff --git a/arch/powerpc/boot/stdio.h b/arch/powerpc/boot/stdio.h
index eb9e16c..73b8a91 100644
--- a/arch/powerpc/boot/stdio.h
+++ b/arch/powerpc/boot/stdio.h
@@ -1,8 +1,16 @@
#ifndef _PPC_BOOT_STDIO_H_
#define _PPC_BOOT_STDIO_H_
+#include <stdarg.h>
+
+#define ENOMEM 12 /* Out of Memory */
+#define EINVAL 22 /* Invalid argument */
+#define ENOSPC 28 /* No space left on device */
+
extern int printf(const char *fmt, ...);
+#define fprintf(fmt, args...) printf(args)
+
extern int sprintf(char *buf, const char *fmt, ...);
extern int vsprintf(char *buf, const char *fmt, va_list args);
--- /dev/null 2006-09-18 11:33:23.687982711 +1000
+++ arch/powerpc/boot/flatdevtree.h 2006-09-19 11:46:47.000000000 +1000
@@ -0,0 +1,46 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FLATDEVTREE_H
+#define FLATDEVTREE_H
+
+#include "types.h"
+
+/* Definitions used by the flattened device tree */
+#define OF_DT_HEADER 0xd00dfeed /* marker */
+#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
+#define OF_DT_END_NODE 0x2 /* End node */
+#define OF_DT_PROP 0x3 /* Property: name off, size, content */
+#define OF_DT_NOP 0x4 /* nop */
+#define OF_DT_END 0x9
+
+#define OF_DT_VERSION 0x10
+
+struct boot_param_header {
+ u32 magic; /* magic word OF_DT_HEADER */
+ u32 totalsize; /* total size of DT block */
+ u32 off_dt_struct; /* offset to structure */
+ u32 off_dt_strings; /* offset to strings */
+ u32 off_mem_rsvmap; /* offset to memory reserve map */
+ u32 version; /* format version */
+ u32 last_comp_version; /* last compatible version */
+ /* version 2 fields below */
+ u32 boot_cpuid_phys; /* Physical CPU id we're booting on */
+ /* version 3 fields below */
+ u32 dt_strings_size; /* size of the DT strings block */
+};
+
+#endif /* FLATDEVTREE_H */
--- /dev/null 2006-09-18 11:33:23.687982711 +1000
+++ arch/powerpc/boot/of.c 2006-09-18 17:35:59.000000000 +1000
@@ -0,0 +1,283 @@
+/*
+ * Copyright (C) Paul Mackerras 1997.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <stdarg.h>
+#include <stddef.h>
+#include "types.h"
+#include "elf.h"
+#include "string.h"
+#include "stdio.h"
+#include "page.h"
+#include "ops.h"
+
+typedef void *ihandle;
+typedef void *phandle;
+
+extern char _end[];
+
+/* Value picked to match that used by yaboot */
+#define PROG_START 0x01400000 /* only used on 64-bit systems */
+#define RAM_END (512<<20) /* Fixme: use OF */
+#define ONE_MB 0x100000
+
+int (*prom) (void *);
+
+
+static unsigned long claim_base;
+
+static int call_prom(const char *service, int nargs, int nret, ...)
+{
+ int i;
+ struct prom_args {
+ const char *service;
+ int nargs;
+ int nret;
+ unsigned int args[12];
+ } args;
+ va_list list;
+
+ args.service = service;
+ args.nargs = nargs;
+ args.nret = nret;
+
+ va_start(list, nret);
+ for (i = 0; i < nargs; i++)
+ args.args[i] = va_arg(list, unsigned int);
+ va_end(list);
+
+ for (i = 0; i < nret; i++)
+ args.args[nargs+i] = 0;
+
+ if (prom(&args) < 0)
+ return -1;
+
+ return (nret > 0)? args.args[nargs]: 0;
+}
+
+static int call_prom_ret(const char *service, int nargs, int nret,
+ unsigned int *rets, ...)
+{
+ int i;
+ struct prom_args {
+ const char *service;
+ int nargs;
+ int nret;
+ unsigned int args[12];
+ } args;
+ va_list list;
+
+ args.service = service;
+ args.nargs = nargs;
+ args.nret = nret;
+
+ va_start(list, rets);
+ for (i = 0; i < nargs; i++)
+ args.args[i] = va_arg(list, unsigned int);
+ va_end(list);
+
+ for (i = 0; i < nret; i++)
+ args.args[nargs+i] = 0;
+
+ if (prom(&args) < 0)
+ return -1;
+
+ if (rets != (void *) 0)
+ for (i = 1; i < nret; ++i)
+ rets[i-1] = args.args[nargs+i];
+
+ return (nret > 0)? args.args[nargs]: 0;
+}
+
+/*
+ * Older OF's require that when claiming a specific range of addresses,
+ * we claim the physical space in the /memory node and the virtual
+ * space in the chosen mmu node, and then do a map operation to
+ * map virtual to physical.
+ */
+static int need_map = -1;
+static ihandle chosen_mmu;
+static phandle memory;
+
+/* returns true if s2 is a prefix of s1 */
+static int string_match(const char *s1, const char *s2)
+{
+ for (; *s2; ++s2)
+ if (*s1++ != *s2)
+ return 0;
+ return 1;
+}
+
+static int check_of_version(void)
+{
+ phandle oprom, chosen;
+ char version[64];
+
+ oprom = finddevice("/openprom");
+ if (oprom == (phandle) -1)
+ return 0;
+ if (getprop(oprom, "model", version, sizeof(version)) <= 0)
+ return 0;
+ version[sizeof(version)-1] = 0;
+ printf("OF version = '%s'\r\n", version);
+ if (!string_match(version, "Open Firmware, 1.")
+ && !string_match(version, "FirmWorks,3."))
+ return 0;
+ chosen = finddevice("/chosen");
+ if (chosen == (phandle) -1) {
+ chosen = finddevice("/chosen@0");
+ if (chosen == (phandle) -1) {
+ printf("no chosen\n");
+ return 0;
+ }
+ }
+ if (getprop(chosen, "mmu", &chosen_mmu, sizeof(chosen_mmu)) <= 0) {
+ printf("no mmu\n");
+ return 0;
+ }
+ memory = (ihandle) call_prom("open", 1, 1, "/memory");
+ if (memory == (ihandle) -1) {
+ memory = (ihandle) call_prom("open", 1, 1, "/memory@0");
+ if (memory == (ihandle) -1) {
+ printf("no memory node\n");
+ return 0;
+ }
+ }
+ printf("old OF detected\r\n");
+ return 1;
+}
+
+static void *claim(unsigned long virt, unsigned long size, unsigned long align)
+{
+ int ret;
+ unsigned int result;
+
+ if (need_map < 0)
+ need_map = check_of_version();
+ if (align || !need_map)
+ return (void *) call_prom("claim", 3, 1, virt, size, align);
+
+ ret = call_prom_ret("call-method", 5, 2, &result, "claim", memory,
+ align, size, virt);
+ if (ret != 0 || result == -1)
+ return (void *) -1;
+ ret = call_prom_ret("call-method", 5, 2, &result, "claim", chosen_mmu,
+ align, size, virt);
+ /* 0x12 == coherent + read/write */
+ ret = call_prom("call-method", 6, 1, "map", chosen_mmu,
+ 0x12, size, virt, virt);
+ return (void *) virt;
+}
+
+static void *of_try_claim(u32 size)
+{
+ unsigned long addr = 0;
+ static u8 first_time = 1;
+
+ if (first_time) {
+ claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB);
+ first_time = 0;
+ }
+
+ for(; claim_base < RAM_END; claim_base += ONE_MB) {
+#ifdef DEBUG
+ printf(" trying: 0x%08lx\n\r", claim_base);
+#endif
+ addr = (unsigned long)claim(claim_base, size, 0);
+ if ((void *)addr != (void *)-1)
+ break;
+ }
+ if (addr == 0)
+ return NULL;
+ claim_base = PAGE_ALIGN(claim_base + size);
+ return (void *)addr;
+}
+
+static void of_image_hdr(const void *hdr)
+{
+ const Elf64_Ehdr *elf64 = hdr;
+
+ if (elf64->e_ident[EI_CLASS] == ELFCLASS64) {
+ /*
+ * Maintain a "magic" minimum address. This keeps some older
+ * firmware platforms running.
+ */
+ if (claim_base < PROG_START)
+ claim_base = PROG_START;
+ }
+}
+
+static void of_exit(void)
+{
+ call_prom("exit", 0, 0);
+}
+
+/*
+ * OF device tree routines
+ */
+static void *of_finddevice(const char *name)
+{
+ return (phandle) call_prom("finddevice", 1, 1, name);
+}
+
+static int of_getprop(const void *phandle, const char *name, void *buf,
+ const int buflen)
+{
+ return call_prom("getprop", 4, 1, phandle, name, buf, buflen);
+}
+
+static int of_setprop(const void *phandle, const char *name, const void *buf,
+ const int buflen)
+{
+ return call_prom("setprop", 4, 1, phandle, name, buf, buflen);
+}
+
+/*
+ * OF console routines
+ */
+static void *of_stdout_handle;
+
+static int of_console_open(void)
+{
+ void *devp;
+
+ if (((devp = finddevice("/chosen")) != NULL)
+ && (getprop(devp, "stdout", &of_stdout_handle,
+ sizeof(of_stdout_handle))
+ == sizeof(of_stdout_handle)))
+ return 0;
+
+ return -1;
+}
+
+static void of_console_write(char *buf, int len)
+{
+ call_prom("write", 3, 1, of_stdout_handle, buf, len);
+}
+
+int platform_init(void *promptr)
+{
+ platform_ops.fixups = NULL;
+ platform_ops.image_hdr = of_image_hdr;
+ platform_ops.malloc = of_try_claim;
+ platform_ops.free = NULL;
+ platform_ops.exit = of_exit;
+
+ dt_ops.finddevice = of_finddevice;
+ dt_ops.getprop = of_getprop;
+ dt_ops.setprop = of_setprop;
+ dt_ops.translate_addr = NULL;
+
+ console_ops.open = of_console_open;
+ console_ops.write = of_console_write;
+ console_ops.edit_cmdline = NULL;
+ console_ops.close = NULL;
+ console_ops.data = NULL;
+
+ prom = (int (*)(void *))promptr;
+ return 0;
+}
--- /dev/null 2006-09-18 11:33:23.687982711 +1000
+++ arch/powerpc/boot/types.h 2006-09-18 13:48:20.000000000 +1000
@@ -0,0 +1,23 @@
+#ifndef _TYPES_H_
+#define _TYPES_H_
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int u32;
+typedef unsigned long long u64;
+
+#define min(x,y) ({ \
+ typeof(x) _x = (x); \
+ typeof(y) _y = (y); \
+ (void) (&_x == &_y); \
+ _x < _y ? _x : _y; })
+
+#define max(x,y) ({ \
+ typeof(x) _x = (x); \
+ typeof(y) _y = (y); \
+ (void) (&_x == &_y); \
+ _x > _y ? _x : _y; })
+
+#endif /* _TYPES_H_ */
^ permalink raw reply related
* [PATCH] Define of_read_ulong helper
From: Paul Mackerras @ 2006-09-19 4:00 UTC (permalink / raw)
To: linuxppc-dev
There are various places where we want to extract an unsigned long
value from a device-tree property that can be 1 or 2 cells in length.
This replaces some open-coded calculations, and one place where we
assumed without checking that properties were the length we wanted,
with a little of_read_ulong() helper.
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index bf2005b..eb913f8 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -757,24 +757,9 @@ static int __init early_init_dt_scan_roo
static unsigned long __init dt_mem_next_cell(int s, cell_t **cellp)
{
cell_t *p = *cellp;
- unsigned long r;
- /* Ignore more than 2 cells */
- while (s > sizeof(unsigned long) / 4) {
- p++;
- s--;
- }
- r = *p++;
-#ifdef CONFIG_PPC64
- if (s > 1) {
- r <<= 32;
- r |= *(p++);
- s--;
- }
-#endif
-
- *cellp = p;
- return r;
+ *cellp = p + s;
+ return of_read_ulong(p, s);
}
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 465e743..0af3fc1 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -304,18 +304,21 @@ struct seq_operations cpuinfo_op = {
void __init check_for_initrd(void)
{
#ifdef CONFIG_BLK_DEV_INITRD
- const unsigned long *prop;
+ const unsigned int *prop;
+ int len;
DBG(" -> check_for_initrd()\n");
if (of_chosen) {
- prop = get_property(of_chosen, "linux,initrd-start", NULL);
+ prop = get_property(of_chosen, "linux,initrd-start", &len);
if (prop != NULL) {
- initrd_start = (unsigned long)__va(*prop);
+ initrd_start = (unsigned long)
+ __va(of_read_ulong(prop, len / 4));
prop = get_property(of_chosen,
- "linux,initrd-end", NULL);
+ "linux,initrd-end", &len);
if (prop != NULL) {
- initrd_end = (unsigned long)__va(*prop);
+ initrd_end = (unsigned long)
+ __va(of_read_ulong(prop, len / 4));
initrd_below_start_ok = 1;
} else
initrd_start = 0;
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index b9a2061..7a3c3f7 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -870,9 +870,7 @@ static int __init get_freq(char *name, i
fp = get_property(cpu, name, NULL);
if (fp) {
found = 1;
- *val = 0;
- while (cells--)
- *val = (*val << 32) | *fp++;
+ *val = of_read_ulong(fp, cells);
}
of_node_put(cpu);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index c15e66a..5246297 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -197,7 +197,7 @@ extern int release_OF_resource(struct de
*/
-/* Helper to read a big number */
+/* Helper to read a big number; size is in cells (not bytes) */
static inline u64 of_read_number(const u32 *cell, int size)
{
u64 r = 0;
@@ -206,6 +206,16 @@ static inline u64 of_read_number(const u
return r;
}
+/* Like of_read_number, but we want an unsigned long result */
+#ifdef CONFIG_PPC32
+static inline unsigned long of_read_ulong(const u32 *cell, int size)
+{
+ return cell[size-1];
+}
+#else
+#define of_read_ulong(cell, size) of_read_number(cell, size)
+#endif
+
/* Translate an OF address block into a CPU physical address
*/
#define OF_BAD_ADDR ((u64)-1)
^ permalink raw reply related
* Re: [PATCH] Start arch/powerpc/boot code reorganization
From: Michael Ellerman @ 2006-09-19 4:22 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17679.25131.721027.405431@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]
On Tue, 2006-09-19 at 13:21 +1000, Paul Mackerras wrote:
> This is a reworked version of Mark's patches 1/6 and 2/6. This boots
> on powermac (newworld) and pseries (power5 partition) at least.
>
> --- /dev/null 2006-09-18 11:33:23.687982711 +1000
> +++ arch/powerpc/boot/of.c 2006-09-18 17:35:59.000000000 +1000
> @@ -0,0 +1,283 @@
> +/*
> + * Copyright (C) Paul Mackerras 1997.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + */
> +#include <stdarg.h>
> +#include <stddef.h>
> +#include "types.h"
> +#include "elf.h"
> +#include "string.h"
> +#include "stdio.h"
> +#include "page.h"
> +#include "ops.h"
Where do I get ops.h?
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply
* Re: [PATCH] Start arch/powerpc/boot code reorganization
From: Paul Mackerras @ 2006-09-19 4:29 UTC (permalink / raw)
To: michael; +Cc: linuxppc-dev
In-Reply-To: <1158639740.32015.114.camel@localhost.localdomain>
Michael Ellerman writes:
> Where do I get ops.h?
Oops... here it is.
Paul.
diff --git /dev/null b/arch/powerpc/boot/ops.h
--- /dev/null 2006-09-18 11:33:23.687982711 +1000
+++ b/arch/powerpc/boot/ops.h 2006-09-19 14:09:38.000000000 +1000
@@ -0,0 +1,100 @@
+/*
+ * Global definition of all the bootwrapper operations.
+ *
+ * Author: Mark A. Greer <mgreer@mvista.com>
+ *
+ * 2006 (c) MontaVista Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+#ifndef _PPC_BOOT_OPS_H_
+#define _PPC_BOOT_OPS_H_
+
+#include "types.h"
+
+#define COMMAND_LINE_SIZE 512
+#define MAX_PATH_LEN 256
+#define MAX_PROP_LEN 256 /* What should this be? */
+
+/* Platform specific operations */
+struct platform_ops {
+ void (*fixups)(void);
+ void * (*malloc)(u32 size);
+ void (*free)(void *ptr, u32 size);
+ void (*exit)(void);
+};
+extern struct platform_ops platform_ops;
+
+/* Device Tree operations */
+struct dt_ops {
+ void * (*finddevice)(const char *name);
+ int (*getprop)(const void *node, const char *name, void *buf,
+ const int buflen);
+ int (*setprop)(const void *node, const char *name,
+ const void *buf, const int buflen);
+ u64 (*translate_addr)(const char *path, const u32 *in_addr,
+ const u32 addr_len);
+ void (*call_kernel)(void *entry_addr, unsigned long a1,
+ unsigned long a2, void *promptr, void *sp);
+};
+extern struct dt_ops dt_ops;
+
+/* Console operations */
+struct console_ops {
+ int (*open)(void);
+ void (*write)(char *buf, int len);
+ void (*edit_cmdline)(char *buf, int len);
+ void (*close)(void);
+ void *data;
+};
+extern struct console_ops console_ops;
+
+/* Serial console operations */
+struct serial_console_data {
+ int (*open)(void);
+ void (*putc)(unsigned char c);
+ unsigned char (*getc)(void);
+ u8 (*tstc)(void);
+ void (*close)(void);
+};
+
+extern int platform_init(void *promptr);
+extern void simple_alloc_init(void);
+extern void ft_init(void *dt_blob);
+extern int serial_console_init(void);
+
+static inline void *finddevice(const char *name)
+{
+ return (dt_ops.finddevice) ? dt_ops.finddevice(name) : NULL;
+}
+
+static inline int getprop(void *devp, const char *name, void *buf, int buflen)
+{
+ return (dt_ops.getprop) ? dt_ops.getprop(devp, name, buf, buflen) : -1;
+}
+
+static inline int setprop(void *devp, const char *name, void *buf, int buflen)
+{
+ return (dt_ops.setprop) ? dt_ops.setprop(devp, name, buf, buflen) : -1;
+}
+
+static inline void *malloc(u32 size)
+{
+ return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL;
+}
+
+static inline void free(void *ptr, u32 size)
+{
+ if (platform_ops.free)
+ platform_ops.free(ptr, size);
+}
+
+static inline void exit(void)
+{
+ if (platform_ops.exit)
+ platform_ops.exit();
+ for(;;);
+}
+
+#endif /* _PPC_BOOT_OPS_H_ */
^ permalink raw reply
* events/0 issue
From: jack zhao @ 2006-09-19 3:48 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
I encounter one problem when using PPC8347 system. I am using
gigafar driver in linux kernel 2.6.13.4 version, but when I make the driver
working, I start the samba function, and copy copy file from Windows PC to
PPC system, when copy action starts, the events/0 occupy 40% CPU usage,
while I using another system it is also linux 2.6.13, when copying file to
system, events only occupy 1%, most of CPU loading are in network. Could
some one tell me where is the optimization for that? Thanks.
Best Wishes
Jack Zhao
USI SH R&D Center 86-021-58966996-1122
^ permalink raw reply
* Fw: [PATCH] Remove powerpc specific parts of 3c509 driver
From: Stephen Rothwell @ 2006-09-19 4:54 UTC (permalink / raw)
To: ppc-dev
This patch has been sent to netdev and is needed to build 3c509 after my following patch (that removes some io accessor functions).
Begin forwarded message:
Date: Tue, 19 Sep 2006 11:54:49 +1000
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: netdev@vger.kernel.org
Cc: akpm@osdl.org, jgarzik@pobox.com
Subject: [PATCH] Remove powerpc specific parts of 3c509 driver
On powerpc and ppc, insl_ns and insl are identical as are outsl_ns and
outsl, so remove the conditional use of insl_ns and outsl_ns.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/net/3c509.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
This is in anticipation of removing the insl_ns and outsl_ns definitions
which are powerpc sepcific patches.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index cbdae54..add6381 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -879,11 +879,7 @@ #endif
outw(skb->len, ioaddr + TX_FIFO);
outw(0x00, ioaddr + TX_FIFO);
/* ... and the packet rounded to a doubleword. */
-#ifdef __powerpc__
- outsl_ns(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2);
-#else
outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2);
-#endif
dev->trans_start = jiffies;
if (inw(ioaddr + TX_FREE) > 1536)
@@ -1103,13 +1099,8 @@ el3_rx(struct net_device *dev)
skb_reserve(skb, 2); /* Align IP on 16 byte */
/* 'skb->data' points to the start of sk_buff data area. */
-#ifdef __powerpc__
- insl_ns(ioaddr+RX_FIFO, skb_put(skb,pkt_len),
- (pkt_len + 3) >> 2);
-#else
insl(ioaddr + RX_FIFO, skb_put(skb,pkt_len),
(pkt_len + 3) >> 2);
-#endif
outw(RxDiscard, ioaddr + EL3_CMD); /* Pop top Rx packet. */
skb->protocol = eth_type_trans(skb,dev);
--
1.4.2.1
^ permalink raw reply related
* [POWERPC] remove unused io accessors
From: Stephen Rothwell @ 2006-09-19 4:56 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
The io accessors insw_ns, outsw_ns, insl_ns and outsl_ns are unused
(except for one unnecessary use in drivers/net/3c509.c that is addressed
in a previous patch) and are only defined in powerpc/ppc, so remove them.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/ppc/syslib/m8260_pci_erratum9.c | 16 ----------------
include/asm-powerpc/io.h | 13 +------------
include/asm-ppc/io.h | 10 ----------
include/asm-ppc/mpc8260_pci9.h | 4 ----
4 files changed, 1 insertions(+), 42 deletions(-)
The 3c509 driver will not build after this patch without the patch I have
posted previously to netdev.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/ppc/syslib/m8260_pci_erratum9.c b/arch/ppc/syslib/m8260_pci_erratum9.c
index 974581e..5475709 100644
--- a/arch/ppc/syslib/m8260_pci_erratum9.c
+++ b/arch/ppc/syslib/m8260_pci_erratum9.c
@@ -339,20 +339,6 @@ void insl(unsigned port, void *buf, int
idma_pci9_read((u8 *)buf, (u8 *)addr, nl*sizeof(u32), sizeof(u32), 0);
}
-void insw_ns(unsigned port, void *buf, int ns)
-{
- u8 *addr = (u8 *)(port + _IO_BASE);
-
- idma_pci9_read((u8 *)buf, (u8 *)addr, ns*sizeof(u16), sizeof(u16), 0);
-}
-
-void insl_ns(unsigned port, void *buf, int nl)
-{
- u8 *addr = (u8 *)(port + _IO_BASE);
-
- idma_pci9_read((u8 *)buf, (u8 *)addr, nl*sizeof(u32), sizeof(u32), 0);
-}
-
void *memcpy_fromio(void *dest, unsigned long src, size_t count)
{
unsigned long pa = iopa((unsigned long) src);
@@ -373,8 +359,6 @@ EXPORT_SYMBOL(inl);
EXPORT_SYMBOL(insb);
EXPORT_SYMBOL(insw);
EXPORT_SYMBOL(insl);
-EXPORT_SYMBOL(insw_ns);
-EXPORT_SYMBOL(insl_ns);
EXPORT_SYMBOL(memcpy_fromio);
#endif /* ifdef CONFIG_8260_PCI9 */
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 212428d..9aaced5 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -76,8 +76,7 @@ #define outl(data,addr) writel(data,((v
#define insb(port, buf, ns) _insb((u8 __iomem *)((port)+pci_io_base), (buf), (ns))
#define insw(port, buf, ns) _insw_ns((u8 __iomem *)((port)+pci_io_base), (buf), (ns))
#define insl(port, buf, nl) _insl_ns((u8 __iomem *)((port)+pci_io_base), (buf), (nl))
-#define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
-#define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
+
#else
static inline unsigned char __raw_readb(const volatile void __iomem *addr)
@@ -138,8 +137,6 @@ #define outl(val, port) eeh_outl(val, (
#define insb(port, buf, ns) eeh_insb((port), (buf), (ns))
#define insw(port, buf, ns) eeh_insw_ns((port), (buf), (ns))
#define insl(port, buf, nl) eeh_insl_ns((port), (buf), (nl))
-#define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns))
-#define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl))
#endif
@@ -180,14 +177,6 @@ #define outw_p(val, port) (udelay(
#define inl_p(port) inl(port)
#define outl_p(val, port) (udelay(1), outl((val), (port)))
-/*
- * The *_ns versions below don't do byte-swapping.
- * Neither do the standard versions now, these are just here
- * for older code.
- */
-#define outsw_ns(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
-#define outsl_ns(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
-
#define IO_SPACE_LIMIT ~(0UL)
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 680555b..fb0a8fc 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -338,16 +338,6 @@ extern void _outsw_ns(volatile u16 __iom
extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl);
extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl);
-/*
- * The *_ns versions below don't do byte-swapping.
- * Neither do the standard versions now, these are just here
- * for older code.
- */
-#define insw_ns(port, buf, ns) _insw_ns((port)+___IO_BASE, (buf), (ns))
-#define outsw_ns(port, buf, ns) _outsw_ns((port)+___IO_BASE, (buf), (ns))
-#define insl_ns(port, buf, nl) _insl_ns((port)+___IO_BASE, (buf), (nl))
-#define outsl_ns(port, buf, nl) _outsl_ns((port)+___IO_BASE, (buf), (nl))
-
#define IO_SPACE_LIMIT ~0
diff --git a/include/asm-ppc/mpc8260_pci9.h b/include/asm-ppc/mpc8260_pci9.h
index 26b3f6e..9f71768 100644
--- a/include/asm-ppc/mpc8260_pci9.h
+++ b/include/asm-ppc/mpc8260_pci9.h
@@ -30,8 +30,6 @@ #undef insl
#undef inb
#undef inw
#undef inl
-#undef insw_ns
-#undef insl_ns
#undef memcpy_fromio
extern int readb(volatile unsigned char *addr);
@@ -43,8 +41,6 @@ extern void insl(unsigned port, void *bu
extern int inb(unsigned port);
extern int inw(unsigned port);
extern unsigned inl(unsigned port);
-extern void insw_ns(unsigned port, void *buf, int ns);
-extern void insl_ns(unsigned port, void *buf, int nl);
extern void *memcpy_fromio(void *dest, unsigned long src, size_t count);
#endif /* !__CONFIG_8260_PCI9_DEFS */
--
1.4.2.1
^ permalink raw reply related
* Re: problems with PLB_TEMAC & xilinx_gige driver under linux 2.4 ...
From: David H. Lynch Jr. @ 2006-09-19 5:30 UTC (permalink / raw)
To: rimas; +Cc: linuxppc-embedded
In-Reply-To: <web-1997652@cnmat.berkeley.edu>
I do nto know much about Xilinx under 2.4 but I am pretty sure the
gemac and the plb temac are similar but different
NIC's.
rimas wrote:
> Greetings,
>
> i am having problems using the xilinx_gige driver under linux 2.4.26 running
> on a Virtex-4 FX12 Mini Module board (from avnet). I am using the plb_temac
> and hard_temac blocks under ISE/EDK 8.1.02.
>
> the machine boots fine and the network interface seems to work okay but it
> randomly panics sometimes (rather quickly if i'm generating network traffic):
>
> Oops: Exception in kernel mode, sig: 4
> NIP: C00DA340 XER: 20000000 LR: C00D34F8 SP: C3945B20 REGS: c3945a70 TRAP:
> 0700
> Not tainted
> MSR: 00009030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
> TASK = c3944000[52] 'telnetd' Last syscall: 4
> last math 00000000 last altivec 00000000
> GPR00: 00000004 C3945B20 C3944000 C02E49F4 C02E4800 00000004 00000001 C0456260
> GPR08: C0177424 00000031 C50D8000 00021F03 0008C8E4 10122AA8 00000000 C01A0000
> GPR16: 00000000 0000001A 00000000 C3945F18 00001032 03945BA0 00000000 C00038E0
> GPR24: C0004800 00000020 C04C06E0 C01864E0 C3945BB0 0000001F 00000000 C02E49F4
> Call backtrace:
> C0190000 C00D34F8 C0004748 C000483C C00038E0 C00D398C C00F8094
> C00EE04C C01039B0 C0104D70 C0115570 C01163A8 C010A600 C012A61C
> C00E52F4 C00E5574 C003AB2C C000369C 100572BC 10005064 10005108
> 0FD9221C 00000000
> Kernel panic: Aiee, killing interrupt handler!
> In interrupt handler - not syncing
> <0>Rebooting in 180 seconds..
>
> it always causes a trap on the same instruction (c00da340) which is inside of
> XTemac_IntrFifoHandler()
>
> c00da330: 81 6a 00 28 lwz r11,40(r10)
> c00da334: 0c 0b 00 00 twi 0,r11,0
> c00da338: 4c 00 01 2c isync
> c00da33c: 81 2a 00 20 lwz r9,32(r10)
> c00da340: 0c 09 00 00 twi 0,r9,0
> c00da344: 4c 00 01 2c isync
>
> this code corresponds to two consecutive in_be32() calls
>
> extern inline unsigned in_be32(volatile unsigned *addr)
> {
> unsigned ret;
>
> __asm__ __volatile__("lwz%U1%X1 %0,%1;\n"
> "twi 0,%0,0;\n"
> "isync" : "=r" (ret) : "m" (*addr));
> return ret;
> }
>
> resulting from this line of code:
>
> CorePending = XTemac_mGetIpifReg(XTE_IPIER_OFFSET) &
> XTemac_mGetIpifReg(XTE_IPISR_OFFSET);
>
> i recently got a new mini module that has the later stepping of the V4FX12
> part (PVR 20011470) so I got rid of the patch i had applied to disable the
> caches (which was required on the earlier stepping of the part to get the
> board to even boot reliably).
>
> I still have the patch applied which sets bits 1 and 3 in the CCR0 register.
>
> does anyone have any clue as to what's going on and what to do about it ?
>
> this problem seems rather non-deterministic and weird, i can't help but think
> its likely related to some silicon errata or something but nothing on this
> page
>
> http://www.xilinx.com/xlnx/xil_ans_display.jsp?iCountryID=1&iLanguageID=1&getPagePath=20658&BV_SessionID=@@@@0135296752.1158623889@@@@&BV_EngineID=cccdaddikmdkkifcefeceihdffhdfkf.0
>
> seems to apply
>
> any advice is very greatly appreciated !
>
> -rimas
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
--
Dave Lynch DLA Systems
Software Development: Embedded Linux
717.627.3770 dhlii@dlasys.net http://www.dlasys.net
fax: 1.253.369.9244 Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.
"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein
^ permalink raw reply
* [POWERPC] remove unused asm routines
From: Stephen Rothwell @ 2006-09-19 6:57 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
_insw, _outsw, _insl amd _outsl are all unused, so remove them.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/misc.S | 52 ------------------------
arch/powerpc/kernel/ppc_ksyms.c | 4 --
arch/ppc/kernel/misc.S | 84 ---------------------------------------
arch/ppc/kernel/ppc_ksyms.c | 4 --
include/asm-powerpc/io.h | 4 --
include/asm-ppc/io.h | 4 --
6 files changed, 0 insertions(+), 152 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index f770805..dd5f8e4 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -86,58 +86,6 @@ _GLOBAL(_outsb)
sync
blr
-_GLOBAL(_insw)
- sync
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,2
- blelr-
-00: lhbrx r5,0,r3
- eieio
- sthu r5,2(r4)
- bdnz 00b
- twi 0,r5,0
- isync
- blr
-
-_GLOBAL(_outsw)
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,2
- blelr-
- sync
-00: lhzu r5,2(r4)
- sthbrx r5,0,r3
- bdnz 00b
- sync
- blr
-
-_GLOBAL(_insl)
- sync
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,4
- blelr-
-00: lwbrx r5,0,r3
- eieio
- stwu r5,4(r4)
- bdnz 00b
- twi 0,r5,0
- isync
- blr
-
-_GLOBAL(_outsl)
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,4
- blelr-
- sync
-00: lwzu r5,4(r4)
- stwbrx r5,0,r3
- bdnz 00b
- sync
- blr
-
#ifdef CONFIG_PPC32
_GLOBAL(__ide_mm_insw)
#endif
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index b2edac8..314d611 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -104,10 +104,6 @@ #endif
EXPORT_SYMBOL(_insb);
EXPORT_SYMBOL(_outsb);
-EXPORT_SYMBOL(_insw);
-EXPORT_SYMBOL(_outsw);
-EXPORT_SYMBOL(_insl);
-EXPORT_SYMBOL(_outsl);
EXPORT_SYMBOL(_insw_ns);
EXPORT_SYMBOL(_outsw_ns);
EXPORT_SYMBOL(_insl_ns);
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 2fa0075..44700bb 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -768,90 +768,6 @@ _GLOBAL(_outsb)
bdnz 00b
blr
-_GLOBAL(_insw)
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,2
- blelr-
-00: lhbrx r5,0,r3
-01: eieio
-02: sthu r5,2(r4)
- ISYNC_8xx
- .section .fixup,"ax"
-03: blr
- .text
- .section __ex_table, "a"
- .align 2
- .long 00b, 03b
- .long 01b, 03b
- .long 02b, 03b
- .text
- bdnz 00b
- blr
-
-_GLOBAL(_outsw)
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,2
- blelr-
-00: lhzu r5,2(r4)
-01: eieio
-02: sthbrx r5,0,r3
- ISYNC_8xx
- .section .fixup,"ax"
-03: blr
- .text
- .section __ex_table, "a"
- .align 2
- .long 00b, 03b
- .long 01b, 03b
- .long 02b, 03b
- .text
- bdnz 00b
- blr
-
-_GLOBAL(_insl)
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,4
- blelr-
-00: lwbrx r5,0,r3
-01: eieio
-02: stwu r5,4(r4)
- ISYNC_8xx
- .section .fixup,"ax"
-03: blr
- .text
- .section __ex_table, "a"
- .align 2
- .long 00b, 03b
- .long 01b, 03b
- .long 02b, 03b
- .text
- bdnz 00b
- blr
-
-_GLOBAL(_outsl)
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,4
- blelr-
-00: lwzu r5,4(r4)
-01: stwbrx r5,0,r3
-02: eieio
- ISYNC_8xx
- .section .fixup,"ax"
-03: blr
- .text
- .section __ex_table, "a"
- .align 2
- .long 00b, 03b
- .long 01b, 03b
- .long 02b, 03b
- .text
- bdnz 00b
- blr
-
_GLOBAL(__ide_mm_insw)
_GLOBAL(_insw_ns)
cmpwi 0,r5,0
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index d173540..2bd1f73 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -122,10 +122,6 @@ EXPORT_SYMBOL(__ide_mm_outsl);
EXPORT_SYMBOL(_insb);
EXPORT_SYMBOL(_outsb);
-EXPORT_SYMBOL(_insw);
-EXPORT_SYMBOL(_outsw);
-EXPORT_SYMBOL(_insl);
-EXPORT_SYMBOL(_outsl);
EXPORT_SYMBOL(_insw_ns);
EXPORT_SYMBOL(_outsw_ns);
EXPORT_SYMBOL(_insl_ns);
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 9aaced5..0ee4843 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -151,10 +151,6 @@ #define readq_relaxed(addr) readq(addr)
extern void _insb(volatile u8 __iomem *port, void *buf, int ns);
extern void _outsb(volatile u8 __iomem *port, const void *buf, int ns);
-extern void _insw(volatile u16 __iomem *port, void *buf, int ns);
-extern void _outsw(volatile u16 __iomem *port, const void *buf, int ns);
-extern void _insl(volatile u32 __iomem *port, void *buf, int nl);
-extern void _outsl(volatile u32 __iomem *port, const void *buf, int nl);
extern void _insw_ns(volatile u16 __iomem *port, void *buf, int ns);
extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns);
extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl);
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index fb0a8fc..9fac420 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -329,10 +329,6 @@ #define outl_p(val, port) outl((val), (p
extern void _insb(volatile u8 __iomem *port, void *buf, int ns);
extern void _outsb(volatile u8 __iomem *port, const void *buf, int ns);
-extern void _insw(volatile u16 __iomem *port, void *buf, int ns);
-extern void _outsw(volatile u16 __iomem *port, const void *buf, int ns);
-extern void _insl(volatile u32 __iomem *port, void *buf, int nl);
-extern void _outsl(volatile u32 __iomem *port, const void *buf, int nl);
extern void _insw_ns(volatile u16 __iomem *port, void *buf, int ns);
extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns);
extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl);
--
1.4.2.1
^ permalink raw reply related
* [PATCH] fix error in cpm2
From: Amy Fong @ 2006-09-19 3:06 UTC (permalink / raw)
To: linuxppc-dev
The following patch fixes a typo in cpm2.h resulting in a compile error.
Signed-off-by: Amy Fong <amy.fong@windriver.com>
Index: linux-2.6.18-rc6/include/asm-ppc/cpm2.h
===================================================================
--- linux-2.6.18-rc6.orig/include/asm-ppc/cpm2.h
+++ linux-2.6.18-rc6/include/asm-ppc/cpm2.h
@@ -1186,7 +1186,7 @@
#define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128))
#define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0)
#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1)
-#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(2)
+#define FCC3_MEM_OFFSET FCC_MEM_OFFSET(2)
#endif /* __CPM2__ */
#endif /* __KERNEL__ */
^ permalink raw reply
* [POWERPC] clean up ide io accessors
From: Stephen Rothwell @ 2006-09-19 7:31 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/misc.S | 12 ------------
arch/powerpc/kernel/ppc_ksyms.c | 7 -------
arch/ppc/kernel/misc.S | 4 ----
arch/ppc/kernel/ppc_ksyms.c | 5 -----
include/asm-powerpc/ide.h | 12 ++++++------
include/asm-powerpc/io.h | 6 ------
6 files changed, 6 insertions(+), 40 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index dd5f8e4..6feb391 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -86,9 +86,6 @@ _GLOBAL(_outsb)
sync
blr
-#ifdef CONFIG_PPC32
-_GLOBAL(__ide_mm_insw)
-#endif
_GLOBAL(_insw_ns)
sync
cmpwi 0,r5,0
@@ -103,9 +100,6 @@ _GLOBAL(_insw_ns)
isync
blr
-#ifdef CONFIG_PPC32
-_GLOBAL(__ide_mm_outsw)
-#endif
_GLOBAL(_outsw_ns)
cmpwi 0,r5,0
mtctr r5
@@ -118,9 +112,6 @@ _GLOBAL(_outsw_ns)
sync
blr
-#ifdef CONFIG_PPC32
-_GLOBAL(__ide_mm_insl)
-#endif
_GLOBAL(_insl_ns)
sync
cmpwi 0,r5,0
@@ -135,9 +126,6 @@ _GLOBAL(_insl_ns)
isync
blr
-#ifdef CONFIG_PPC32
-_GLOBAL(__ide_mm_outsl)
-#endif
_GLOBAL(_outsl_ns)
cmpwi 0,r5,0
mtctr r5
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 314d611..75429e5 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -95,13 +95,6 @@ #ifdef CONFIG_PPC64
EXPORT_SYMBOL(copy_4K_page);
#endif
-#ifndef __powerpc64__
-EXPORT_SYMBOL(__ide_mm_insl);
-EXPORT_SYMBOL(__ide_mm_outsw);
-EXPORT_SYMBOL(__ide_mm_insw);
-EXPORT_SYMBOL(__ide_mm_outsl);
-#endif
-
EXPORT_SYMBOL(_insb);
EXPORT_SYMBOL(_outsb);
EXPORT_SYMBOL(_insw_ns);
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 44700bb..50b4bbd 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -768,7 +768,6 @@ _GLOBAL(_outsb)
bdnz 00b
blr
-_GLOBAL(__ide_mm_insw)
_GLOBAL(_insw_ns)
cmpwi 0,r5,0
mtctr r5
@@ -790,7 +789,6 @@ _GLOBAL(_insw_ns)
bdnz 00b
blr
-_GLOBAL(__ide_mm_outsw)
_GLOBAL(_outsw_ns)
cmpwi 0,r5,0
mtctr r5
@@ -812,7 +810,6 @@ _GLOBAL(_outsw_ns)
bdnz 00b
blr
-_GLOBAL(__ide_mm_insl)
_GLOBAL(_insl_ns)
cmpwi 0,r5,0
mtctr r5
@@ -834,7 +831,6 @@ _GLOBAL(_insl_ns)
bdnz 00b
blr
-_GLOBAL(__ide_mm_outsl)
_GLOBAL(_outsl_ns)
cmpwi 0,r5,0
mtctr r5
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 2bd1f73..c8b65ca 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -115,11 +115,6 @@ EXPORT_SYMBOL(outw);
EXPORT_SYMBOL(outl);
EXPORT_SYMBOL(outsl);*/
-EXPORT_SYMBOL(__ide_mm_insl);
-EXPORT_SYMBOL(__ide_mm_outsw);
-EXPORT_SYMBOL(__ide_mm_insw);
-EXPORT_SYMBOL(__ide_mm_outsl);
-
EXPORT_SYMBOL(_insb);
EXPORT_SYMBOL(_outsb);
EXPORT_SYMBOL(_insw_ns);
diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h
index b09b42a..c8390f9 100644
--- a/include/asm-powerpc/ide.h
+++ b/include/asm-powerpc/ide.h
@@ -12,6 +12,7 @@ #ifndef __powerpc64__
#include <linux/sched.h>
#include <asm/mpc8xx.h>
#endif
+#include <asm/io.h>
#ifndef MAX_HWIFS
#ifdef __powerpc64__
@@ -21,15 +22,14 @@ #define MAX_HWIFS 8
#endif
#endif
+#define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 __iomem *)(p), (a), (c))
+#define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 __iomem *)(p), (a), (c))
+#define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 __iomem *)(p), (a), (c))
+#define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 __iomem *)(p), (a), (c))
+
#ifndef __powerpc64__
#include <linux/hdreg.h>
#include <linux/ioport.h>
-#include <asm/io.h>
-
-extern void __ide_mm_insw(void __iomem *port, void *addr, u32 count);
-extern void __ide_mm_outsw(void __iomem *port, void *addr, u32 count);
-extern void __ide_mm_insl(void __iomem *port, void *addr, u32 count);
-extern void __ide_mm_outsl(void __iomem *port, void *addr, u32 count);
struct ide_machdep_calls {
int (*default_irq)(unsigned long base);
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 0ee4843..51a5987 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -28,12 +28,6 @@ #include <asm/delay.h>
#include <asm-generic/iomap.h>
-#define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 __iomem *)(p), (a), (c))
-#define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 __iomem *)(p), (a), (c))
-#define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 __iomem *)(p), (a), (c))
-#define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 __iomem *)(p), (a), (c))
-
-
#define SIO_CONFIG_RA 0x398
#define SIO_CONFIG_RD 0x399
--
1.4.2.1
^ permalink raw reply related
* Re: Ethernet driver for Linux kernel 2.6 running on ML403
From: Peter Korsgaard @ 2006-09-19 7:48 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <528646bc0609140734j2f7b008fy815f221677c5ac74@mail.gmail.com>
>>>>> "GL" == Grant Likely <grant.likely@secretlab.ca> writes:
Hi,
GL> So what direction do we (as the community) want to go for
GL> supporting Xilinx IP in the Linux kernel?
GL> IIRC, Xilinx intends to get drivers submitted into mainline.
GL> (Based on their cross-platform driver support code). It is
GL> unknown which and how many drivers for different IP versions will
GL> be submitted.
Yes, that's also what I hear from the Xilinx guys - But action speaks
louder than words. It's not like the V2P is new technology anymore.
GL> However, the xilinx driver code is verbose and does not match well
GL> with the rest of the Linux code base.
Yeah, the Xilinx stuff/flow definately doesn't fit the kernel.
GL> If we reject the Xilinx driver code, then we either have to do
GL> without Xilinx support in mainline, or we need to write new
GL> drivers that address the above issues (support multiple IP
GL> versions, etc). The Xilinx support in mainline right now does not
GL> use any Xilinx code. (Xilinx PIC and UART).
I think the best option is to simply forget about the Xilinx code,
see the FPGAs as any other PPC system and write normal device drivers
for it. Your platform bus stuff and my (to-be-mainlined) uartlite
driver is a first step in this direction..
--
Bye, Peter Korsgaard
^ permalink raw reply
* [PATCH] fix compile error in sbc8560
From: Amy Fong @ 2006-09-19 3:07 UTC (permalink / raw)
To: linuxppc-dev
The following fixes compile errors in sbc8560.
Signed-off-by: Amy Fong <amy.fong@windriver.com>
Index: linux-2.6.18-rc7/arch/ppc/platforms/85xx/sbc8560.h
===================================================================
--- linux-2.6.18-rc7.orig/arch/ppc/platforms/85xx/sbc8560.h
+++ linux-2.6.18-rc7/arch/ppc/platforms/85xx/sbc8560.h
@@ -14,6 +14,7 @@
#define __MACH_SBC8560_H__
#include <platforms/85xx/sbc85xx.h>
+#include <asm/irq.h>
#define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET)
Index: linux-2.6.18-rc7/arch/ppc/platforms/85xx/sbc85xx.h
===================================================================
--- linux-2.6.18-rc7.orig/arch/ppc/platforms/85xx/sbc85xx.h
+++ linux-2.6.18-rc7/arch/ppc/platforms/85xx/sbc85xx.h
@@ -49,4 +49,22 @@
#define MPC85XX_PCI1_IO_SIZE 0x01000000
+/* FCC1 Clock Source Configuration. These can be
+ * redefined in the board specific file.
+ * Can only choose from CLK9-12 */
+#define F1_RXCLK 12
+#define F1_TXCLK 11
+
+/* FCC2 Clock Source Configuration. These can be
+ * redefined in the board specific file.
+ * Can only choose from CLK13-16 */
+#define F2_RXCLK 13
+#define F2_TXCLK 14
+
+/* FCC3 Clock Source Configuration. These can be
+ * redefined in the board specific file.
+ * Can only choose from CLK13-16 */
+#define F3_RXCLK 15
+#define F3_TXCLK 16
+
#endif /* __PLATFORMS_85XX_SBC85XX_H__ */
^ permalink raw reply
* Re: [Alsa-devel] [PATCH] aoa: add locking to tas codec
From: Takashi Iwai @ 2006-09-19 9:18 UTC (permalink / raw)
To: Johannes Berg; +Cc: linuxppc-dev, alsa-devel
In-Reply-To: <1158221176.2936.21.camel@ux156>
At Thu, 14 Sep 2006 10:06:16 +0200,
Johannes Berg wrote:
>
> Looks like I completely forgot to do this. This patch adds locking to
> the tas codec so two userspace programs can't hit the controls at the
> same time. Tested on my powerbook, but I obviously can't find any
> problems even without it since it doesn't do SMP.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Thanks, I applied it to ALSA HG tree.
Takashi
^ permalink raw reply
* Re: [Alsa-devel] oops in snd-powermac due to snd-aoa
From: Takashi Iwai @ 2006-09-19 9:31 UTC (permalink / raw)
To: Olaf Hering; +Cc: linuxppc-dev, alsa-devel
In-Reply-To: <20060916095603.GA5447@aepfle.de>
At Sat, 16 Sep 2006 11:56:03 +0200,
Olaf Hering wrote:
>
> On Thu, Sep 07, Takashi Iwai wrote:
>
> > At Thu, 7 Sep 2006 14:42:56 +0200,
> > Olaf Hering wrote:
> > >
> > > I was playing with snd-aoa, maybe the driver would work on a G4/466.
> > > mv /lib/modules/*/kernel/sound/ppc/snd-powermac.ko .
> > > reboot
> > > $insmod /lib/modules/*/kernel/sound/aoa/*/*.ko
> > > alsamixer finds nothing.
> > > mv snd-powermac.ko /lib/modules/*/kernel/sound/ppc/
> > > $insmod snd-powermac.ko -> oops
> > >
> > > Using PowerMac machine description
> > (snip)
> > > ALSA sound/ppc/keywest.c:82: tumbler: cannot attach i2c client
> > > read_audio_gpio addr 67 ret 2 av 4
> > > headphone: 0, lineout: 0
> > > check_audio_gpio addr 70 ret 4 av 4
> > > check_audio_gpio addr 6f ret 7 av 4
> > > Unable to handle kernel paging request for data at address 0x00000002
> >
> > Does the patch below work?
>
> Yes, no oops, but also no sound without reboot. Thats ok.
Thanks, I included the patch to ALSA tree now.
Takashi
^ permalink raw reply
* booting monta vista 2.6
From: Brian Rutledge @ 2006-09-19 9:42 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 928 bytes --]
Hi
I have an Embedded Planet 852T board with the planet core bootloader and
trying to boot monta vista 2.6.
The code starts up and enters the function load_kernel() however it is
not passed board information in the load_kernel() parameter *bp.
Is there some way to set this via .config or some other means by which
this can be picked up.
Thanks Brian
Legal Disclaimer:
The information contained in this message may be privileged and confidential. It is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message
[-- Attachment #2: Type: text/html, Size: 2985 bytes --]
^ permalink raw reply
* Re: Ethernet driver for Linux kernel 2.6 running on ML403
From: Peter Korsgaard @ 2006-09-19 10:13 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <2FE3DBF1797A1443AAB3FA0EF6BF4EEC021EA645@XSJ-EXCHVS1.xlnx.xilinx.com>
>>>>> "JB" == John Bonesio <john.bonesio@xilinx.com> writes:
Hi,
JB> << The Xilinx approach of overwriting the source tree just feels
JB> wrong, and no one seems to want to do it that way.>>
JB> I am in the group that has control over how this is done. What
JB> would you propose be done different? Keep in mind that we are
JB> trying to support a process where someone builds a hardware design
JB> and the later changes it with new peripherals or perhaps makes
JB> minor tweaks. We want to make the updating of the Linux kernel to
JB> reflect these hardware changes easy for people.
Don't patch the kernel sources from EDK, but instead get the drivers
integrated in the mainline kernel. Either do config options for the
various IP versions or use runtime detection.
We're doing Linux development for several platforms and using a single
kernel tree for it all is absolute critical to my sanity..
The EDK drivers are nice as examples of how to use the IP cores, but
the defined and documented interface should be the IP, not the EDK
drivers.
--
Bye, Peter Korsgaard
^ permalink raw reply
* Re: Measure Interrupt Latency on MPC5200B
From: Josu Onandia @ 2006-09-19 12:05 UTC (permalink / raw)
To: Syed Amer Gilani; +Cc: Linuxppc-embedded
In-Reply-To: <ac3922a00609140500j79e33fb3lfecbefc151ce3b41@mail.gmail.com>
Syed Amer Gilani wrote:
>We have a MPC5200B(ppc) Board from Phytec, running with a 2.6 Linux
>Kernel. For Documentation purposes and testings how patches to the
>Kernel affects real time capabilities we want to measure the Interrupt
>Latency.
>I only found tools for other arches or patches for far to old kernels.
>Does somebody know a way for a 2.6 kernel on ppc? I already thought of
>generating a signal on an Output of the Board and measure it with a
>Oscilloscope but i don't find that method satisfying.
>
>Thank you in advance,
>Syed Amer Gilani
>_______________________________________________
>Linuxppc-embedded mailing list
>Linuxppc-embedded@ozlabs.org
>https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
Hi. I'm sorry for my own latency, but I've been very busy.
I'm measuring interrup latency in an MPC5200B, too, but with Linux 2.4.
With this processor you can use the TB registers to measure a lapse of time.
I use a GPT timer to generate a periodic interrupt. From the interrupt
routine I read the TBL and compare it with the expected value.
I do this using RTAI, because I need real-time response to interrupts,
but I suppose that with little effort you can port it to standard Linux.
If you want more details, or my actual source code, email me.
Josu Onandia
^ permalink raw reply
* Re: Measure Interrupt Latency on MPC5200B
From: Esben Nielsen @ 2006-09-19 12:16 UTC (permalink / raw)
To: Josu Onandia; +Cc: Linuxppc-embedded
In-Reply-To: <450FDCFD.9040102@fagorautomation.es>
On Tue, 19 Sep 2006, Josu Onandia wrote:
> Syed Amer Gilani wrote:
>
>> We have a MPC5200B(ppc) Board from Phytec, running with a 2.6 Linux
>> Kernel. For Documentation purposes and testings how patches to the
>> Kernel affects real time capabilities we want to measure the Interrupt
>> Latency.
>> I only found tools for other arches or patches for far to old kernels.
>> Does somebody know a way for a 2.6 kernel on ppc? I already thought of
>> generating a signal on an Output of the Board and measure it with a
>> Oscilloscope but i don't find that method satisfying.
>>
>> Thank you in advance,
>> Syed Amer Gilani
>> _______________________________________________
>> Linuxppc-embedded mailing list
>> Linuxppc-embedded@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>
>>
> Hi. I'm sorry for my own latency, but I've been very busy.
>
> I'm measuring interrup latency in an MPC5200B, too, but with Linux 2.4.
>
> With this processor you can use the TB registers to measure a lapse of time.
>
> I use a GPT timer to generate a periodic interrupt. From the interrupt
> routine I read the TBL and compare it with the expected value.
>
> I do this using RTAI, because I need real-time response to interrupts,
> but I suppose that with little effort you can port it to standard Linux.
>
> If you want more details, or my actual source code, email me.
>
> Josu Onandia
>
>
What are your results under the normal kernel and under RTAI?
Have anyone tried with -rt kernels? What are the results?
I work for a company using MPC5200 with VxWorks. It could be fun to
compare numbers...
Esben
^ permalink raw reply
* [POWERPC] convert string i/o operations to C
From: Stephen Rothwell @ 2006-09-19 12:23 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
This produces essentially the same code and will make the iSeries i/o
consolidation easier.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/Makefile | 2 -
arch/powerpc/kernel/io.c | 125 +++++++++++++++++++++++++++++++++++++++
arch/powerpc/kernel/misc.S | 95 ------------------------------
arch/powerpc/kernel/ppc_ksyms.c | 7 --
4 files changed, 126 insertions(+), 103 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 8b3f4fa..8b133af 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -51,7 +51,7 @@ extra-$(CONFIG_8xx) := head_8xx.o
extra-y += vmlinux.lds
obj-y += time.o prom.o traps.o setup-common.o \
- udbg.o misc.o
+ udbg.o misc.o io.o
obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o
obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o
obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o
diff --git a/arch/powerpc/kernel/io.c b/arch/powerpc/kernel/io.c
new file mode 100644
index 0000000..c83970d
--- /dev/null
+++ b/arch/powerpc/kernel/io.c
@@ -0,0 +1,125 @@
+/*
+ * I/O string operations
+ * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
+ * and Paul Mackerras.
+ *
+ * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
+ * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
+ *
+ * Rewritten in C by Stephen Rothwell.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/module.h>
+
+#include <asm/io.h>
+
+void _insb(volatile u8 __iomem *port, void *buf, int ns)
+{
+ asm volatile("sync");
+ if (ns <= 0)
+ return;
+ asm volatile(
+ "mtctr %2\n"
+ "subi %1,%1,1\n"
+ "0: lbz %2,0(%0)\n"
+ "eieio\n"
+ "stbu %2,1(%1)\n"
+ "bdnz 0b\n"
+ "twi 0,%2,0\n"
+ "isync\n"
+ : : "r" (port), "r" (buf), "r" (ns));
+}
+EXPORT_SYMBOL(_insb);
+
+void _outsb(volatile u8 __iomem *port, const void *buf, int ns)
+{
+ if (ns <= 0)
+ return;
+ asm volatile(
+ "mtctr %2\n"
+ "subi %1,%1,1\n"
+ "sync\n"
+ "0: lbzu %2,1(%1)\n"
+ "stb %2,0(%0)\n"
+ "bdnz 0b\n"
+ "sync\n"
+ : : "r" (port), "r" (buf), "r" (ns));
+}
+EXPORT_SYMBOL(_outsb);
+
+void _insw_ns(volatile u16 __iomem *port, void *buf, int ns)
+{
+ asm volatile("sync");
+ if (ns <= 0)
+ return;
+ asm volatile(
+ "mtctr %2\n"
+ "subi %1,%1,2\n"
+ "0: lhz %2,0(%0)\n"
+ "eieio\n"
+ "sthu %2,2(%1)\n"
+ "bdnz 0b\n"
+ "twi 0,%2,0\n"
+ "isync\n"
+ : : "r" (port), "r" (buf), "r" (ns));
+}
+EXPORT_SYMBOL(_insw_ns);
+
+void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns)
+{
+ if (ns <= 0)
+ return;
+ asm volatile(
+ "mtctr %2\n"
+ "subi %1,%1,2\n"
+ "sync\n"
+ "0: lhzu %2,2(%1)\n"
+ "sth %2,0(%0)\n"
+ "bdnz 0b\n"
+ "sync\n"
+ : : "r" (port), "r" (buf), "r" (ns));
+}
+EXPORT_SYMBOL(_outsw_ns);
+
+void _insl_ns(volatile u32 __iomem *port, void *buf, int nl)
+{
+ asm volatile("sync");
+ if (nl <= 0)
+ return;
+ asm volatile(
+ "mtctr %2\n"
+ "subi %1,%1,4\n"
+ "0: lwz %2,0(%0)\n"
+ "eieio\n"
+ "stwu %2,4(%1)\n"
+ "bdnz 0b\n"
+ "twi 0,%2,0\n"
+ "isync\n"
+ : : "r" (port), "r" (buf), "r" (nl));
+}
+EXPORT_SYMBOL(_insl_ns);
+
+void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl)
+{
+ if (nl <= 0)
+ return;
+ asm volatile(
+ "mtctr %2\n"
+ "subi %1,%1,4\n"
+ "sync\n"
+ "0: lwzu %2,4(%1)\n"
+ "stw %2,0(%0)\n"
+ "bdnz 0b\n"
+ "sync\n"
+ : : "r" (port), "r" (buf), "r" (nl));
+}
+EXPORT_SYMBOL(_outsl_ns);
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index 6feb391..330c9dc 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -43,98 +43,3 @@ _GLOBAL(add_reloc_offset)
add r3,r3,r5
mtlr r0
blr
-
-/*
- * I/O string operations
- *
- * insb(port, buf, len)
- * outsb(port, buf, len)
- * insw(port, buf, len)
- * outsw(port, buf, len)
- * insl(port, buf, len)
- * outsl(port, buf, len)
- * insw_ns(port, buf, len)
- * outsw_ns(port, buf, len)
- * insl_ns(port, buf, len)
- * outsl_ns(port, buf, len)
- *
- * The *_ns versions don't do byte-swapping.
- */
-_GLOBAL(_insb)
- sync
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,1
- blelr-
-00: lbz r5,0(r3)
- eieio
- stbu r5,1(r4)
- bdnz 00b
- twi 0,r5,0
- isync
- blr
-
-_GLOBAL(_outsb)
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,1
- blelr-
- sync
-00: lbzu r5,1(r4)
- stb r5,0(r3)
- bdnz 00b
- sync
- blr
-
-_GLOBAL(_insw_ns)
- sync
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,2
- blelr-
-00: lhz r5,0(r3)
- eieio
- sthu r5,2(r4)
- bdnz 00b
- twi 0,r5,0
- isync
- blr
-
-_GLOBAL(_outsw_ns)
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,2
- blelr-
- sync
-00: lhzu r5,2(r4)
- sth r5,0(r3)
- bdnz 00b
- sync
- blr
-
-_GLOBAL(_insl_ns)
- sync
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,4
- blelr-
-00: lwz r5,0(r3)
- eieio
- stwu r5,4(r4)
- bdnz 00b
- twi 0,r5,0
- isync
- blr
-
-_GLOBAL(_outsl_ns)
- cmpwi 0,r5,0
- mtctr r5
- subi r4,r4,4
- blelr-
- sync
-00: lwzu r5,4(r4)
- stw r5,0(r3)
- bdnz 00b
- sync
- blr
-
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 75429e5..807193a 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -95,13 +95,6 @@ #ifdef CONFIG_PPC64
EXPORT_SYMBOL(copy_4K_page);
#endif
-EXPORT_SYMBOL(_insb);
-EXPORT_SYMBOL(_outsb);
-EXPORT_SYMBOL(_insw_ns);
-EXPORT_SYMBOL(_outsw_ns);
-EXPORT_SYMBOL(_insl_ns);
-EXPORT_SYMBOL(_outsl_ns);
-
#if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE))
EXPORT_SYMBOL(ppc_ide_md);
#endif
--
1.4.2.1
^ permalink raw reply related
* Re: [POWERPC] convert string i/o operations to C
From: David Howells @ 2006-09-19 12:42 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus
In-Reply-To: <20060919222351.d27a1a06.sfr@canb.auug.org.au>
Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> +void _insb(volatile u8 __iomem *port, void *buf, int ns)
> +{
> + asm volatile("sync");
> + if (ns <= 0)
> + return;
What is "ns" meant to do? It seems to degrade the _insb() op to just a sync,
but is that correct?
David
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox