You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'linus' into perf/core
Reason: Further changes conflict with upstream fixes Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
@@ -2048,7 +2048,9 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||
WARNING: Forcing ASPM on may cause system lockups.
|
||||
|
||||
pcie_pme= [PCIE,PM] Native PCIe PME signaling options:
|
||||
off Do not use native PCIe PME signaling.
|
||||
Format: {auto|force}[,nomsi]
|
||||
auto Use native PCIe PME signaling if the BIOS allows the
|
||||
kernel to control PCIe config registers of root ports.
|
||||
force Use native PCIe PME signaling even if the BIOS refuses
|
||||
to allow the kernel to control the relevant PCIe config
|
||||
registers.
|
||||
|
||||
+12
-9
@@ -1581,7 +1581,7 @@ F: include/linux/coda*.h
|
||||
|
||||
COMMON INTERNET FILE SYSTEM (CIFS)
|
||||
M: Steve French <sfrench@samba.org>
|
||||
L: linux-cifs-client@lists.samba.org (moderated for non-subscribers)
|
||||
L: linux-cifs@vger.kernel.org
|
||||
L: samba-technical@lists.samba.org (moderated for non-subscribers)
|
||||
W: http://linux-cifs.samba.org/
|
||||
Q: http://patchwork.ozlabs.org/project/linux-cifs-client/list/
|
||||
@@ -2887,6 +2887,13 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
|
||||
S: Maintained
|
||||
F: drivers/input/
|
||||
|
||||
INPUT MULTITOUCH (MT) PROTOCOL
|
||||
M: Henrik Rydberg <rydberg@euromail.se>
|
||||
L: linux-input@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/input/multi-touch-protocol.txt
|
||||
K: \b(ABS|SYN)_MT_
|
||||
|
||||
INTEL IDLE DRIVER
|
||||
M: Len Brown <lenb@kernel.org>
|
||||
L: linux-pm@lists.linux-foundation.org
|
||||
@@ -2978,20 +2985,14 @@ F: drivers/net/ixgb/
|
||||
F: drivers/net/ixgbe/
|
||||
|
||||
INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
|
||||
M: Reinette Chatre <reinette.chatre@intel.com>
|
||||
M: Intel Linux Wireless <ilw@linux.intel.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
W: http://ipw2100.sourceforge.net
|
||||
S: Odd Fixes
|
||||
S: Orphan
|
||||
F: Documentation/networking/README.ipw2100
|
||||
F: drivers/net/wireless/ipw2x00/ipw2100.*
|
||||
|
||||
INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
|
||||
M: Reinette Chatre <reinette.chatre@intel.com>
|
||||
M: Intel Linux Wireless <ilw@linux.intel.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
W: http://ipw2200.sourceforge.net
|
||||
S: Odd Fixes
|
||||
S: Orphan
|
||||
F: Documentation/networking/README.ipw2200
|
||||
F: drivers/net/wireless/ipw2x00/ipw2200.*
|
||||
|
||||
@@ -4205,6 +4206,7 @@ OPEN FIRMWARE AND FLATTENED DEVICE TREE
|
||||
M: Grant Likely <grant.likely@secretlab.ca>
|
||||
L: devicetree-discuss@lists.ozlabs.org
|
||||
W: http://fdt.secretlab.ca
|
||||
T: git git://git.secretlab.ca/git/linux-2.6.git
|
||||
S: Maintained
|
||||
F: drivers/of
|
||||
F: include/linux/of*.h
|
||||
@@ -5377,6 +5379,7 @@ M: David Brownell <dbrownell@users.sourceforge.net>
|
||||
M: Grant Likely <grant.likely@secretlab.ca>
|
||||
L: spi-devel-general@lists.sourceforge.net
|
||||
Q: http://patchwork.kernel.org/project/spi-devel-general/list/
|
||||
T: git git://git.secretlab.ca/git/linux-2.6.git
|
||||
S: Maintained
|
||||
F: Documentation/spi/
|
||||
F: drivers/spi/
|
||||
|
||||
@@ -944,7 +944,7 @@ ifdef CONFIG_LOCALVERSION_AUTO
|
||||
localver-extra = $(scm-identifier)
|
||||
else
|
||||
ifneq ($(scm-identifier),)
|
||||
ifeq ($(LOCALVERSION),)
|
||||
ifeq ("$(origin LOCALVERSION)", "undefined")
|
||||
localver-extra = +
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -410,7 +410,7 @@ static inline unsigned long __arch_hweight64(unsigned long w)
|
||||
return __kernel_ctpop(w);
|
||||
}
|
||||
|
||||
static inline unsigned int __arch_weight32(unsigned int w)
|
||||
static inline unsigned int __arch_hweight32(unsigned int w)
|
||||
{
|
||||
return __arch_hweight64(w);
|
||||
}
|
||||
|
||||
+10
-10
@@ -35,7 +35,7 @@ endif
|
||||
|
||||
obj-y += irq_pyxis.o irq_i8259.o irq_srm.o
|
||||
obj-y += err_ev6.o
|
||||
obj-y += es1888.o smc37c669.o smc37c93x.o ns87312.o gct.o
|
||||
obj-y += es1888.o smc37c669.o smc37c93x.o pc873xx.o gct.o
|
||||
obj-y += srmcons.o
|
||||
|
||||
else
|
||||
@@ -63,11 +63,11 @@ obj-$(CONFIG_ALPHA_WILDFIRE) += core_wildfire.o
|
||||
# Board support
|
||||
obj-$(CONFIG_ALPHA_ALCOR) += sys_alcor.o irq_i8259.o irq_srm.o
|
||||
obj-$(CONFIG_ALPHA_CABRIOLET) += sys_cabriolet.o irq_i8259.o irq_srm.o \
|
||||
ns87312.o
|
||||
pc873xx.o
|
||||
obj-$(CONFIG_ALPHA_EB164) += sys_cabriolet.o irq_i8259.o irq_srm.o \
|
||||
ns87312.o
|
||||
pc873xx.o
|
||||
obj-$(CONFIG_ALPHA_EB66P) += sys_cabriolet.o irq_i8259.o irq_srm.o \
|
||||
ns87312.o
|
||||
pc873xx.o
|
||||
obj-$(CONFIG_ALPHA_LX164) += sys_cabriolet.o irq_i8259.o irq_srm.o \
|
||||
smc37c93x.o
|
||||
obj-$(CONFIG_ALPHA_PC164) += sys_cabriolet.o irq_i8259.o irq_srm.o \
|
||||
@@ -90,14 +90,14 @@ obj-$(CONFIG_ALPHA_RUFFIAN) += sys_ruffian.o irq_pyxis.o irq_i8259.o
|
||||
obj-$(CONFIG_ALPHA_RX164) += sys_rx164.o irq_i8259.o
|
||||
obj-$(CONFIG_ALPHA_SABLE) += sys_sable.o
|
||||
obj-$(CONFIG_ALPHA_LYNX) += sys_sable.o
|
||||
obj-$(CONFIG_ALPHA_BOOK1) += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
|
||||
obj-$(CONFIG_ALPHA_AVANTI) += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
|
||||
obj-$(CONFIG_ALPHA_NONAME) += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
|
||||
obj-$(CONFIG_ALPHA_P2K) += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
|
||||
obj-$(CONFIG_ALPHA_XL) += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
|
||||
obj-$(CONFIG_ALPHA_BOOK1) += sys_sio.o irq_i8259.o irq_srm.o pc873xx.o
|
||||
obj-$(CONFIG_ALPHA_AVANTI) += sys_sio.o irq_i8259.o irq_srm.o pc873xx.o
|
||||
obj-$(CONFIG_ALPHA_NONAME) += sys_sio.o irq_i8259.o irq_srm.o pc873xx.o
|
||||
obj-$(CONFIG_ALPHA_P2K) += sys_sio.o irq_i8259.o irq_srm.o pc873xx.o
|
||||
obj-$(CONFIG_ALPHA_XL) += sys_sio.o irq_i8259.o irq_srm.o pc873xx.o
|
||||
obj-$(CONFIG_ALPHA_SX164) += sys_sx164.o irq_pyxis.o irq_i8259.o \
|
||||
irq_srm.o smc37c669.o
|
||||
obj-$(CONFIG_ALPHA_TAKARA) += sys_takara.o irq_i8259.o ns87312.o
|
||||
obj-$(CONFIG_ALPHA_TAKARA) += sys_takara.o irq_i8259.o pc873xx.o
|
||||
obj-$(CONFIG_ALPHA_WILDFIRE) += sys_wildfire.o irq_i8259.o
|
||||
|
||||
# Error support
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* linux/arch/alpha/kernel/ns87312.c
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <asm/io.h>
|
||||
#include "proto.h"
|
||||
|
||||
|
||||
/*
|
||||
* The SRM console *disables* the IDE interface, this code ensures it's
|
||||
* enabled.
|
||||
*
|
||||
* This code bangs on a control register of the 87312 Super I/O chip
|
||||
* that implements parallel port/serial ports/IDE/FDI. Depending on
|
||||
* the motherboard, the Super I/O chip can be configured through a
|
||||
* pair of registers that are located either at I/O ports 0x26e/0x26f
|
||||
* or 0x398/0x399. Unfortunately, autodetecting which base address is
|
||||
* in use works only once (right after a reset). The Super I/O chip
|
||||
* has the additional quirk that configuration register data must be
|
||||
* written twice (I believe this is a safety feature to prevent
|
||||
* accidental modification---fun, isn't it?).
|
||||
*/
|
||||
|
||||
void __init
|
||||
ns87312_enable_ide(long ide_base)
|
||||
{
|
||||
int data;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
outb(0, ide_base); /* set the index register for reg #0 */
|
||||
data = inb(ide_base+1); /* read the current contents */
|
||||
outb(0, ide_base); /* set the index register for reg #0 */
|
||||
outb(data | 0x40, ide_base+1); /* turn on IDE */
|
||||
outb(data | 0x40, ide_base+1); /* turn on IDE, really! */
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
#include <linux/ioport.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include "pc873xx.h"
|
||||
|
||||
static unsigned pc873xx_probelist[] = {0x398, 0x26e, 0};
|
||||
|
||||
static char *pc873xx_names[] = {
|
||||
"PC87303", "PC87306", "PC87312", "PC87332", "PC87334"
|
||||
};
|
||||
|
||||
static unsigned int base, model;
|
||||
|
||||
|
||||
unsigned int __init pc873xx_get_base()
|
||||
{
|
||||
return base;
|
||||
}
|
||||
|
||||
char *__init pc873xx_get_model()
|
||||
{
|
||||
return pc873xx_names[model];
|
||||
}
|
||||
|
||||
static unsigned char __init pc873xx_read(unsigned int base, int reg)
|
||||
{
|
||||
outb(reg, base);
|
||||
return inb(base + 1);
|
||||
}
|
||||
|
||||
static void __init pc873xx_write(unsigned int base, int reg, unsigned char data)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
outb(reg, base);
|
||||
outb(data, base + 1);
|
||||
outb(data, base + 1); /* Must be written twice */
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
int __init pc873xx_probe(void)
|
||||
{
|
||||
int val, index = 0;
|
||||
|
||||
while ((base = pc873xx_probelist[index++])) {
|
||||
|
||||
if (request_region(base, 2, "Super IO PC873xx") == NULL)
|
||||
continue;
|
||||
|
||||
val = pc873xx_read(base, REG_SID);
|
||||
if ((val & 0xf0) == 0x10) {
|
||||
model = PC87332;
|
||||
break;
|
||||
} else if ((val & 0xf8) == 0x70) {
|
||||
model = PC87306;
|
||||
break;
|
||||
} else if ((val & 0xf8) == 0x50) {
|
||||
model = PC87334;
|
||||
break;
|
||||
} else if ((val & 0xf8) == 0x40) {
|
||||
model = PC87303;
|
||||
break;
|
||||
}
|
||||
|
||||
release_region(base, 2);
|
||||
}
|
||||
|
||||
return (base == 0) ? -1 : 1;
|
||||
}
|
||||
|
||||
void __init pc873xx_enable_epp19(void)
|
||||
{
|
||||
unsigned char data;
|
||||
|
||||
printk(KERN_INFO "PC873xx enabling EPP v1.9\n");
|
||||
data = pc873xx_read(base, REG_PCR);
|
||||
pc873xx_write(base, REG_PCR, (data & 0xFC) | 0x02);
|
||||
}
|
||||
|
||||
void __init pc873xx_enable_ide(void)
|
||||
{
|
||||
unsigned char data;
|
||||
|
||||
printk(KERN_INFO "PC873xx enabling IDE interrupt\n");
|
||||
data = pc873xx_read(base, REG_FER);
|
||||
pc873xx_write(base, REG_FER, data | 0x40);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
#ifndef _PC873xx_H_
|
||||
#define _PC873xx_H_
|
||||
|
||||
/*
|
||||
* Control Register Values
|
||||
*/
|
||||
#define REG_FER 0x00
|
||||
#define REG_FAR 0x01
|
||||
#define REG_PTR 0x02
|
||||
#define REG_FCR 0x03
|
||||
#define REG_PCR 0x04
|
||||
#define REG_KRR 0x05
|
||||
#define REG_PMC 0x06
|
||||
#define REG_TUP 0x07
|
||||
#define REG_SID 0x08
|
||||
#define REG_ASC 0x09
|
||||
#define REG_IRC 0x0e
|
||||
|
||||
/*
|
||||
* Model numbers
|
||||
*/
|
||||
#define PC87303 0
|
||||
#define PC87306 1
|
||||
#define PC87312 2
|
||||
#define PC87332 3
|
||||
#define PC87334 4
|
||||
|
||||
int pc873xx_probe(void);
|
||||
unsigned int pc873xx_get_base(void);
|
||||
char *pc873xx_get_model(void);
|
||||
void pc873xx_enable_epp19(void);
|
||||
void pc873xx_enable_ide(void);
|
||||
|
||||
#endif
|
||||
@@ -53,7 +53,6 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,
|
||||
|
||||
/**
|
||||
* pci_mmap_resource - map a PCI resource into user memory space
|
||||
* @filp: open sysfs file
|
||||
* @kobj: kobject for mapping
|
||||
* @attr: struct bin_attribute for the file being mapped
|
||||
* @vma: struct vm_area_struct passed into the mmap
|
||||
@@ -61,7 +60,7 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,
|
||||
*
|
||||
* Use the bus mapping routines to map a PCI resource into userspace.
|
||||
*/
|
||||
static int pci_mmap_resource(struct file *filp, struct kobject *kobj,
|
||||
static int pci_mmap_resource(struct kobject *kobj,
|
||||
struct bin_attribute *attr,
|
||||
struct vm_area_struct *vma, int sparse)
|
||||
{
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "irq_impl.h"
|
||||
#include "pci_impl.h"
|
||||
#include "machvec_impl.h"
|
||||
#include "pc873xx.h"
|
||||
|
||||
#if defined(ALPHA_RESTORE_SRM_SETUP)
|
||||
/* Save LCA configuration data as the console had it set up. */
|
||||
@@ -208,7 +209,27 @@ noname_init_pci(void)
|
||||
common_init_pci();
|
||||
sio_pci_route();
|
||||
sio_fixup_irq_levels(sio_collect_irq_levels());
|
||||
ns87312_enable_ide(0x26e);
|
||||
|
||||
if (pc873xx_probe() == -1) {
|
||||
printk(KERN_ERR "Probing for PC873xx Super IO chip failed.\n");
|
||||
} else {
|
||||
printk(KERN_INFO "Found %s Super IO chip at 0x%x\n",
|
||||
pc873xx_get_model(), pc873xx_get_base());
|
||||
|
||||
/* Enabling things in the Super IO chip doesn't actually
|
||||
* configure and enable things, the legacy drivers still
|
||||
* need to do the actual configuration and enabling.
|
||||
* This only unblocks them.
|
||||
*/
|
||||
|
||||
#if !defined(CONFIG_ALPHA_AVANTI)
|
||||
/* Don't bother on the Avanti family.
|
||||
* None of them had on-board IDE.
|
||||
*/
|
||||
pc873xx_enable_ide();
|
||||
#endif
|
||||
pc873xx_enable_epp19();
|
||||
}
|
||||
}
|
||||
|
||||
static inline void __init
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Versatile Express Core Tile Cortex A9x4 Support
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
@@ -135,13 +135,6 @@ config DEBUGGER
|
||||
depends on KGDB || XMON
|
||||
default y
|
||||
|
||||
config IRQSTACKS
|
||||
bool "Use separate kernel stacks when processing interrupts"
|
||||
help
|
||||
If you say Y here the kernel will use separate kernel stacks
|
||||
for handling hard and soft interrupts. This can help avoid
|
||||
overflowing the process kernel stacks.
|
||||
|
||||
config VIRQ_DEBUG
|
||||
bool "Expose hardware/virtual IRQ mapping via debugfs"
|
||||
depends on DEBUG_FS
|
||||
|
||||
@@ -141,7 +141,7 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
|
||||
$(obj)/wrapper.a: $(obj-wlib) FORCE
|
||||
$(call if_changed,bootar)
|
||||
|
||||
hostprogs-y := addnote addRamDisk hack-coff mktree
|
||||
hostprogs-y := addnote hack-coff mktree
|
||||
|
||||
targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
|
||||
extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
|
||||
|
||||
@@ -1,311 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <netinet/in.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <elf.h>
|
||||
|
||||
#define ElfHeaderSize (64 * 1024)
|
||||
#define ElfPages (ElfHeaderSize / 4096)
|
||||
#define KERNELBASE (0xc000000000000000)
|
||||
#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1)))
|
||||
|
||||
struct addr_range {
|
||||
unsigned long long addr;
|
||||
unsigned long memsize;
|
||||
unsigned long offset;
|
||||
};
|
||||
|
||||
static int check_elf64(void *p, int size, struct addr_range *r)
|
||||
{
|
||||
Elf64_Ehdr *elf64 = p;
|
||||
Elf64_Phdr *elf64ph;
|
||||
|
||||
if (elf64->e_ident[EI_MAG0] != ELFMAG0 ||
|
||||
elf64->e_ident[EI_MAG1] != ELFMAG1 ||
|
||||
elf64->e_ident[EI_MAG2] != ELFMAG2 ||
|
||||
elf64->e_ident[EI_MAG3] != ELFMAG3 ||
|
||||
elf64->e_ident[EI_CLASS] != ELFCLASS64 ||
|
||||
elf64->e_ident[EI_DATA] != ELFDATA2MSB ||
|
||||
elf64->e_type != ET_EXEC || elf64->e_machine != EM_PPC64)
|
||||
return 0;
|
||||
|
||||
if ((elf64->e_phoff + sizeof(Elf64_Phdr)) > size)
|
||||
return 0;
|
||||
|
||||
elf64ph = (Elf64_Phdr *) ((unsigned long)elf64 +
|
||||
(unsigned long)elf64->e_phoff);
|
||||
|
||||
r->memsize = (unsigned long)elf64ph->p_memsz;
|
||||
r->offset = (unsigned long)elf64ph->p_offset;
|
||||
r->addr = (unsigned long long)elf64ph->p_vaddr;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("PPC64 ELF file, ph:\n");
|
||||
printf("p_type 0x%08x\n", elf64ph->p_type);
|
||||
printf("p_flags 0x%08x\n", elf64ph->p_flags);
|
||||
printf("p_offset 0x%016llx\n", elf64ph->p_offset);
|
||||
printf("p_vaddr 0x%016llx\n", elf64ph->p_vaddr);
|
||||
printf("p_paddr 0x%016llx\n", elf64ph->p_paddr);
|
||||
printf("p_filesz 0x%016llx\n", elf64ph->p_filesz);
|
||||
printf("p_memsz 0x%016llx\n", elf64ph->p_memsz);
|
||||
printf("p_align 0x%016llx\n", elf64ph->p_align);
|
||||
printf("... skipping 0x%08lx bytes of ELF header\n",
|
||||
(unsigned long)elf64ph->p_offset);
|
||||
#endif
|
||||
|
||||
return 64;
|
||||
}
|
||||
static void get4k(FILE *file, char *buf )
|
||||
{
|
||||
unsigned j;
|
||||
unsigned num = fread(buf, 1, 4096, file);
|
||||
for ( j=num; j<4096; ++j )
|
||||
buf[j] = 0;
|
||||
}
|
||||
|
||||
static void put4k(FILE *file, char *buf )
|
||||
{
|
||||
fwrite(buf, 1, 4096, file);
|
||||
}
|
||||
|
||||
static void death(const char *msg, FILE *fdesc, const char *fname)
|
||||
{
|
||||
fprintf(stderr, msg);
|
||||
fclose(fdesc);
|
||||
unlink(fname);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char inbuf[4096];
|
||||
struct addr_range vmlinux;
|
||||
FILE *ramDisk;
|
||||
FILE *inputVmlinux;
|
||||
FILE *outputVmlinux;
|
||||
|
||||
char *rd_name, *lx_name, *out_name;
|
||||
|
||||
size_t i;
|
||||
unsigned long ramFileLen;
|
||||
unsigned long ramLen;
|
||||
unsigned long roundR;
|
||||
unsigned long offset_end;
|
||||
|
||||
unsigned long kernelLen;
|
||||
unsigned long actualKernelLen;
|
||||
unsigned long round;
|
||||
unsigned long roundedKernelLen;
|
||||
unsigned long ramStartOffs;
|
||||
unsigned long ramPages;
|
||||
unsigned long roundedKernelPages;
|
||||
unsigned long hvReleaseData;
|
||||
u_int32_t eyeCatcher = 0xc8a5d9c4;
|
||||
unsigned long naca;
|
||||
unsigned long xRamDisk;
|
||||
unsigned long xRamDiskSize;
|
||||
long padPages;
|
||||
|
||||
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "Name of RAM disk file missing.\n");
|
||||
exit(1);
|
||||
}
|
||||
rd_name = argv[1];
|
||||
|
||||
if (argc < 3) {
|
||||
fprintf(stderr, "Name of vmlinux file missing.\n");
|
||||
exit(1);
|
||||
}
|
||||
lx_name = argv[2];
|
||||
|
||||
if (argc < 4) {
|
||||
fprintf(stderr, "Name of vmlinux output file missing.\n");
|
||||
exit(1);
|
||||
}
|
||||
out_name = argv[3];
|
||||
|
||||
|
||||
ramDisk = fopen(rd_name, "r");
|
||||
if ( ! ramDisk ) {
|
||||
fprintf(stderr, "RAM disk file \"%s\" failed to open.\n", rd_name);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
inputVmlinux = fopen(lx_name, "r");
|
||||
if ( ! inputVmlinux ) {
|
||||
fprintf(stderr, "vmlinux file \"%s\" failed to open.\n", lx_name);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
outputVmlinux = fopen(out_name, "w+");
|
||||
if ( ! outputVmlinux ) {
|
||||
fprintf(stderr, "output vmlinux file \"%s\" failed to open.\n", out_name);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
i = fread(inbuf, 1, sizeof(inbuf), inputVmlinux);
|
||||
if (i != sizeof(inbuf)) {
|
||||
fprintf(stderr, "can not read vmlinux file %s: %u\n", lx_name, i);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
i = check_elf64(inbuf, sizeof(inbuf), &vmlinux);
|
||||
if (i == 0) {
|
||||
fprintf(stderr, "You must have a linux kernel specified as argv[2]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Input Vmlinux file */
|
||||
fseek(inputVmlinux, 0, SEEK_END);
|
||||
kernelLen = ftell(inputVmlinux);
|
||||
fseek(inputVmlinux, 0, SEEK_SET);
|
||||
printf("kernel file size = %lu\n", kernelLen);
|
||||
|
||||
actualKernelLen = kernelLen - ElfHeaderSize;
|
||||
|
||||
printf("actual kernel length (minus ELF header) = %lu\n", actualKernelLen);
|
||||
|
||||
round = actualKernelLen % 4096;
|
||||
roundedKernelLen = actualKernelLen;
|
||||
if ( round )
|
||||
roundedKernelLen += (4096 - round);
|
||||
printf("Vmlinux length rounded up to a 4k multiple = %ld/0x%lx \n", roundedKernelLen, roundedKernelLen);
|
||||
roundedKernelPages = roundedKernelLen / 4096;
|
||||
printf("Vmlinux pages to copy = %ld/0x%lx \n", roundedKernelPages, roundedKernelPages);
|
||||
|
||||
offset_end = _ALIGN_UP(vmlinux.memsize, 4096);
|
||||
/* calc how many pages we need to insert between the vmlinux and the start of the ram disk */
|
||||
padPages = offset_end/4096 - roundedKernelPages;
|
||||
|
||||
/* Check and see if the vmlinux is already larger than _end in System.map */
|
||||
if (padPages < 0) {
|
||||
/* vmlinux is larger than _end - adjust the offset to the start of the embedded ram disk */
|
||||
offset_end = roundedKernelLen;
|
||||
printf("vmlinux is larger than _end indicates it needs to be - offset_end = %lx \n", offset_end);
|
||||
padPages = 0;
|
||||
printf("will insert %lx pages between the vmlinux and the start of the ram disk \n", padPages);
|
||||
}
|
||||
else {
|
||||
/* _end is larger than vmlinux - use the offset to _end that we calculated from the system map */
|
||||
printf("vmlinux is smaller than _end indicates is needed - offset_end = %lx \n", offset_end);
|
||||
printf("will insert %lx pages between the vmlinux and the start of the ram disk \n", padPages);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Input Ram Disk file */
|
||||
// Set the offset that the ram disk will be started at.
|
||||
ramStartOffs = offset_end; /* determined from the input vmlinux file and the system map */
|
||||
printf("Ram Disk will start at offset = 0x%lx \n", ramStartOffs);
|
||||
|
||||
fseek(ramDisk, 0, SEEK_END);
|
||||
ramFileLen = ftell(ramDisk);
|
||||
fseek(ramDisk, 0, SEEK_SET);
|
||||
printf("%s file size = %ld/0x%lx \n", rd_name, ramFileLen, ramFileLen);
|
||||
|
||||
ramLen = ramFileLen;
|
||||
|
||||
roundR = 4096 - (ramLen % 4096);
|
||||
if ( roundR ) {
|
||||
printf("Rounding RAM disk file up to a multiple of 4096, adding %ld/0x%lx \n", roundR, roundR);
|
||||
ramLen += roundR;
|
||||
}
|
||||
|
||||
printf("Rounded RAM disk size is %ld/0x%lx \n", ramLen, ramLen);
|
||||
ramPages = ramLen / 4096;
|
||||
printf("RAM disk pages to copy = %ld/0x%lx\n", ramPages, ramPages);
|
||||
|
||||
|
||||
|
||||
// Copy 64K ELF header
|
||||
for (i=0; i<(ElfPages); ++i) {
|
||||
get4k( inputVmlinux, inbuf );
|
||||
put4k( outputVmlinux, inbuf );
|
||||
}
|
||||
|
||||
/* Copy the vmlinux (as full pages). */
|
||||
fseek(inputVmlinux, ElfHeaderSize, SEEK_SET);
|
||||
for ( i=0; i<roundedKernelPages; ++i ) {
|
||||
get4k( inputVmlinux, inbuf );
|
||||
put4k( outputVmlinux, inbuf );
|
||||
}
|
||||
|
||||
/* Insert pad pages (if appropriate) that are needed between */
|
||||
/* | the end of the vmlinux and the ram disk. */
|
||||
for (i=0; i<padPages; ++i) {
|
||||
memset(inbuf, 0, 4096);
|
||||
put4k(outputVmlinux, inbuf);
|
||||
}
|
||||
|
||||
/* Copy the ram disk (as full pages). */
|
||||
for ( i=0; i<ramPages; ++i ) {
|
||||
get4k( ramDisk, inbuf );
|
||||
put4k( outputVmlinux, inbuf );
|
||||
}
|
||||
|
||||
/* Close the input files */
|
||||
fclose(ramDisk);
|
||||
fclose(inputVmlinux);
|
||||
/* And flush the written output file */
|
||||
fflush(outputVmlinux);
|
||||
|
||||
|
||||
|
||||
/* Fixup the new vmlinux to contain the ram disk starting offset (xRamDisk) and the ram disk size (xRamDiskSize) */
|
||||
/* fseek to the hvReleaseData pointer */
|
||||
fseek(outputVmlinux, ElfHeaderSize + 0x24, SEEK_SET);
|
||||
if (fread(&hvReleaseData, 4, 1, outputVmlinux) != 1) {
|
||||
death("Could not read hvReleaseData pointer\n", outputVmlinux, out_name);
|
||||
}
|
||||
hvReleaseData = ntohl(hvReleaseData); /* Convert to native int */
|
||||
printf("hvReleaseData is at %08lx\n", hvReleaseData);
|
||||
|
||||
/* fseek to the hvReleaseData */
|
||||
fseek(outputVmlinux, ElfHeaderSize + hvReleaseData, SEEK_SET);
|
||||
if (fread(inbuf, 0x40, 1, outputVmlinux) != 1) {
|
||||
death("Could not read hvReleaseData\n", outputVmlinux, out_name);
|
||||
}
|
||||
/* Check hvReleaseData sanity */
|
||||
if (memcmp(inbuf, &eyeCatcher, 4) != 0) {
|
||||
death("hvReleaseData is invalid\n", outputVmlinux, out_name);
|
||||
}
|
||||
/* Get the naca pointer */
|
||||
naca = ntohl(*((u_int32_t*) &inbuf[0x0C])) - KERNELBASE;
|
||||
printf("Naca is at offset 0x%lx \n", naca);
|
||||
|
||||
/* fseek to the naca */
|
||||
fseek(outputVmlinux, ElfHeaderSize + naca, SEEK_SET);
|
||||
if (fread(inbuf, 0x18, 1, outputVmlinux) != 1) {
|
||||
death("Could not read naca\n", outputVmlinux, out_name);
|
||||
}
|
||||
xRamDisk = ntohl(*((u_int32_t *) &inbuf[0x0c]));
|
||||
xRamDiskSize = ntohl(*((u_int32_t *) &inbuf[0x14]));
|
||||
/* Make sure a RAM disk isn't already present */
|
||||
if ((xRamDisk != 0) || (xRamDiskSize != 0)) {
|
||||
death("RAM disk is already attached to this kernel\n", outputVmlinux, out_name);
|
||||
}
|
||||
/* Fill in the values */
|
||||
*((u_int32_t *) &inbuf[0x0c]) = htonl(ramStartOffs);
|
||||
*((u_int32_t *) &inbuf[0x14]) = htonl(ramPages);
|
||||
|
||||
/* Write out the new naca */
|
||||
fflush(outputVmlinux);
|
||||
fseek(outputVmlinux, ElfHeaderSize + naca, SEEK_SET);
|
||||
if (fwrite(inbuf, 0x18, 1, outputVmlinux) != 1) {
|
||||
death("Could not write naca\n", outputVmlinux, out_name);
|
||||
}
|
||||
printf("Ram Disk of 0x%lx pages is attached to the kernel at offset 0x%08lx\n",
|
||||
ramPages, ramStartOffs);
|
||||
|
||||
/* Done */
|
||||
fclose(outputVmlinux);
|
||||
/* Set permission to executable */
|
||||
chmod(out_name, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -134,12 +134,16 @@
|
||||
compatible = "fsl,mpc5200-gpio";
|
||||
reg = <0xb00 0x40>;
|
||||
interrupts = <1 7 0>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
};
|
||||
|
||||
gpio@c00 {
|
||||
compatible = "fsl,mpc5200-gpio-wkup";
|
||||
reg = <0xc00 0x40>;
|
||||
interrupts = <1 8 0 0 3 0>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
};
|
||||
|
||||
spi@f00 {
|
||||
@@ -230,8 +234,8 @@
|
||||
reg = <0x3000 0x400>; // fec range, since we need to setup fec interrupts
|
||||
interrupts = <2 5 0>; // these are for "mii command finished", not link changes & co.
|
||||
|
||||
phy0: ethernet-phy@1 {
|
||||
reg = <1>;
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -255,7 +259,13 @@
|
||||
compatible = "fsl,mpc5200-i2c","fsl-i2c";
|
||||
reg = <0x3d40 0x40>;
|
||||
interrupts = <2 16 0>;
|
||||
|
||||
eeprom@50 {
|
||||
compatible = "atmel,24c02";
|
||||
reg = <0x50>;
|
||||
};
|
||||
};
|
||||
|
||||
sram@8000 {
|
||||
compatible = "fsl,mpc5200-sram";
|
||||
reg = <0x8000 0x4000>;
|
||||
@@ -281,4 +291,18 @@
|
||||
0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
|
||||
0x01000000 0 0x00000000 0xb0000000 0 0x01000000>;
|
||||
};
|
||||
|
||||
localbus {
|
||||
compatible = "fsl,mpc5200-lpb","simple-bus";
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
|
||||
ranges = <0 0 0xff000000 0x01000000>;
|
||||
|
||||
flash@0,0 {
|
||||
compatible = "amd,am29lv652d", "cfi-flash";
|
||||
reg = <0 0 0x01000000>;
|
||||
bank-width = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -259,6 +259,11 @@
|
||||
compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
|
||||
reg = <0x3d40 0x40>;
|
||||
interrupts = <2 16 0>;
|
||||
|
||||
eeprom@50 {
|
||||
compatible = "atmel,24c02";
|
||||
reg = <0x50>;
|
||||
};
|
||||
};
|
||||
|
||||
sram@8000 {
|
||||
|
||||
@@ -98,8 +98,7 @@ CONFIG_GROUP_SCHED=y
|
||||
CONFIG_USER_SCHED=y
|
||||
# CONFIG_CGROUP_SCHED is not set
|
||||
# CONFIG_CGROUPS is not set
|
||||
CONFIG_SYSFS_DEPRECATED=y
|
||||
CONFIG_SYSFS_DEPRECATED_V2=y
|
||||
# CONFIG_SYSFS_DEPRECATED_V2 is not set
|
||||
# CONFIG_RELAY is not set
|
||||
# CONFIG_NAMESPACES is not set
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
|
||||
@@ -98,8 +98,7 @@ CONFIG_FAIR_GROUP_SCHED=y
|
||||
CONFIG_USER_SCHED=y
|
||||
# CONFIG_CGROUP_SCHED is not set
|
||||
# CONFIG_CGROUPS is not set
|
||||
CONFIG_SYSFS_DEPRECATED=y
|
||||
CONFIG_SYSFS_DEPRECATED_V2=y
|
||||
# CONFIG_SYSFS_DEPRECATED_V2 is not set
|
||||
# CONFIG_RELAY is not set
|
||||
# CONFIG_NAMESPACES is not set
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
|
||||
@@ -98,8 +98,7 @@ CONFIG_FAIR_GROUP_SCHED=y
|
||||
CONFIG_USER_SCHED=y
|
||||
# CONFIG_CGROUP_SCHED is not set
|
||||
# CONFIG_CGROUPS is not set
|
||||
CONFIG_SYSFS_DEPRECATED=y
|
||||
CONFIG_SYSFS_DEPRECATED_V2=y
|
||||
# CONFIG_SYSFS_DEPRECATED_V2 is not set
|
||||
# CONFIG_RELAY is not set
|
||||
# CONFIG_NAMESPACES is not set
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
|
||||
@@ -98,8 +98,7 @@ CONFIG_GROUP_SCHED=y
|
||||
CONFIG_USER_SCHED=y
|
||||
# CONFIG_CGROUP_SCHED is not set
|
||||
# CONFIG_CGROUPS is not set
|
||||
CONFIG_SYSFS_DEPRECATED=y
|
||||
CONFIG_SYSFS_DEPRECATED_V2=y
|
||||
# CONFIG_SYSFS_DEPRECATED_V2 is not set
|
||||
# CONFIG_RELAY is not set
|
||||
# CONFIG_NAMESPACES is not set
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user