2007-02-08 07:33:51 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2006 IBM 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PSERIES_PSERIES_H
|
|
|
|
#define _PSERIES_PSERIES_H
|
|
|
|
|
2010-05-18 22:51:00 +00:00
|
|
|
#include <linux/interrupt.h>
|
|
|
|
|
|
|
|
struct device_node;
|
|
|
|
|
|
|
|
extern void request_event_sources_irqs(struct device_node *np,
|
|
|
|
irq_handler_t handler, const char *name);
|
|
|
|
|
2010-09-10 09:40:32 +00:00
|
|
|
#include <linux/of.h>
|
|
|
|
|
2013-04-24 05:57:18 +00:00
|
|
|
extern void __init fw_hypertas_feature_init(const char *hypertas,
|
|
|
|
unsigned long len);
|
|
|
|
extern void __init fw_vec5_feature_init(const char *hypertas,
|
|
|
|
unsigned long len);
|
2007-02-08 07:33:51 +00:00
|
|
|
|
|
|
|
struct pt_regs;
|
|
|
|
|
|
|
|
extern int pSeries_system_reset_exception(struct pt_regs *regs);
|
|
|
|
extern int pSeries_machine_check_exception(struct pt_regs *regs);
|
|
|
|
|
2007-02-08 07:33:55 +00:00
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
extern void smp_init_pseries_mpic(void);
|
|
|
|
extern void smp_init_pseries_xics(void);
|
|
|
|
#else
|
2007-05-16 03:21:09 +00:00
|
|
|
static inline void smp_init_pseries_mpic(void) { };
|
|
|
|
static inline void smp_init_pseries_xics(void) { };
|
2007-02-08 07:33:55 +00:00
|
|
|
#endif
|
|
|
|
|
2007-02-08 07:33:55 +00:00
|
|
|
#ifdef CONFIG_KEXEC
|
|
|
|
extern void setup_kexec_cpu_down_xics(void);
|
|
|
|
extern void setup_kexec_cpu_down_mpic(void);
|
|
|
|
#else
|
2007-02-14 05:08:05 +00:00
|
|
|
static inline void setup_kexec_cpu_down_xics(void) { }
|
|
|
|
static inline void setup_kexec_cpu_down_mpic(void) { }
|
2007-02-08 07:33:55 +00:00
|
|
|
#endif
|
|
|
|
|
[POWERPC] Rewrite IO allocation & mapping on powerpc64
This rewrites pretty much from scratch the handling of MMIO and PIO
space allocations on powerpc64. The main goals are:
- Get rid of imalloc and use more common code where possible
- Simplify the current mess so that PIO space is allocated and
mapped in a single place for PCI bridges
- Handle allocation constraints of PIO for all bridges including
hot plugged ones within the 2GB space reserved for IO ports,
so that devices on hotplugged busses will now work with drivers
that assume IO ports fit in an int.
- Cleanup and separate tracking of the ISA space in the reserved
low 64K of IO space. No ISA -> Nothing mapped there.
I booted a cell blade with IDE on PIO and MMIO and a dual G5 so
far, that's it :-)
With this patch, all allocations are done using the code in
mm/vmalloc.c, though we use the low level __get_vm_area with
explicit start/stop constraints in order to manage separate
areas for vmalloc/vmap, ioremap, and PCI IOs.
This greatly simplifies a lot of things, as you can see in the
diffstat of that patch :-)
A new pair of functions pcibios_map/unmap_io_space() now replace
all of the previous code that used to manipulate PCI IOs space.
The allocation is done at mapping time, which is now called from
scan_phb's, just before the devices are probed (instead of after,
which is by itself a bug fix). The only other caller is the PCI
hotplug code for hot adding PCI-PCI bridges (slots).
imalloc is gone, as is the "sub-allocation" thing, but I do beleive
that hotplug should still work in the sense that the space allocation
is always done by the PHB, but if you unmap a child bus of this PHB
(which seems to be possible), then the code should properly tear
down all the HPTE mappings for that area of the PHB allocated IO space.
I now always reserve the first 64K of IO space for the bridge with
the ISA bus on it. I have moved the code for tracking ISA in a separate
file which should also make it smarter if we ever are capable of
hot unplugging or re-plugging an ISA bridge.
This should have a side effect on platforms like powermac where VGA IOs
will no longer work. This is done on purpose though as they would have
worked semi-randomly before. The idea at this point is to isolate drivers
that might need to access those and fix them by providing a proper
function to obtain an offset to the legacy IOs of a given bus.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-06-04 05:15:36 +00:00
|
|
|
extern void pSeries_final_fixup(void);
|
|
|
|
|
2007-02-08 22:01:17 +00:00
|
|
|
/* Poweron flag used for enabling auto ups restart */
|
|
|
|
extern unsigned long rtas_poweron_auto;
|
|
|
|
|
powerpc/pseries: Re-implement HVSI as part of hvc_vio
On pseries machines, consoles are provided by the hypervisor using
a low level get_chars/put_chars type interface. However, this is
really just a transport to the service processor which implements
them either as "raw" console (networked consoles, HMC, ...) or as
"hvsi" serial ports.
The later is a simple packet protocol on top of the raw character
interface that is supposed to convey additional "serial port" style
semantics. In practice however, all it does is provide a way to
read the CD line and set/clear our DTR line, that's it.
We currently implement the "raw" protocol as an hvc console backend
(/dev/hvcN) and the "hvsi" protocol using a separate tty driver
(/dev/hvsi0).
However this is quite impractical. The arbitrary difference between
the two type of devices has been a major source of user (and distro)
confusion. Additionally, there's an additional mini -hvsi implementation
in the pseries platform code for our low level debug console and early
boot kernel messages, which means code duplication, though that low
level variant is impractical as it's incapable of doing the initial
protocol negociation to establish the link to the FSP.
This essentially replaces the dedicated hvsi driver and the platform
udbg code completely by extending the existing hvc_vio backend used
in "raw" mode so that:
- It now supports HVSI as well
- We add support for hvc backend providing tiocm{get,set}
- It also provides a udbg interface for early debug and boot console
This is overall less code, though this will only be obvious once we
remove the old "hvsi" driver, which is still available for now. When
the old driver is enabled, the new code still kicks in for the low
level udbg console, replacing the old mini implementation in the platform
code, it just doesn't provide the higher level "hvc" interface.
In addition to producing generally simler code, this has several benefits
over our current situation:
- The user/distro only has to deal with /dev/hvcN for the hypervisor
console, avoiding all sort of confusion that has plagued us in the past
- The tty, kernel and low level debug console all use the same code
base which supports the full protocol establishment process, thus the
console is now available much earlier than it used to be with the
old HVSI driver. The kernel console works much earlier and udbg is
available much earlier too. Hackers can enable a hard coded very-early
debug console as well that works with HVSI (previously that was only
supported for the "raw" mode).
I've tried to keep the same semantics as hvsi relative to how I react
to things like CD changes, with some subtle differences though:
- I clear DTR on close if HUPCL is set
- Current hvsi triggers a hangup if it detects a up->down transition
on CD (you can still open a console with CD down). My new implementation
triggers a hangup if the link to the FSP is severed, and severs it upon
detecting a up->down transition on CD.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2011-05-12 03:46:38 +00:00
|
|
|
/* Provided by HVC VIO */
|
|
|
|
extern void hvc_vio_init_early(void);
|
2008-04-16 03:51:48 +00:00
|
|
|
|
2010-09-10 09:40:32 +00:00
|
|
|
/* Dynamic logical Partitioning/Mobility */
|
|
|
|
extern void dlpar_free_cc_nodes(struct device_node *);
|
|
|
|
extern void dlpar_free_cc_property(struct property *);
|
2014-09-16 20:15:45 +00:00
|
|
|
extern struct device_node *dlpar_configure_connector(__be32,
|
|
|
|
struct device_node *);
|
2010-09-10 09:40:32 +00:00
|
|
|
extern int dlpar_attach_node(struct device_node *);
|
|
|
|
extern int dlpar_detach_node(struct device_node *);
|
|
|
|
|
2013-05-03 12:43:12 +00:00
|
|
|
/* PCI root bridge prepare function override for pseries */
|
|
|
|
struct pci_host_bridge;
|
|
|
|
int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
|
|
|
|
|
2015-03-31 05:00:50 +00:00
|
|
|
extern struct pci_controller_ops pseries_pci_controller_ops;
|
|
|
|
|
2014-06-04 07:50:47 +00:00
|
|
|
unsigned long pseries_memory_block_size(void);
|
|
|
|
|
2007-02-08 07:33:51 +00:00
|
|
|
#endif /* _PSERIES_PSERIES_H */
|