Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9162
b: refs/heads/master
c: 9506057
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks authored and Russell King committed Sep 20, 2005
1 parent a8a8451 commit af9acbc
Show file tree
Hide file tree
Showing 95 changed files with 2,078 additions and 4,898 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: a418500b42c5c54f3f9d68036950c701740a2765
refs/heads/master: 9506057fca54464f3291b62156e6cd907c4cbc95
2 changes: 1 addition & 1 deletion trunk/Documentation/DocBook/kernel-hacking.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ static struct block_device_operations opt_fops = {
</listitem>
<listitem>
<para>
Function names as strings (__FUNCTION__).
Function names as strings (__func__).
</para>
</listitem>
<listitem>
Expand Down
6 changes: 0 additions & 6 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2266,12 +2266,6 @@ M: kristen.c.accardi@intel.com
L: pcihpd-discuss@lists.sourceforge.net
S: Maintained

SKGE, SKY2 10/100/1000 GIGABIT ETHERNET DRIVERS
P: Stephen Hemminger
M: shemminger@osdl.org
L: netdev@vger.kernel.org
S: Maintained

SPARC (sparc32):
P: William L. Irwin
M: wli@holomorphy.com
Expand Down
9 changes: 3 additions & 6 deletions trunk/README
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ CONFIGURING the kernel:
"make gconfig" X windows (Gtk) based configuration tool.
"make oldconfig" Default all questions based on the contents of
your existing ./.config file.
"make silentoldconfig"
Like above, but avoids cluttering the screen
with question already answered.

NOTES on "make config":
- having unnecessary drivers will make the kernel bigger, and can
Expand All @@ -172,6 +169,9 @@ CONFIGURING the kernel:
should probably answer 'n' to the questions for
"development", "experimental", or "debugging" features.

- Check the top Makefile for further site-dependent configuration
(default SVGA mode etc).

COMPILING the kernel:

- Make sure you have gcc 2.95.3 available.
Expand Down Expand Up @@ -199,9 +199,6 @@ COMPILING the kernel:
are installing a new kernel with the same version number as your
working kernel, make a backup of your modules directory before you
do a "make modules_install".
In alternative, before compiling, edit your Makefile and change the
"EXTRAVERSION" line - its content is appended to the regular kernel
version.

- In order to boot your new kernel, you'll need to copy the kernel
image (e.g. .../linux/arch/i386/boot/bzImage after compilation)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SECTIONS
*(.arch.info)
__arch_info_end = .;
__tagtable_begin = .;
*(.taglist)
*(.taglist.init)
__tagtable_end = .;
. = ALIGN(16);
__setup_start = .;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ppc64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ install: vmlinux
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@

defaultimage-$(CONFIG_PPC_PSERIES) := zImage
defaultimage-$(CONFIG_PPC_PMAC) := zImage.vmode
defaultimage-$(CONFIG_PPC_PMAC) := vmlinux
defaultimage-$(CONFIG_PPC_MAPLE) := zImage
defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
KBUILD_IMAGE := $(defaultimage-y)
Expand Down
169 changes: 80 additions & 89 deletions trunk/arch/ppc64/kernel/pSeries_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,8 @@ static void iommu_table_setparms(struct pci_controller *phb,
tbl->it_offset = phb->dma_window_base_cur >> PAGE_SHIFT;

/* Test if we are going over 2GB of DMA space */
if (phb->dma_window_base_cur + phb->dma_window_size > 0x80000000ul) {
udbg_printf("PCI_DMA: Unexpected number of IOAs under this PHB.\n");
if (phb->dma_window_base_cur + phb->dma_window_size > (1L << 31))
panic("PCI_DMA: Unexpected number of IOAs under this PHB.\n");
}

phb->dma_window_base_cur += phb->dma_window_size;

Expand Down Expand Up @@ -312,84 +310,92 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,

static void iommu_bus_setup_pSeries(struct pci_bus *bus)
{
struct device_node *dn;
struct iommu_table *tbl;
struct device_node *isa_dn, *isa_dn_orig;
struct device_node *tmp;
struct device_node *dn, *pdn;
struct pci_dn *pci;
int children;
struct iommu_table *tbl;

DBG("iommu_bus_setup_pSeries, bus %p, bus->self %p\n", bus, bus->self);

dn = pci_bus_to_OF_node(bus);
pci = PCI_DN(dn);

if (bus->self) {
/* This is not a root bus, any setup will be done for the
* device-side of the bridge in iommu_dev_setup_pSeries().
*/
return;
}

/* Check if the ISA bus on the system is under
* this PHB.
*/
isa_dn = isa_dn_orig = of_find_node_by_type(NULL, "isa");

while (isa_dn && isa_dn != dn)
isa_dn = isa_dn->parent;

if (isa_dn_orig)
of_node_put(isa_dn_orig);

/* Count number of direct PCI children of the PHB.
* All PCI device nodes have class-code property, so it's
* an easy way to find them.
*/
for (children = 0, tmp = dn->child; tmp; tmp = tmp->sibling)
if (get_property(tmp, "class-code", NULL))
children++;

DBG("Children: %d\n", children);

/* Calculate amount of DMA window per slot. Each window must be
* a power of two (due to pci_alloc_consistent requirements).
/* For each (root) bus, we carve up the available DMA space in 256MB
* pieces. Since each piece is used by one (sub) bus/device, that would
* give a maximum of 7 devices per PHB. In most cases, this is plenty.
*
* Keep 256MB aside for PHBs with ISA.
* The exception is on Python PHBs (pre-POWER4). Here we don't have EADS
* bridges below the PHB to allocate the sectioned tables to, so instead
* we allocate a 1GB table at the PHB level.
*/

if (!isa_dn) {
/* No ISA/IDE - just set window size and return */
pci->phb->dma_window_size = 0x80000000ul; /* To be divided */

while (pci->phb->dma_window_size * children > 0x80000000ul)
pci->phb->dma_window_size >>= 1;
DBG("No ISA/IDE, window size is %x\n", pci->phb->dma_window_size);
pci->phb->dma_window_base_cur = 0;

return;
}

/* If we have ISA, then we probably have an IDE
* controller too. Allocate a 128MB table but
* skip the first 128MB to avoid stepping on ISA
* space.
*/
pci->phb->dma_window_size = 0x8000000ul;
pci->phb->dma_window_base_cur = 0x8000000ul;

tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
dn = pci_bus_to_OF_node(bus);
pci = dn->data;

if (!bus->self) {
/* Root bus */
if (is_python(dn)) {
unsigned int *iohole;

DBG("Python root bus %s\n", bus->name);

iohole = (unsigned int *)get_property(dn, "io-hole", 0);

if (iohole) {
/* On first bus we need to leave room for the
* ISA address space. Just skip the first 256MB
* alltogether. This leaves 768MB for the window.
*/
DBG("PHB has io-hole, reserving 256MB\n");
pci->phb->dma_window_size = 3 << 28;
pci->phb->dma_window_base_cur = 1 << 28;
} else {
/* 1GB window by default */
pci->phb->dma_window_size = 1 << 30;
pci->phb->dma_window_base_cur = 0;
}

tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);

iommu_table_setparms(pci->phb, dn, tbl);
pci->iommu_table = iommu_init_table(tbl);
} else {
/* Do a 128MB table at root. This is used for the IDE
* controller on some SMP-mode POWER4 machines. It
* doesn't hurt to allocate it on other machines
* -- it'll just be unused since new tables are
* allocated on the EADS level.
*
* Allocate at offset 128MB to avoid having to deal
* with ISA holes; 128MB table for IDE is plenty.
*/
pci->phb->dma_window_size = 1 << 27;
pci->phb->dma_window_base_cur = 1 << 27;

tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);

iommu_table_setparms(pci->phb, dn, tbl);
pci->iommu_table = iommu_init_table(tbl);

/* All child buses have 256MB tables */
pci->phb->dma_window_size = 1 << 28;
}
} else {
pdn = pci_bus_to_OF_node(bus->parent);

iommu_table_setparms(pci->phb, dn, tbl);
pci->iommu_table = iommu_init_table(tbl);
if (!bus->parent->self && !is_python(pdn)) {
struct iommu_table *tbl;
/* First child and not python means this is the EADS
* level. Allocate new table for this slot with 256MB
* window.
*/

/* Divide the rest (1.75GB) among the children */
pci->phb->dma_window_size = 0x80000000ul;
while (pci->phb->dma_window_size * children > 0x70000000ul)
pci->phb->dma_window_size >>= 1;
tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);

DBG("ISA/IDE, window size is %x\n", pci->phb->dma_window_size);
iommu_table_setparms(pci->phb, dn, tbl);

pci->iommu_table = iommu_init_table(tbl);
} else {
/* Lower than first child or under python, use parent table */
pci->iommu_table = PCI_DN(pdn)->iommu_table;
}
}
}


Expand Down Expand Up @@ -440,28 +446,13 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
static void iommu_dev_setup_pSeries(struct pci_dev *dev)
{
struct device_node *dn, *mydn;
struct iommu_table *tbl;

DBG("iommu_dev_setup_pSeries, dev %p (%s)\n", dev, dev->pretty_name);

mydn = dn = pci_device_to_OF_node(dev);

/* If we're the direct child of a root bus, then we need to allocate
* an iommu table ourselves. The bus setup code should have setup
* the window sizes already.
*/
if (!dev->bus->self) {
DBG(" --> first child, no bridge. Allocating iommu table.\n");
tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
iommu_table_setparms(PCI_DN(dn)->phb, dn, tbl);
PCI_DN(mydn)->iommu_table = iommu_init_table(tbl);

return;
}

/* If this device is further down the bus tree, search upwards until
* an already allocated iommu table is found and use that.
/* Now copy the iommu_table ptr from the bus device down to the
* pci device_node. This means get_iommu_table() won't need to search
* up the device tree to find it.
*/
mydn = dn = pci_device_to_OF_node(dev);

while (dn && dn->data && PCI_DN(dn)->iommu_table == NULL)
dn = dn->parent;
Expand Down
9 changes: 3 additions & 6 deletions trunk/arch/ppc64/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,11 @@ static unsigned int pci_parse_of_flags(u32 addr0)
unsigned int flags = 0;

if (addr0 & 0x02000000) {
flags = IORESOURCE_MEM | PCI_BASE_ADDRESS_SPACE_MEMORY;
flags |= (addr0 >> 22) & PCI_BASE_ADDRESS_MEM_TYPE_64;
flags |= (addr0 >> 28) & PCI_BASE_ADDRESS_MEM_TYPE_1M;
flags |= IORESOURCE_MEM;
if (addr0 & 0x40000000)
flags |= IORESOURCE_PREFETCH
| PCI_BASE_ADDRESS_MEM_PREFETCH;
flags |= IORESOURCE_PREFETCH;
} else if (addr0 & 0x01000000)
flags = IORESOURCE_IO | PCI_BASE_ADDRESS_SPACE_IO;
flags |= IORESOURCE_IO;
return flags;
}

Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/ppc64/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,6 @@ static void __init flatten_device_tree(void)
unsigned long offset = reloc_offset();
unsigned long mem_start, mem_end, room;
struct boot_param_header *hdr;
struct prom_t *_prom = PTRRELOC(&prom);
char *namep;
u64 *rsvmap;

Expand Down Expand Up @@ -1766,7 +1765,6 @@ static void __init flatten_device_tree(void)
RELOC(dt_struct_end) = PAGE_ALIGN(mem_start);

/* Finish header */
hdr->boot_cpuid_phys = _prom->cpu;
hdr->magic = OF_DT_HEADER;
hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start);
hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start);
Expand Down Expand Up @@ -1856,6 +1854,7 @@ static void __init prom_find_boot_cpu(void)

cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu);

prom_setprop(cpu_pkg, "linux,boot-cpu", NULL, 0);
prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval));
_prom->cpu = getprop_rval;

Expand Down
39 changes: 20 additions & 19 deletions trunk/arch/sparc64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,19 @@
* executing (see inherit_locked_prom_mappings() rant).
*/
sparc64_vpte_nucleus:
/* Note that kvmap below has verified that the address is
* in the range MODULES_VADDR --> VMALLOC_END already. So
* here we need only check if it is an OBP address or not.
*/
sethi %hi(LOW_OBP_ADDRESS), %g5
/* Load 0xf0000000, which is LOW_OBP_ADDRESS. */
mov 0xf, %g5
sllx %g5, 28, %g5

/* Is addr >= LOW_OBP_ADDRESS? */
cmp %g4, %g5
blu,pn %xcc, sparc64_vpte_patchme1
mov 0x1, %g5

/* Load 0x100000000, which is HI_OBP_ADDRESS. */
sllx %g5, 32, %g5

/* Is addr < HI_OBP_ADDRESS? */
cmp %g4, %g5
blu,pn %xcc, obp_iaddr_patch
nop
Expand Down Expand Up @@ -152,29 +156,26 @@ obp_daddr_patch:
* rather, use information saved during inherit_prom_mappings() using 8k
* pagesize.
*/
.align 32
kvmap:
sethi %hi(MODULES_VADDR), %g5
cmp %g4, %g5
blu,pn %xcc, longpath
mov (VMALLOC_END >> 24), %g5
sllx %g5, 24, %g5
cmp %g4, %g5
bgeu,pn %xcc, longpath
nop
/* Load 0xf0000000, which is LOW_OBP_ADDRESS. */
mov 0xf, %g5
sllx %g5, 28, %g5

kvmap_check_obp:
sethi %hi(LOW_OBP_ADDRESS), %g5
/* Is addr >= LOW_OBP_ADDRESS? */
cmp %g4, %g5
blu,pn %xcc, kvmap_vmalloc_addr
blu,pn %xcc, vmalloc_addr
mov 0x1, %g5

/* Load 0x100000000, which is HI_OBP_ADDRESS. */
sllx %g5, 32, %g5

/* Is addr < HI_OBP_ADDRESS? */
cmp %g4, %g5
blu,pn %xcc, obp_daddr_patch
nop

kvmap_vmalloc_addr:
/* If we get here, a vmalloc addr was accessed, load kernel VPTE. */
vmalloc_addr:
/* If we get here, a vmalloc addr accessed, load kernel VPTE. */
ldxa [%g3 + %g6] ASI_N, %g5
brgez,pn %g5, longpath
nop
Expand Down
Loading

0 comments on commit af9acbc

Please sign in to comment.