Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7298
b: refs/heads/master
c: 8d92739
h: refs/heads/master
v: v3
  • Loading branch information
Milton Miller authored and Paul Mackerras committed Sep 6, 2005
1 parent c5cd1ed commit 54fe493
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 40 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 188d2ce78feac67e41e41808acda7951810f677b
refs/heads/master: 8d9273918635f0301368c01b56c03a6f339e8d51
32 changes: 1 addition & 31 deletions trunk/arch/ppc64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ int boot_cpuid = 0;
int boot_cpuid_phys = 0;
dev_t boot_dev;
u64 ppc64_pft_size;
u64 ppc64_debug_switch;

struct ppc64_caches ppc64_caches;
EXPORT_SYMBOL_GPL(ppc64_caches);
Expand Down Expand Up @@ -154,34 +153,6 @@ struct screen_info screen_info = {
.orig_video_points = 16
};

/*
* Initialize the PPCDBG state. Called before relocation has been enabled.
*/
void __init ppcdbg_initialize(void)
{
ppc64_debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */
/* PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */;
}

/*
* Early boot console based on udbg
*/
static struct console udbg_console = {
.name = "udbg",
.write = udbg_console_write,
.flags = CON_PRINTBUFFER,
.index = -1,
};
static int early_console_initialized;

void __init disable_early_printk(void)
{
if (!early_console_initialized)
return;
unregister_console(&udbg_console);
early_console_initialized = 0;
}

#if defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_SMP)

static int smt_enabled_cmdline;
Expand Down Expand Up @@ -630,8 +601,7 @@ void __init setup_system(void)
/*
* Register early console
*/
early_console_initialized = 1;
register_console(&udbg_console);
register_early_udbg_console();

/* Save unparsed command line copy for /proc/cmdline */
strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
Expand Down
51 changes: 46 additions & 5 deletions trunk/arch/ppc64/kernel/udbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/console.h>
#include <asm/ppcdebug.h>
#include <asm/processor.h>

void (*udbg_putc)(unsigned char c);
unsigned char (*udbg_getc)(void);
int (*udbg_getc_poll)(void);

/* udbg library, used by xmon et al */
void udbg_puts(const char *s)
{
if (udbg_putc) {
Expand Down Expand Up @@ -75,11 +77,6 @@ int udbg_read(char *buf, int buflen)
return i;
}

void udbg_console_write(struct console *con, const char *s, unsigned int n)
{
udbg_write(s, n);
}

#define UDBG_BUFSIZE 256
void udbg_printf(const char *fmt, ...)
{
Expand All @@ -92,6 +89,10 @@ void udbg_printf(const char *fmt, ...)
va_end(args);
}

/* PPCDBG stuff */

u64 ppc64_debug_switch;

/* Special print used by PPCDBG() macro */
void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...)
{
Expand Down Expand Up @@ -131,3 +132,43 @@ unsigned long udbg_ifdebug(unsigned long flags)
{
return (flags & ppc64_debug_switch);
}

/*
* Initialize the PPCDBG state. Called before relocation has been enabled.
*/
void __init ppcdbg_initialize(void)
{
ppc64_debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */
/* PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */;
}

/*
* Early boot console based on udbg
*/
static void udbg_console_write(struct console *con, const char *s,
unsigned int n)
{
udbg_write(s, n);
}

static struct console udbg_console = {
.name = "udbg",
.write = udbg_console_write,
.flags = CON_PRINTBUFFER,
.index = -1,
};

void __init disable_early_printk(void)
{
unregister_console(&udbg_console);
}

/* called by setup_system */
void register_early_udbg_console(void)
{
register_console(&udbg_console);
}

#if 0 /* if you want to use this as a regular output console */
console_initcall(register_udbg_console);
#endif
6 changes: 3 additions & 3 deletions trunk/include/asm-ppc64/udbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define __UDBG_HDR

#include <linux/compiler.h>
#include <linux/init.h>

/*
* c 2001 PPC 64 Team, IBM Corp
Expand All @@ -20,12 +21,11 @@ extern void udbg_puts(const char *s);
extern int udbg_write(const char *s, int n);
extern int udbg_read(char *buf, int buflen);

struct console;
extern void udbg_console_write(struct console *con, const char *s, unsigned int n);
extern void register_early_udbg_console(void);
extern void udbg_printf(const char *fmt, ...);
extern void udbg_ppcdbg(unsigned long flags, const char *fmt, ...);
extern unsigned long udbg_ifdebug(unsigned long flags);

extern void __init ppcdbg_initialize(void);

extern void udbg_init_uart(void __iomem *comport, unsigned int speed);
#endif

0 comments on commit 54fe493

Please sign in to comment.