Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74897
b: refs/heads/master
c: 1457edc
h: refs/heads/master
i:
  74895: 98ff546
v: v3
  • Loading branch information
Joachim Fenkes authored and Roland Dreier committed Dec 12, 2007
1 parent 5fbd5ba commit 36cd44a
Show file tree
Hide file tree
Showing 77 changed files with 366 additions and 401 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: a12e60621b553e32711f9ad653aad3c92881c400
refs/heads/master: 1457edc72d187f452be1374c7d9281f1dfa16f32
45 changes: 41 additions & 4 deletions trunk/Documentation/i2c/summary
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
This is an explanation of what i2c is, and what is supported in this package.

I2C and SMBus
=============

Expand Down Expand Up @@ -31,17 +33,52 @@ When we talk about I2C, we use the following terms:
Client

An Algorithm driver contains general code that can be used for a whole class
of I2C adapters. Each specific adapter driver either depends on one algorithm
driver, or includes its own implementation.
of I2C adapters. Each specific adapter driver depends on one algorithm
driver.

A Driver driver (yes, this sounds ridiculous, sorry) contains the general
code to access some type of device. Each detected device gets its own
data in the Client structure. Usually, Driver and Client are more closely
integrated than Algorithm and Adapter.

For a given configuration, you will need a driver for your I2C bus, and
drivers for your I2C devices (usually one driver for each device).
For a given configuration, you will need a driver for your I2C bus (usually
a separate Adapter and Algorithm driver), and drivers for your I2C devices
(usually one driver for each device). There are no I2C device drivers
in this package. See the lm_sensors project http://www.lm-sensors.nu
for device drivers.

At this time, Linux only operates I2C (or SMBus) in master mode; you can't
use these APIs to make a Linux system behave as a slave/device, either to
speak a custom protocol or to emulate some other device.


Included Bus Drivers
====================
Note that only stable drivers are patched into the kernel by 'mkpatch'.


Base modules
------------

i2c-core: The basic I2C code, including the /proc/bus/i2c* interface
i2c-dev: The /dev/i2c-* interface
i2c-proc: The /proc/sys/dev/sensors interface for device (client) drivers

Algorithm drivers
-----------------

i2c-algo-bit: A bit-banging algorithm
i2c-algo-pcf: A PCF 8584 style algorithm
i2c-algo-ibm_ocp: An algorithm for the I2C device in IBM 4xx processors (NOT BUILT BY DEFAULT)

Adapter drivers
---------------

i2c-elektor: Elektor ISA card (uses i2c-algo-pcf)
i2c-elv: ELV parallel port adapter (uses i2c-algo-bit)
i2c-pcf-epp: PCF8584 on a EPP parallel port (uses i2c-algo-pcf) (NOT mkpatched)
i2c-philips-par: Philips style parallel port adapter (uses i2c-algo-bit)
i2c-adap-ibm_ocp: IBM 4xx processor I2C device (uses i2c-algo-ibm_ocp) (NOT BUILT BY DEFAULT)
i2c-pport: Primitive parallel port adapter (uses i2c-algo-bit)
i2c-velleman: Velleman K8000 parallel port adapter (uses i2c-algo-bit)

12 changes: 3 additions & 9 deletions trunk/Documentation/nfsroot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,8 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
autoconfiguration.

The <autoconf> parameter can appear alone as the value to the `ip'
parameter (without all the ':' characters before). If the value is
"ip=off" or "ip=none", no autoconfiguration will take place, otherwise
autoconfiguration will take place. The most common way to use this
is "ip=dhcp".

Note that "ip=off" is not the same thing as "ip=::::::off", because in
the latter autoconfiguration will take place if any of DHCP, BOOTP or RARP
are compiled in the kernel.
parameter (without all the ':' characters before) in which case auto-
configuration is used.

<client-ip> IP address of the client.

Expand Down Expand Up @@ -148,7 +142,7 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
into the kernel will be used, regardless of the value of
this option.

off or none: don't use autoconfiguration
off or none: don't use autoconfiguration (default)
on or any: use any protocol available in the kernel
dhcp: use DHCP
bootp: use BOOTP
Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ config ISA_DMA_API
bool

config PCI
bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB || ARCH_IXP4XX || ARCH_KS8695 || MACH_ARMCORE
bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB || ARCH_IXP4XX || ARCH_KS8695
help
Find out whether you have a PCI motherboard. PCI is the name of a
bus system, i.e. the way the CPU talks to the other stuff inside
Expand All @@ -558,12 +558,6 @@ config PCI_HOST_VIA82C505
depends on PCI && ARCH_SHARK
default y

config PCI_HOST_ITE8152
bool
depends on PCI && MACH_ARMCORE
default y
select DMABOUNCE

source "drivers/pci/Kconfig"

source "drivers/pcmcia/Kconfig"
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/boot/compressed/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
.macro loadsp, rb
.endm
.macro writeb, ch, rb
mcr p14, 0, \ch, c1, c0, 0
mcr p14, 0, \ch, c0, c1, 0
.endm
#endif

Expand Down
10 changes: 8 additions & 2 deletions trunk/arch/arm/common/it8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ static inline void it8152_irq(int irq)
{
struct irq_desc *desc;

printk(KERN_DEBUG "===> %s: irq=%d\n", __FUNCTION__, irq);

desc = irq_desc + irq;
desc_handle_irq(irq, desc);
}
Expand Down Expand Up @@ -104,6 +106,8 @@ void it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
int bits_pd, bits_lp, bits_ld;
int i;

printk(KERN_DEBUG "=> %s: irq = %d\n", __FUNCTION__, irq);

while (1) {
/* Read all */
bits_pd = __raw_readl(IT8152_INTC_PDCNIRR);
Expand Down Expand Up @@ -289,7 +293,8 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
*/
int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
{
dev_dbg(&dev->dev, "%s: %llx\n", __FUNCTION__, mask);
printk(KERN_DEBUG "%s: %s %llx\n",
__FUNCTION__, dev->dev.bus_id, mask);
if (mask >= PHYS_OFFSET + SZ_64M - 1)
return 0;

Expand All @@ -299,7 +304,8 @@ int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
int
pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
{
dev_dbg(&dev->dev, "%s: %llx\n", __FUNCTION__, mask);
printk(KERN_DEBUG "%s: %s %llx\n",
__FUNCTION__, dev->dev.bus_id, mask);
if (mask >= PHYS_OFFSET + SZ_64M - 1)
return 0;

Expand Down
10 changes: 3 additions & 7 deletions trunk/arch/arm/mach-ixp4xx/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,7 @@ static int ixp4xx_set_next_event(unsigned long evt,
static void ixp4xx_set_mode(enum clock_event_mode mode,
struct clock_event_device *evt)
{
unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK;
unsigned long osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK;
unsigned long opts, osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK;

switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
Expand All @@ -456,15 +455,12 @@ static void ixp4xx_set_mode(enum clock_event_mode mode,
opts = IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT;
break;
case CLOCK_EVT_MODE_SHUTDOWN:
opts &= ~IXP4XX_OST_ENABLE;
break;
case CLOCK_EVT_MODE_RESUME:
opts |= IXP4XX_OST_ENABLE;
break;
case CLOCK_EVT_MODE_UNUSED:
default:
osrt = opts = 0;
break;
case CLOCK_EVT_MODE_RESUME:
break;
}

*IXP4XX_OSRT1 = osrt | opts;
Expand Down
18 changes: 10 additions & 8 deletions trunk/arch/arm/mach-pxa/cm-x270-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size,
{
unsigned int sz = SZ_64M >> PAGE_SHIFT;

pr_info("Adjusting zones for CM-x270\n");
printk(KERN_INFO "Adjusting zones for CM-x270\n");

/*
* Only adjust if > 64M on current system
Expand Down Expand Up @@ -104,7 +104,8 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
int irq;

dev_dbg(&dev->dev, "%s: slot=%x, pin=%x\n", __FUNCTION__, slot, pin);
printk(KERN_DEBUG "===> %s: %s slot=%x, pin=%x\n", __FUNCTION__,
pci_name(dev), slot, pin);

irq = it8152_pci_map_irq(dev, slot, pin);
if (irq)
Expand Down Expand Up @@ -140,13 +141,14 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
return(0);
}

static void cmx270_pci_preinit(void)
static struct pci_bus * __init
cmx270_pci_scan_bus(int nr, struct pci_sys_data *sys)
{
pr_info("Initializing CM-X270 PCI subsystem\n");
printk(KERN_INFO "Initializing CM-X270 PCI subsystem\n");

__raw_writel(0x800, IT8152_PCI_CFG_ADDR);
if (__raw_readl(IT8152_PCI_CFG_DATA) == 0x81521283) {
pr_info("PCI Bridge found.\n");
printk(KERN_INFO "PCI Bridge found.\n");

/* set PCI I/O base at 0 */
writel(0x848, IT8152_PCI_CFG_ADDR);
Expand All @@ -161,7 +163,7 @@ static void cmx270_pci_preinit(void)
/* CardBus Controller on ATXbase baseboard */
writel(0x4000, IT8152_PCI_CFG_ADDR);
if (readl(IT8152_PCI_CFG_DATA) == 0xAC51104C) {
pr_info("CardBus Bridge found.\n");
printk(KERN_INFO "CardBus Bridge found.\n");

/* Configure socket 0 */
writel(0x408C, IT8152_PCI_CFG_ADDR);
Expand Down Expand Up @@ -194,15 +196,15 @@ static void cmx270_pci_preinit(void)
writel(0xb0000000, IT8152_PCI_CFG_DATA);
}
}
return it8152_pci_scan_bus(nr, sys);
}

static struct hw_pci cmx270_pci __initdata = {
.swizzle = pci_std_swizzle,
.map_irq = cmx270_pci_map_irq,
.nr_controllers = 1,
.setup = it8152_pci_setup,
.scan = it8152_pci_scan_bus,
.preinit = cmx270_pci_preinit,
.scan = cmx270_pci_scan_bus,
};

static int __init cmx270_init_pci(void)
Expand Down
9 changes: 9 additions & 0 deletions trunk/arch/mips/au1000/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ config MIPS_MTX1
bool "4G Systems MTX-1 board"
select DMA_NONCOHERENT
select HW_HAS_PCI
select RESOURCES_64BIT if PCI
select SOC_AU1500
select SYS_SUPPORTS_LITTLE_ENDIAN

Expand All @@ -21,6 +22,7 @@ config MIPS_DB1000
select SOC_AU1000
select DMA_NONCOHERENT
select HW_HAS_PCI
select RESOURCES_64BIT if PCI
select SYS_SUPPORTS_LITTLE_ENDIAN

config MIPS_DB1100
Expand All @@ -42,6 +44,7 @@ config MIPS_DB1500
select DMA_NONCOHERENT
select HW_HAS_PCI
select MIPS_DISABLE_OBSOLETE_IDE
select RESOURCES_64BIT if PCI
select SYS_SUPPORTS_BIG_ENDIAN
select SYS_SUPPORTS_LITTLE_ENDIAN

Expand All @@ -51,6 +54,7 @@ config MIPS_DB1550
select HW_HAS_PCI
select DMA_NONCOHERENT
select MIPS_DISABLE_OBSOLETE_IDE
select RESOURCES_64BIT if PCI
select SYS_SUPPORTS_LITTLE_ENDIAN

config MIPS_MIRAGE
Expand All @@ -64,6 +68,7 @@ config MIPS_PB1000
select SOC_AU1000
select DMA_NONCOHERENT
select HW_HAS_PCI
select RESOURCES_64BIT if PCI
select SWAP_IO_SPACE
select SYS_SUPPORTS_LITTLE_ENDIAN

Expand All @@ -72,6 +77,7 @@ config MIPS_PB1100
select SOC_AU1100
select DMA_NONCOHERENT
select HW_HAS_PCI
select RESOURCES_64BIT if PCI
select SWAP_IO_SPACE
select SYS_SUPPORTS_LITTLE_ENDIAN

Expand All @@ -80,13 +86,15 @@ config MIPS_PB1200
select SOC_AU1200
select DMA_NONCOHERENT
select MIPS_DISABLE_OBSOLETE_IDE
select RESOURCES_64BIT if PCI
select SYS_SUPPORTS_LITTLE_ENDIAN

config MIPS_PB1500
bool "Alchemy PB1500 board"
select SOC_AU1500
select DMA_NONCOHERENT
select HW_HAS_PCI
select RESOURCES_64BIT if PCI
select SYS_SUPPORTS_LITTLE_ENDIAN

config MIPS_PB1550
Expand All @@ -95,6 +103,7 @@ config MIPS_PB1550
select DMA_NONCOHERENT
select HW_HAS_PCI
select MIPS_DISABLE_OBSOLETE_IDE
select RESOURCES_64BIT if PCI
select SYS_SUPPORTS_LITTLE_ENDIAN

config MIPS_XXS1500
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/mips/au1000/common/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@

/* TBD */
static struct resource pci_io_resource = {
.start = PCI_IO_START,
.end = PCI_IO_END,
.start = (resource_size_t)PCI_IO_START,
.end = (resource_size_t)PCI_IO_END,
.name = "PCI IO space",
.flags = IORESOURCE_IO
};

static struct resource pci_mem_resource = {
.start = PCI_MEM_START,
.end = PCI_MEM_END,
.start = (resource_size_t)PCI_MEM_START,
.end = (resource_size_t)PCI_MEM_END,
.name = "PCI memory space",
.flags = IORESOURCE_MEM
};
Expand Down
9 changes: 5 additions & 4 deletions trunk/arch/mips/au1000/common/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)

#ifdef CONFIG_PCI
{
u32 start = (u32)Au1500_PCI_MEM_START;
u32 end = (u32)Au1500_PCI_MEM_END;
u32 start, end;

/* Check for PCI memory window */
if (phys_addr >= start && (phys_addr + size - 1) <= end)
start = (u32)Au1500_PCI_MEM_START;
end = (u32)Au1500_PCI_MEM_END;
/* check for pci memory window */
if ((phys_addr >= start) && ((phys_addr + size) < end))
return (phys_t)
((phys_addr - start) + Au1500_PCI_MEM_START);
}
Expand Down
21 changes: 1 addition & 20 deletions trunk/arch/mips/cobalt/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,9 @@

void __init plat_time_init(void)
{
u32 start, end;
int i = HZ / 10;

setup_pit_timer();

gt641xx_set_base_clock(GT641XX_BASE_CLOCK);

/*
* MIPS counter frequency is measured during a 100msec interval
* using GT64111 timer0.
*/
while (!gt641xx_timer0_state())
;

start = read_c0_count();

while (i--)
while (!gt641xx_timer0_state())
;

end = read_c0_count();

mips_hpt_frequency = (end - start) * 10;
printk(KERN_INFO "MIPS counter frequency %dHz\n", mips_hpt_frequency);
mips_timer_state = gt641xx_timer0_state;
}
Loading

0 comments on commit 36cd44a

Please sign in to comment.