Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46866
b: refs/heads/master
c: c347b79
h: refs/heads/master
v: v3
  • Loading branch information
Ishizaki Kou authored and Paul Mackerras committed Feb 7, 2007
1 parent c67b217 commit 26268b6
Show file tree
Hide file tree
Showing 12 changed files with 562 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e107931956f8327637508b91a9ddd4ba35be289d
refs/heads/master: c347b7989e4d9e1c23cb5cfba78c63c031b7dcee
15 changes: 15 additions & 0 deletions trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,16 @@ config PPC_PS3
This option enables support for the Sony PS3 game console
and other platforms using the PS3 hypervisor.

config PPC_CELLEB
bool "Toshiba's Cell Reference Set 'Celleb' Architecture"
depends on PPC_MULTIPLATFORM && PPC64
select PPC_CELL
select PPC_OF_PLATFORM_PCI
select HAS_TXX9_SERIAL
select PPC_UDBG_BEAT
select USB_OHCI_BIG_ENDIAN_MMIO
select USB_EHCI_BIG_ENDIAN_MMIO

config PPC_NATIVE
bool
depends on PPC_MULTIPLATFORM
Expand All @@ -552,6 +562,11 @@ config UDBG_RTAS_CONSOLE
depends on PPC_RTAS
default n

config PPC_UDBG_BEAT
bool "BEAT based debug console"
depends on PPC_CELLEB
default n

config XICS
depends on PPC_PSERIES
bool
Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/powerpc/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ config PPC_EARLY_DEBUG_ISERIES
Select this to enable early debugging for legacy iSeries. You need
to hit "Ctrl-x Ctrl-x" to see the messages on the console.

config PPC_EARLY_DEBUG_BEAT
bool "Beat HV Console"
depends on PPC_CELLEB
select PPC_UDBG_BEAT
help
Select this to enable early debugging for Celleb with Beat.

endchoice

endmenu
1 change: 1 addition & 0 deletions trunk/arch/powerpc/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ image-$(CONFIG_PPC_PSERIES) += zImage.pseries
image-$(CONFIG_PPC_MAPLE) += zImage.pseries
image-$(CONFIG_PPC_IBM_CELL_BLADE) += zImage.pseries
image-$(CONFIG_PPC_PS3) += zImage.ps3
image-$(CONFIG_PPC_CELLEB) += zImage.pseries
image-$(CONFIG_PPC_CHRP) += zImage.chrp
image-$(CONFIG_PPC_EFIKA) += zImage.chrp
image-$(CONFIG_PPC_PMAC) += zImage.pmac
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ obj-$(CONFIG_PPC_MAPLE) += maple/
obj-$(CONFIG_PPC_PASEMI) += pasemi/
obj-$(CONFIG_PPC_CELL) += cell/
obj-$(CONFIG_PPC_PS3) += ps3/
obj-$(CONFIG_PPC_CELLEB) += celleb/
obj-$(CONFIG_EMBEDDED6xx) += embedded6xx/
9 changes: 9 additions & 0 deletions trunk/arch/powerpc/platforms/celleb/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
obj-y += interrupt.o iommu.o setup.o \
htab.o beat.o pci.o \
scc_epci.o hvCall.o

obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_PPC_UDBG_BEAT) += udbg_beat.o
obj-$(CONFIG_USB) += scc_uhc.o
obj-$(CONFIG_HAS_TXX9_SERIAL) += scc_sio.o
obj-$(CONFIG_SPU_BASE) += spu_priv1.o
163 changes: 163 additions & 0 deletions trunk/arch/powerpc/platforms/celleb/beat.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
/*
* Simple routines for Celleb/Beat
*
* (C) Copyright 2006-2007 TOSHIBA CORPORATION
*
* 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, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/rtc.h>

#include <asm/hvconsole.h>
#include <asm/time.h>

#include "beat_wrapper.h"
#include "beat.h"

void beat_restart(char *cmd)
{
beat_shutdown_logical_partition(1);
}

void beat_power_off(void)
{
beat_shutdown_logical_partition(0);
}

u64 beat_halt_code = 0x1000000000000000UL;

void beat_halt(void)
{
beat_shutdown_logical_partition(beat_halt_code);
}

int beat_set_rtc_time(struct rtc_time *rtc_time)
{
u64 tim;
tim = mktime(rtc_time->tm_year+1900,
rtc_time->tm_mon+1, rtc_time->tm_mday,
rtc_time->tm_hour, rtc_time->tm_min, rtc_time->tm_sec);
if (beat_rtc_write(tim))
return -1;
return 0;
}

void beat_get_rtc_time(struct rtc_time *rtc_time)
{
u64 tim;

if (beat_rtc_read(&tim))
tim = 0;
to_tm(tim, rtc_time);
rtc_time->tm_year -= 1900;
rtc_time->tm_mon -= 1;
}

#define BEAT_NVRAM_SIZE 4096

ssize_t beat_nvram_read(char *buf, size_t count, loff_t *index)
{
unsigned int i;
unsigned long len;
char *p = buf;

if (*index >= BEAT_NVRAM_SIZE)
return -ENODEV;
i = *index;
if (i + count > BEAT_NVRAM_SIZE)
count = BEAT_NVRAM_SIZE - i;

for (; count != 0; count -= len) {
len = count;
if (len > BEAT_NVRW_CNT)
len = BEAT_NVRW_CNT;
if (beat_eeprom_read(i, len, p)) {
return -EIO;
}

p += len;
i += len;
}
*index = i;
return p - buf;
}

ssize_t beat_nvram_write(char *buf, size_t count, loff_t *index)
{
unsigned int i;
unsigned long len;
char *p = buf;

if (*index >= BEAT_NVRAM_SIZE)
return -ENODEV;
i = *index;
if (i + count > BEAT_NVRAM_SIZE)
count = BEAT_NVRAM_SIZE - i;

for (; count != 0; count -= len) {
len = count;
if (len > BEAT_NVRW_CNT)
len = BEAT_NVRW_CNT;
if (beat_eeprom_write(i, len, p)) {
return -EIO;
}

p += len;
i += len;
}
*index = i;
return p - buf;
}

ssize_t beat_nvram_get_size(void)
{
return BEAT_NVRAM_SIZE;
}

int beat_set_xdabr(unsigned long dabr)
{
if (beat_set_dabr(dabr, DABRX_KERNEL | DABRX_USER))
return -1;
return 0;
}

int64_t beat_get_term_char(u64 vterm, u64 *len, u64 *t1, u64 *t2)
{
u64 db[2];
s64 ret;

ret = beat_get_characters_from_console(vterm, len, (u8*)db);
if (ret == 0) {
*t1 = db[0];
*t2 = db[1];
}
return ret;
}

int64_t beat_put_term_char(u64 vterm, u64 len, u64 t1, u64 t2)
{
u64 db[2];

db[0] = t1;
db[1] = t2;
return beat_put_characters_to_console(vterm, len, (u8*)db);
}

EXPORT_SYMBOL(beat_get_term_char);
EXPORT_SYMBOL(beat_put_term_char);
EXPORT_SYMBOL(beat_halt_code);
40 changes: 40 additions & 0 deletions trunk/arch/powerpc/platforms/celleb/beat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Guest OS Interfaces.
*
* (C) Copyright 2006 TOSHIBA CORPORATION
*
* 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, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef _CELLEB_BEAT_H
#define _CELLEB_BEAT_H

#define DABRX_KERNEL (1UL<<1)
#define DABRX_USER (1UL<<0)

int64_t beat_get_term_char(uint64_t,uint64_t*,uint64_t*,uint64_t*);
int64_t beat_put_term_char(uint64_t,uint64_t,uint64_t,uint64_t);
int64_t beat_repository_encode(int, const char *, uint64_t[4]);
void beat_restart(char *);
void beat_power_off(void);
void beat_halt(void);
int beat_set_rtc_time(struct rtc_time *);
void beat_get_rtc_time(struct rtc_time *);
ssize_t beat_nvram_get_size(void);
ssize_t beat_nvram_read(char *, size_t, loff_t *);
ssize_t beat_nvram_write(char *, size_t, loff_t *);
int beat_set_xdabr(unsigned long);

#endif /* _CELLEB_BEAT_H */
Loading

0 comments on commit 26268b6

Please sign in to comment.