Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118259
b: refs/heads/master
c: 1fe01cb
h: refs/heads/master
i:
  118257: 65a3e93
  118255: 37490ed
v: v3
  • Loading branch information
Linus Torvalds committed Oct 31, 2008
1 parent 0431450 commit f14d2f2
Show file tree
Hide file tree
Showing 16 changed files with 296 additions and 241 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: 216813a8bb4db97eb7a6e75c533894430053df48
refs/heads/master: 1fe01cb57c6272577ebb107a03253484f6dabe7c
22 changes: 8 additions & 14 deletions trunk/arch/sparc/include/asm/byteorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
#include <asm/types.h>
#include <asm/asi.h>

#ifdef __GNUC__
#define __BIG_ENDIAN

#ifdef CONFIG_SPARC32
#define __SWAB_64_THRU_32__
#endif

#ifdef CONFIG_SPARC64

static inline __u16 ___arch__swab16p(const __u16 *addr)
static inline __u16 __arch_swab16p(const __u16 *addr)
{
__u16 ret;

Expand All @@ -21,8 +20,9 @@ static inline __u16 ___arch__swab16p(const __u16 *addr)
: "r" (addr), "i" (ASI_PL));
return ret;
}
#define __arch_swab16p __arch_swab16p

static inline __u32 ___arch__swab32p(const __u32 *addr)
static inline __u32 __arch_swab32p(const __u32 *addr)
{
__u32 ret;

Expand All @@ -31,8 +31,9 @@ static inline __u32 ___arch__swab32p(const __u32 *addr)
: "r" (addr), "i" (ASI_PL));
return ret;
}
#define __arch_swab32p __arch_swab32p

static inline __u64 ___arch__swab64p(const __u64 *addr)
static inline __u64 __arch_swab64p(const __u64 *addr)
{
__u64 ret;

Expand All @@ -41,17 +42,10 @@ static inline __u64 ___arch__swab64p(const __u64 *addr)
: "r" (addr), "i" (ASI_PL));
return ret;
}

#define __arch__swab16p(x) ___arch__swab16p(x)
#define __arch__swab32p(x) ___arch__swab32p(x)
#define __arch__swab64p(x) ___arch__swab64p(x)
#define __arch_swab64p __arch_swab64p

#endif /* CONFIG_SPARC64 */

#define __BYTEORDER_HAS_U64__

#endif

#include <linux/byteorder/big_endian.h>
#include <linux/byteorder.h>

#endif /* _SPARC_BYTEORDER_H */
27 changes: 4 additions & 23 deletions trunk/arch/sparc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,35 +119,16 @@ static unsigned char mostek_read_byte(struct device *dev, u32 ofs)
{
struct platform_device *pdev = to_platform_device(dev);
struct m48t59_plat_data *pdata = pdev->dev.platform_data;
void __iomem *regs = pdata->ioaddr;
unsigned char val = readb(regs + ofs);

/* the year 0 is 1968 */
if (ofs == pdata->offset + M48T59_YEAR) {
val += 0x68;
if ((val & 0xf) > 9)
val += 6;
}
return val;

return readb(pdata->ioaddr + ofs);
}

static void mostek_write_byte(struct device *dev, u32 ofs, u8 val)
{
struct platform_device *pdev = to_platform_device(dev);
struct m48t59_plat_data *pdata = pdev->dev.platform_data;
void __iomem *regs = pdata->ioaddr;

if (ofs == pdata->offset + M48T59_YEAR) {
if (val < 0x68)
val += 0x32;
else
val -= 0x68;
if ((val & 0xf) > 9)
val += 6;
if ((val & 0xf0) > 0x9A)
val += 0x60;
}
writeb(val, regs + ofs);

writeb(val, pdata->ioaddr + ofs);
}

static struct m48t59_plat_data m48t59_data = {
Expand Down
34 changes: 6 additions & 28 deletions trunk/arch/sparc64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ static struct of_device_id __initdata bq4802_match[] = {
.name = "rtc",
.compatible = "bq4802",
},
{},
};

static struct of_platform_driver bq4802_driver = {
Expand All @@ -503,39 +504,16 @@ static struct of_platform_driver bq4802_driver = {
static unsigned char mostek_read_byte(struct device *dev, u32 ofs)
{
struct platform_device *pdev = to_platform_device(dev);
struct m48t59_plat_data *pdata = pdev->dev.platform_data;
void __iomem *regs;
unsigned char val;

regs = (void __iomem *) pdev->resource[0].start;
val = readb(regs + ofs);

/* the year 0 is 1968 */
if (ofs == pdata->offset + M48T59_YEAR) {
val += 0x68;
if ((val & 0xf) > 9)
val += 6;
}
return val;
void __iomem *regs = (void __iomem *) pdev->resource[0].start;

return readb(regs + ofs);
}

static void mostek_write_byte(struct device *dev, u32 ofs, u8 val)
{
struct platform_device *pdev = to_platform_device(dev);
struct m48t59_plat_data *pdata = pdev->dev.platform_data;
void __iomem *regs;

regs = (void __iomem *) pdev->resource[0].start;
if (ofs == pdata->offset + M48T59_YEAR) {
if (val < 0x68)
val += 0x32;
else
val -= 0x68;
if ((val & 0xf) > 9)
val += 6;
if ((val & 0xf0) > 0x9A)
val += 0x60;
}
void __iomem *regs = (void __iomem *) pdev->resource[0].start;

writeb(val, regs + ofs);
}

Expand Down
139 changes: 47 additions & 92 deletions trunk/arch/sparc64/lib/PeeCeeI.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,107 +20,62 @@ void outsw(unsigned long __addr, const void *src, unsigned long count)
{
void __iomem *addr = (void __iomem *) __addr;

if (count) {
u16 *ps = (u16 *)src;
u32 *pi;

if (((u64)src) & 0x2) {
u16 val = le16_to_cpup(ps);
outw(val, addr);
ps++;
count--;
}
pi = (u32 *)ps;
while (count >= 2) {
u32 w = le32_to_cpup(pi);

pi++;
outw(w >> 0, addr);
outw(w >> 16, addr);
count -= 2;
}
ps = (u16 *)pi;
if (count) {
u16 val = le16_to_cpup(ps);
outw(val, addr);
}
while (count--) {
__raw_writew(*(u16 *)src, addr);
src += sizeof(u16);
}
}

void outsl(unsigned long __addr, const void *src, unsigned long count)
{
void __iomem *addr = (void __iomem *) __addr;
u32 l, l2;

if (count) {
if ((((u64)src) & 0x3) == 0) {
u32 *p = (u32 *)src;
while (count--) {
u32 val = cpu_to_le32p(p);
outl(val, addr);
p++;
}
} else {
u8 *pb;
u16 *ps = (u16 *)src;
u32 l = 0, l2;
u32 *pi;

switch (((u64)src) & 0x3) {
case 0x2:
count -= 1;
l = cpu_to_le16p(ps) << 16;
ps++;
pi = (u32 *)ps;
while (count--) {
l2 = cpu_to_le32p(pi);
pi++;
outl(((l >> 16) | (l2 << 16)), addr);
l = l2;
}
ps = (u16 *)pi;
l2 = cpu_to_le16p(ps);
outl(((l >> 16) | (l2 << 16)), addr);
break;

case 0x1:
count -= 1;
pb = (u8 *)src;
l = (*pb++ << 8);
ps = (u16 *)pb;
l2 = cpu_to_le16p(ps);
ps++;
l |= (l2 << 16);
pi = (u32 *)ps;
while (count--) {
l2 = cpu_to_le32p(pi);
pi++;
outl(((l >> 8) | (l2 << 24)), addr);
l = l2;
}
pb = (u8 *)pi;
outl(((l >> 8) | (*pb << 24)), addr);
break;
if (!count)
return;

case 0x3:
count -= 1;
pb = (u8 *)src;
l = (*pb++ << 24);
pi = (u32 *)pb;
while (count--) {
l2 = cpu_to_le32p(pi);
pi++;
outl(((l >> 24) | (l2 << 8)), addr);
l = l2;
}
ps = (u16 *)pi;
l2 = cpu_to_le16p(ps);
ps++;
pb = (u8 *)ps;
l2 |= (*pb << 16);
outl(((l >> 24) | (l2 << 8)), addr);
break;
}
switch (((unsigned long)src) & 0x3) {
case 0x0:
/* src is naturally aligned */
while (count--) {
__raw_writel(*(u32 *)src, addr);
src += sizeof(u32);
}
break;
case 0x2:
/* 2-byte alignment */
while (count--) {
l = (*(u16 *)src) << 16;
l |= *(u16 *)(src + sizeof(u16));
__raw_writel(l, addr);
src += sizeof(u32);
}
break;
case 0x1:
/* Hold three bytes in l each time, grab a byte from l2 */
l = (*(u8 *)src) << 24;
l |= (*(u16 *)(src + sizeof(u8))) << 8;
src += sizeof(u8) + sizeof(u16);
while (count--) {
l2 = *(u32 *)src;
l |= (l2 >> 24);
__raw_writel(l, addr);
l = l2 << 8;
src += sizeof(u32);
}
break;
case 0x3:
/* Hold a byte in l each time, grab 3 bytes from l2 */
l = (*(u8 *)src) << 24;
src += sizeof(u8);
while (count--) {
l2 = *(u32 *)src;
l |= (l2 >> 8);
__raw_writel(l, addr);
l = l2 << 24;
src += sizeof(u32);
}
break;
}
}

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/ata/ata_piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,6 @@ static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev)
* do_pata_set_dmamode - Initialize host controller PATA PIO timings
* @ap: Port whose timings we are configuring
* @adev: Drive in question
* @udma: udma mode, 0 - 6
* @isich: set if the chip is an ICH device
*
* Set UDMA mode for device, in host controller PCI config space.
Expand Down
11 changes: 8 additions & 3 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ u64 ata_tf_to_lba48(const struct ata_taskfile *tf)

sectors |= ((u64)(tf->hob_lbah & 0xff)) << 40;
sectors |= ((u64)(tf->hob_lbam & 0xff)) << 32;
sectors |= (tf->hob_lbal & 0xff) << 24;
sectors |= ((u64)(tf->hob_lbal & 0xff)) << 24;
sectors |= (tf->lbah & 0xff) << 16;
sectors |= (tf->lbam & 0xff) << 8;
sectors |= (tf->lbal & 0xff);
Expand Down Expand Up @@ -1602,7 +1602,6 @@ unsigned long ata_id_xfermask(const u16 *id)
/**
* ata_pio_queue_task - Queue port_task
* @ap: The ata_port to queue port_task for
* @fn: workqueue function to be scheduled
* @data: data for @fn to use
* @delay: delay time in msecs for workqueue function
*
Expand Down Expand Up @@ -2159,6 +2158,10 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
static inline u8 ata_dev_knobble(struct ata_device *dev)
{
struct ata_port *ap = dev->link->ap;

if (ata_dev_blacklisted(dev) & ATA_HORKAGE_BRIDGE_OK)
return 0;

return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev->id)));
}

Expand Down Expand Up @@ -4063,6 +4066,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "TSSTcorp CDDVDW SH-S202N", "SB00", ATA_HORKAGE_IVB, },
{ "TSSTcorp CDDVDW SH-S202N", "SB01", ATA_HORKAGE_IVB, },

/* Devices that do not need bridging limits applied */
{ "MTRON MSP-SATA*", NULL, ATA_HORKAGE_BRIDGE_OK, },

/* End Marker */
{ }
};
Expand Down Expand Up @@ -4648,7 +4654,6 @@ static void ata_verify_xfer(struct ata_queued_cmd *qc)
/**
* ata_qc_complete - Complete an active ATA command
* @qc: Command to complete
* @err_mask: ATA Status register contents
*
* Indicate to the mid and upper layers that an ATA
* command has completed, with either an ok or not-ok status.
Expand Down
Loading

0 comments on commit f14d2f2

Please sign in to comment.