diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2006-07-14 11:27:26 +0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2006-07-14 11:27:26 +0400 |
commit | 790e05d8c2b9941218c7c9ffb5c318382fab0a8b (patch) | |
tree | efc88203419278fbe9aa6ebbf3b74738abf573f2 /arch/powerpc/platforms/iseries/dt.c | |
parent | 20697cb775bdd0271f3c90fad2d15c065fd19488 (diff) | |
parent | ca652c9396fa052815518e2b2ce2ebee6d9fb861 (diff) | |
download | linux-790e05d8c2b9941218c7c9ffb5c318382fab0a8b.tar.xz |
Merge branch 'mpe'
Diffstat (limited to 'arch/powerpc/platforms/iseries/dt.c')
-rw-r--r-- | arch/powerpc/platforms/iseries/dt.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/iseries/dt.c b/arch/powerpc/platforms/iseries/dt.c index 894b534669d0..e305deee7f44 100644 --- a/arch/powerpc/platforms/iseries/dt.c +++ b/arch/powerpc/platforms/iseries/dt.c @@ -1,5 +1,6 @@ /* - * Copyright (c) 2005-2006 Michael Ellerman, IBM Corporation + * Copyright (C) 2005-2006 Michael Ellerman, IBM Corporation + * Copyright (C) 2000-2004, IBM Corporation * * Description: * This file contains all the routines to build a flattened device @@ -33,13 +34,13 @@ #include <asm/iseries/hv_types.h> #include <asm/iseries/hv_lp_config.h> #include <asm/iseries/hv_call_xm.h> -#include <asm/iseries/it_exp_vpd_panel.h> #include <asm/udbg.h> #include "processor_vpd.h" #include "call_hpt.h" #include "call_pci.h" #include "pci.h" +#include "it_exp_vpd_panel.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -76,6 +77,43 @@ static char __initdata device_type_pci[] = "pci"; static char __initdata device_type_vdevice[] = "vdevice"; static char __initdata device_type_vscsi[] = "vscsi"; + +/* EBCDIC to ASCII conversion routines */ + +static unsigned char __init e2a(unsigned char x) +{ + switch (x) { + case 0x81 ... 0x89: + return x - 0x81 + 'a'; + case 0x91 ... 0x99: + return x - 0x91 + 'j'; + case 0xA2 ... 0xA9: + return x - 0xA2 + 's'; + case 0xC1 ... 0xC9: + return x - 0xC1 + 'A'; + case 0xD1 ... 0xD9: + return x - 0xD1 + 'J'; + case 0xE2 ... 0xE9: + return x - 0xE2 + 'S'; + case 0xF0 ... 0xF9: + return x - 0xF0 + '0'; + } + return ' '; +} + +static unsigned char * __init strne2a(unsigned char *dest, + const unsigned char *src, size_t n) +{ + int i; + + n = strnlen(src, n); + + for (i = 0; i < n; i++) + dest[i] = e2a(src[i]); + + return dest; +} + static struct iseries_flat_dt * __init dt_init(void) { struct iseries_flat_dt *dt; |