x86 setup: MAINTAINERS: formally take responsibility for the i386 boot code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f1291f2caa536c441507b459f91770a5280fb5d
Commit: 7f1291f2caa536c441507b459f91770a5280fb5d
Parent: 4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:26 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

x86 setup: MAINTAINERS: formally take responsibility for the i386 boot code

Change MAINTAINERS to formally take responsibility for the i386 boot code.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 MAINTAINERS |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 151f4ef..3db68bf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1750,8 +1750,8 @@ T:http://www.harbaum.org/till/i2c_tiny_usb
 S: Maintained
 
 i386 BOOT CODE
-P: Riley H. Williams
-M: [EMAIL PROTECTED]
+P: H. Peter Anvin
+M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 S: Maintained
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


hd.c: remove BIOS/CMOS queries

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=48dd643c3b02544994fa091573c2242441a7733f
Commit: 48dd643c3b02544994fa091573c2242441a7733f
Parent: 7f1291f2caa536c441507b459f91770a5280fb5d
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:27 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

hd.c: remove BIOS/CMOS queries

An ST-506 disk these days is pretty much someone trying to pull ancient
data using an auxilliary controller.  Pulling data from the BIOS or CMOS
is just plain wrong, since it's likely to be the primary OS disk... and
would be user-entered data anyway.  Instead, require the user enters it
on the command line.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/ide/legacy/hd.c |   73 ---
 1 files changed, 12 insertions(+), 61 deletions(-)

diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c
index 7f4c0a5..8f2db8d 100644
--- a/drivers/ide/legacy/hd.c
+++ b/drivers/ide/legacy/hd.c
@@ -719,74 +719,25 @@ static int __init hd_init(void)
device_timer.function = hd_times_out;
blk_queue_hardsect_size(hd_queue, 512);
 
-#ifdef __i386__
if (!NR_HD) {
-   extern struct drive_info drive_info;
-   unsigned char *BIOS = (unsigned char *) drive_info;
-   unsigned long flags;
-   int cmos_disks;
-
-   for (drive=0 ; drive2 ; drive++) {
-   hd_info[drive].cyl = *(unsigned short *) BIOS;
-   hd_info[drive].head = *(2+BIOS);
-   hd_info[drive].wpcom = *(unsigned short *) (5+BIOS);
-   hd_info[drive].ctl = *(8+BIOS);
-   hd_info[drive].lzone = *(unsigned short *) (12+BIOS);
-   hd_info[drive].sect = *(14+BIOS);
-#ifdef does_not_work_for_everybody_with_scsi_but_helps_ibm_vp
-   if (hd_info[drive].cyl  NR_HD == drive)
-   NR_HD++;
-#endif
-   BIOS += 16;
-   }
-
-   /*
-   We query CMOS about hard disks : it could be that 
-   we have a SCSI/ESDI/etc controller that is BIOS
-   compatible with ST-506, and thus showing up in our
-   BIOS table, but not register compatible, and therefore
-   not present in CMOS.
-
-   Furthermore, we will assume that our ST-506 drives
-   if any are the primary drives in the system, and 
-   the ones reflected as drive 1 or 2.
-
-   The first drive is stored in the high nibble of CMOS
-   byte 0x12, the second in the low nibble.  This will be
-   either a 4 bit drive type or 0xf indicating use byte 0x19 
-   for an 8 bit type, drive 1, 0x1a for drive 2 in CMOS.
-
-   Needless to say, a non-zero value means we have 
-   an AT controller hard disk for that drive.
-
-   Currently the rtc_lock is a bit academic since this
-   driver is non-modular, but someday... ? Paul G.
-   */
-
-   spin_lock_irqsave(rtc_lock, flags);
-   cmos_disks = CMOS_READ(0x12);
-   spin_unlock_irqrestore(rtc_lock, flags);
-
-   if (cmos_disks  0xf0) {
-   if (cmos_disks  0x0f)
-   NR_HD = 2;
-   else
-   NR_HD = 1;
-   }
-   }
-#endif /* __i386__ */
-#ifdef __arm__
-   if (!NR_HD) {
-   /* We don't know anything about the drive.  This means
+   /*
+* We don't know anything about the drive.  This means
 * that you *MUST* specify the drive parameters to the
 * kernel yourself.
+*
+* If we were on an i386, we used to read this info from
+* the BIOS or CMOS.  This doesn't work all that well,
+* since this assumes that this is a primary or secondary
+* drive, and if we're using this legacy driver, it's
+* probably an auxilliary controller added to recover
+* legacy data off an ST-506 drive.  Either way, it's
+* definitely safest to have the user explicitly specify
+* the information.
 */
printk(hd: no drives specified - use hd=cyl,head,sectors
 on kernel command line\n);
-   }
-#endif
-   if (!NR_HD)
goto out;
+   }
 
for (drive=0 ; drive  NR_HD ; drive++) {
struct gendisk *disk = alloc_disk(64);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the 

include/asm-i386/boot.h: This is asm/boot.h, not linux/boot.h

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f8c09377d754f35a135454181b869ab527cc0757
Commit: f8c09377d754f35a135454181b869ab527cc0757
Parent: 48dd643c3b02544994fa091573c2242441a7733f
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:28 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

include/asm-i386/boot.h: This is asm/boot.h, not linux/boot.h

include/asm-i386/boot.h incorrectly has the multiple include guards
as _LINUX_BOOT_H instead of _ASM_BOOT_H.  Fix.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-i386/boot.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/asm-i386/boot.h b/include/asm-i386/boot.h
index bd024ab..ed8affb 100644
--- a/include/asm-i386/boot.h
+++ b/include/asm-i386/boot.h
@@ -1,5 +1,5 @@
-#ifndef _LINUX_BOOT_H
-#define _LINUX_BOOT_H
+#ifndef _ASM_BOOT_H
+#define _ASM_BOOT_H
 
 /* Don't touch these, unless you really know what you're doing. */
 #define DEF_INITSEG0x9000
@@ -17,4 +17,4 @@
+ (CONFIG_PHYSICAL_ALIGN - 1)) \
 ~(CONFIG_PHYSICAL_ALIGN - 1))
 
-#endif /* _LINUX_BOOT_H */
+#endif /* _ASM_BOOT_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Unify the CPU features vectors between i386 and x86-64

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ec481536b15eb0520d8f0204b0294480050fe1f8
Commit: ec481536b15eb0520d8f0204b0294480050fe1f8
Parent: f8c09377d754f35a135454181b869ab527cc0757
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:29 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

Unify the CPU features vectors between i386 and x86-64

Unify the handling of the CPU features vectors between i386 and x86-64.
This also adopts the collapsing of features which are required at
compile-time into constant tests from x86-64 to i386.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/cpu/proc.c|   15 +++--
 arch/i386/kernel/verify_cpu.S  |   12 ++--
 arch/x86_64/kernel/setup.c |   13 ++--
 arch/x86_64/kernel/verify_cpu.S|   22 +-
 include/asm-i386/cpufeature.h  |   17 +++--
 include/asm-i386/required-features.h   |   38 ---
 include/asm-x86_64/alternative.h   |   68 ++-
 include/asm-x86_64/cpufeature.h|  115 +++
 include/asm-x86_64/processor.h |2 -
 include/asm-x86_64/required-features.h |   45 
 10 files changed, 159 insertions(+), 188 deletions(-)

diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c
index 89d91e6..ed73091 100644
--- a/arch/i386/kernel/cpu/proc.c
+++ b/arch/i386/kernel/cpu/proc.c
@@ -29,7 +29,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, syscall, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, mp, nx, NULL, mmxext, NULL,
-   NULL, fxsr_opt, pdpe1gb, rdtscp, NULL, lm, 3dnowext, 
3dnow,
+   NULL, fxsr_opt, pdpe1gb, rdtscp, NULL, lm,
+   3dnowext, 3dnow,
 
/* Transmeta-defined */
recovery, longrun, NULL, lrti, NULL, NULL, NULL, NULL,
@@ -40,8 +41,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
/* Other (Linux-defined) */
cxmmx, k6_mtrr, cyrix_arr, centaur_mcr,
NULL, NULL, NULL, NULL,
-   constant_tsc, up, NULL, NULL, NULL, NULL, NULL, NULL,
-   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   constant_tsc, up, NULL, arch_perfmon,
+   pebs, bts, NULL, sync_rdtsc,
+   rep_good, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
/* Intel-defined (#2) */
@@ -57,9 +59,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
/* AMD-defined (#2) */
-   lahf_lm, cmp_legacy, svm, extapic, cr8legacy, abm,
-   sse4a, misalignsse,
-   3dnowprefetch, osvw, ibs, NULL, NULL, NULL, NULL, NULL,
+   lahf_lm, cmp_legacy, svm, extapic, cr8_legacy,
+   altmovcr8, abm, sse4a,
+   misalignsse, 3dnowprefetch,
+   osvw, ibs, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
};
diff --git a/arch/i386/kernel/verify_cpu.S b/arch/i386/kernel/verify_cpu.S
index f1d1eac..3efc5c1 100644
--- a/arch/i386/kernel/verify_cpu.S
+++ b/arch/i386/kernel/verify_cpu.S
@@ -20,7 +20,7 @@ verify_cpu:
testl   $(118),%eax
jz  bad
 #endif
-#if REQUIRED_MASK1 != 0
+#if REQUIRED_MASK0 != 0
pushfl  # standard way to check for cpuid
popl%eax
movl%eax,%ebx
@@ -39,14 +39,14 @@ verify_cpu:
pushfl
popl%eax
cmpl%eax,%ebx
-   jz  bad # REQUIRED_MASK1 != 0 requires CPUID
+   jz  bad # REQUIRED_MASK0 != 0 requires CPUID
 
movl$0x0,%eax   # See if cpuid 1 is implemented
cpuid
cmpl$0x1,%eax
jb  bad # no cpuid 1
 
-#if REQUIRED_MASK1  NEED_CMPXCHG64
+#if REQUIRED_MASK0  NEED_CMPXCHG64
/* Some VIA C3s need magic MSRs to enable CX64. Do this here */
cmpl$0x746e6543,%ebx# Cent
jne 1f
@@ -79,10 +79,10 @@ verify_cpu:
 #error add proper model checking here
 #endif
 
-   andl$REQUIRED_MASK1,%edx
-   xorl$REQUIRED_MASK1,%edx
+   andl$REQUIRED_MASK0,%edx
+   xorl$REQUIRED_MASK0,%edx
jnz bad
-#endif /* REQUIRED_MASK1 */
+#endif /* REQUIRED_MASK0 */
 
popfl
xor %eax,%eax
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index eb6524f..dc7630d 100644
--- a/arch/x86_64/kernel/setup.c

x86 Kconfig: change X86_MINIMUM_CPU_MODEL to X86_MINIMUM_CPU_FAMILY

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de32e04175efbc1ff5e0f509253d5dfc84f173b3
Commit: de32e04175efbc1ff5e0f509253d5dfc84f173b3
Parent: ec481536b15eb0520d8f0204b0294480050fe1f8
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:30 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

x86 Kconfig: change X86_MINIMUM_CPU_MODEL to X86_MINIMUM_CPU_FAMILY

The X86_MINIMUM_CPU_MODEL name isn't really right, so change it to
X86_MINIMUM_CPU_FAMILY.  Also, the default minimum should be 3, not 0.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/Kconfig.cpu |6 +++---
 arch/i386/kernel/verify_cpu.S |4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/i386/Kconfig.cpu b/arch/i386/Kconfig.cpu
index 5c95ceb..9cbe76c 100644
--- a/arch/i386/Kconfig.cpu
+++ b/arch/i386/Kconfig.cpu
@@ -344,8 +344,8 @@ config X86_CMOV
depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII 
|| M686 || MVIAC3_2 || MVIAC7)
default y
 
-config X86_MINIMUM_CPU_MODEL
+config X86_MINIMUM_CPU_FAMILY
int
-   default 4 if X86_XADD || X86_CMPXCHG || X86_BSWAP
-   default 0
+   default 4 if X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK
+   default 3
 
diff --git a/arch/i386/kernel/verify_cpu.S b/arch/i386/kernel/verify_cpu.S
index 3efc5c1..fff4aa6 100644
--- a/arch/i386/kernel/verify_cpu.S
+++ b/arch/i386/kernel/verify_cpu.S
@@ -9,7 +9,7 @@ verify_cpu:
pushl   $0  # Kill any dangerous flags
popfl
 
-#if CONFIG_X86_MINIMUM_CPU_MODEL = 4
+#if CONFIG_X86_MINIMUM_CPU_FAMILY = 4
pushfl
pop %eax
orl $(118),%eax   # try setting AC
@@ -75,7 +75,7 @@ verify_cpu:
movl$0x1,%eax   # Does the cpu have what it takes
cpuid
 
-#if CONFIG_X86_MINIMUM_CPU_MODEL  4
+#if CONFIG_X86_MINIMUM_CPU_FAMILY  4
 #error add proper model checking here
 #endif
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Clean up struct screen_info (linux/screen_info.h)

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e087db510cd96a75a614f6f6fcd5499ab21cb087
Commit: e087db510cd96a75a614f6f6fcd5499ab21cb087
Parent: de32e04175efbc1ff5e0f509253d5dfc84f173b3
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:31 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

Clean up struct screen_info (linux/screen_info.h)

struct screen_info has unaligned members, it needs to be packed.
In the process, fix the naming of some of the members, which don't
belong in this structure but are part of it anyway.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/screen_info.h |9 -
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index b02308e..3ee412b 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -10,7 +10,7 @@
 struct screen_info {
u8  orig_x; /* 0x00 */
u8  orig_y; /* 0x01 */
-   u16 dontuse1;   /* 0x02 -- EXT_MEM_K sits here */
+   u16 ext_mem_k;  /* 0x02 */
u16 orig_video_page;/* 0x04 */
u8  orig_video_mode;/* 0x06 */
u8  orig_video_cols;/* 0x07 */
@@ -27,7 +27,7 @@ struct screen_info {
u16 lfb_depth;  /* 0x16 */
u32 lfb_base;   /* 0x18 */
u32 lfb_size;   /* 0x1c */
-   u16 dontuse2, dontuse3; /* 0x20 -- CL_MAGIC and CL_OFFSET here */
+   u16 cl_magic, cl_offset; /* 0x20 */
u16 lfb_linelength; /* 0x24 */
u8  red_size;   /* 0x26 */
u8  red_pos;/* 0x27 */
@@ -42,9 +42,8 @@ struct screen_info {
u16 pages;  /* 0x32 */
u16 vesa_attributes;/* 0x34 */
u32 capabilities;   /* 0x36 */
-   /* 0x3a -- 0x3b reserved for future expansion */
-   /* 0x3c -- 0x3f micro stack for relocatable 
kernels */
-};
+   u8  _reserved[6];   /* 0x3a */
+} __attribute__((packed));
 
 extern struct screen_info screen_info;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Use a new CPU feature word to cover features that are spread around

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1d67953f2bda8876045c24ae58841f27d9bb7572
Commit: 1d67953f2bda8876045c24ae58841f27d9bb7572
Parent: e087db510cd96a75a614f6f6fcd5499ab21cb087
Author: Venki Pallipadi [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:32 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

Use a new CPU feature word to cover features that are spread around

Some Intel features are spread around in different CPUID leafs like 0x5,
0x6 and 0xA.  Make this feature detection code common across i386 and
x86_64.

Display Intel Dynamic Acceleration feature in /proc/cpuinfo. This feature
will be enabled automatically by current acpi-cpufreq driver.

Refer to Intel Software Developer's Manual for more details about the 
feature.

Thanks to hpa (H Peter Anvin) for the making the actual code detecting the
scattered features data-driven.

Signed-off-by: Venkatesh Pallipadi [EMAIL PROTECTED]
Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/cpu/Makefile   |2 +-
 arch/i386/kernel/cpu/addon_cpuid_features.c |   50 +++
 arch/i386/kernel/cpu/common.c   |2 +
 arch/i386/kernel/cpu/proc.c |6 +++
 arch/x86_64/kernel/Makefile |2 +
 arch/x86_64/kernel/setup.c  |8 
 include/asm-i386/cpufeature.h   |   11 +-
 include/asm-i386/processor.h|1 +
 include/asm-i386/required-features.h|1 +
 include/asm-x86_64/processor.h  |1 +
 include/asm-x86_64/required-features.h  |1 +
 11 files changed, 82 insertions(+), 3 deletions(-)

diff --git a/arch/i386/kernel/cpu/Makefile b/arch/i386/kernel/cpu/Makefile
index 74f27a4..0b6a855 100644
--- a/arch/i386/kernel/cpu/Makefile
+++ b/arch/i386/kernel/cpu/Makefile
@@ -8,7 +8,7 @@ obj-y   +=  amd.o
 obj-y  +=  cyrix.o
 obj-y  +=  centaur.o
 obj-y  +=  transmeta.o
-obj-y  +=  intel.o intel_cacheinfo.o
+obj-y  +=  intel.o intel_cacheinfo.o addon_cpuid_features.o
 obj-y  +=  rise.o
 obj-y  +=  nexgen.o
 obj-y  +=  umc.o
diff --git a/arch/i386/kernel/cpu/addon_cpuid_features.c 
b/arch/i386/kernel/cpu/addon_cpuid_features.c
new file mode 100644
index 000..3e91d3e
--- /dev/null
+++ b/arch/i386/kernel/cpu/addon_cpuid_features.c
@@ -0,0 +1,50 @@
+
+/*
+ * Routines to indentify additional cpu features that are scattered in
+ * cpuid space.
+ */
+
+#include linux/cpu.h
+
+#include asm/processor.h
+
+struct cpuid_bit {
+   u16 feature;
+   u8 reg;
+   u8 bit;
+   u32 level;
+};
+
+enum cpuid_regs {
+   CR_EAX = 0,
+   CR_ECX,
+   CR_EDX,
+   CR_EBX
+};
+
+void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
+{
+   u32 max_level;
+   u32 regs[4];
+   const struct cpuid_bit *cb;
+
+   static const struct cpuid_bit cpuid_bits[] = {
+   { X86_FEATURE_IDA, CR_EAX, 1, 0x0006 },
+   { 0, 0, 0, 0 }
+   };
+
+   for (cb = cpuid_bits; cb-feature; cb++) {
+
+   /* Verify that the level is valid */
+   max_level = cpuid_eax(cb-level  0x);
+   if (max_level  cb-level ||
+   max_level  (cb-level | 0x))
+   continue;
+
+   cpuid(cb-level, regs[CR_EAX], regs[CR_EBX],
+   regs[CR_ECX], regs[CR_EDX]);
+
+   if (regs[cb-reg]  (1  cb-bit))
+   set_bit(cb-feature, c-x86_capability);
+   }
+}
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index 794d593..e5419a9 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -353,6 +353,8 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 * 
c)
if ( xlvl = 0x8004 )
get_model_name(c); /* Default name */
}
+
+   init_scattered_cpuid_features(c);
}
 
early_intel_workaround(c);
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c
index ed73091..1e31b6c 100644
--- a/arch/i386/kernel/cpu/proc.c
+++ b/arch/i386/kernel/cpu/proc.c
@@ -65,6 +65,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
osvw, ibs, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+
+   /* Auxiliary (Linux-defined) */
+   ida, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

Define zero-page offset 0x1e4 as a scratch field, and use it

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=85414b693ac037d709582a167a330db3a5d186d8
Commit: 85414b693ac037d709582a167a330db3a5d186d8
Parent: 1d67953f2bda8876045c24ae58841f27d9bb7572
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:33 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

Define zero-page offset 0x1e4 as a scratch field, and use it

The relocatable kernel code needs a scratch field for the decompressor
to determine its own location.  It was using a location inside
struct screen_info; reserve a free location and document it as scratch
instead.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/i386/zero-page.txt   |1 +
 arch/i386/boot/compressed/head.S   |6 +++---
 arch/x86_64/boot/compressed/head.S |6 +++---
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/Documentation/i386/zero-page.txt b/Documentation/i386/zero-page.txt
index c04a421..75b3680 100644
--- a/Documentation/i386/zero-page.txt
+++ b/Documentation/i386/zero-page.txt
@@ -37,6 +37,7 @@ OffsetTypeDescription
 0x1d0  unsigned long   EFI memory descriptor map pointer
 0x1d4  unsigned long   EFI memory descriptor map size
 0x1e0  unsigned long   ALT_MEM_K, alternative mem check, in Kb
+0x1e4  unsigned long   Scratch field for the kernel setup code
 0x1e8  charnumber of entries in E820MAP (below)
 0x1e9  unsigned char   number of entries in EDDBUF (below)
 0x1ea  unsigned char   number of entries in EDD_MBR_SIG_BUFFER (below)
diff --git a/arch/i386/boot/compressed/head.S b/arch/i386/boot/compressed/head.S
index 3517a32..f35ea22 100644
--- a/arch/i386/boot/compressed/head.S
+++ b/arch/i386/boot/compressed/head.S
@@ -45,10 +45,10 @@ startup_32:
  * at and where we were actually loaded at.  This can only be done
  * with a short local call on x86.  Nothing  else will tell us what
  * address we are running at.  The reserved chunk of the real-mode
- * data at 0x34-0x3f are used as the stack for this calculation.
- * Only 4 bytes are needed.
+ * data at 0x1e4 (defined as a scratch field) are used as the stack
+ * for this calculation. Only 4 bytes are needed.
  */
-   leal 0x40(%esi), %esp
+   leal (0x1e4+4)(%esi), %esp
call 1f
 1: popl %ebp
subl $1b, %ebp
diff --git a/arch/x86_64/boot/compressed/head.S 
b/arch/x86_64/boot/compressed/head.S
index f9d5692..1312bfa 100644
--- a/arch/x86_64/boot/compressed/head.S
+++ b/arch/x86_64/boot/compressed/head.S
@@ -46,10 +46,10 @@ startup_32:
  * at and where we were actually loaded at.  This can only be done
  * with a short local call on x86.  Nothing  else will tell us what
  * address we are running at.  The reserved chunk of the real-mode
- * data at 0x34-0x3f are used as the stack for this calculation.
- * Only 4 bytes are needed.
+ * data at 0x1e4 (defined as a scratch field) are used as the stack
+ * for this calculation. Only 4 bytes are needed.
  */
-   leal0x40(%esi), %esp
+   leal(0x1e4+4)(%esi), %esp
call1f
 1: popl%ebp
subl$1b, %ebp
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Make struct boot_params a real structure, and remove obsolete fields

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=48c7ae674f03e56c78ff42c6796a36e90db67874
Commit: 48c7ae674f03e56c78ff42c6796a36e90db67874
Parent: 9c25d134b3735a4b197e108b4c7d6bbec1a275e8
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:35 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

Make struct boot_params a real structure, and remove obsolete fields

Make struct boot_params a real structure, and remove the handling of
some obsolete fields, in particular hd*_info, which was only used by
the ST-506 driver, and likely to be wrong for that driver on any
modern BIOS.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/setup.c   |   12 +-
 include/asm-i386/bootparam.h   |   85 
 include/asm-i386/setup.h   |   10 +++--
 include/asm-x86_64/boot.h  |   16 +---
 include/asm-x86_64/bootparam.h |1 +
 5 files changed, 94 insertions(+), 30 deletions(-)

diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 698c24f..2d61e65 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -102,19 +102,10 @@ static unsigned int highmem_pages = -1;
 /*
  * Setup options
  */
-struct drive_info_struct { char dummy[32]; } drive_info;
-#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || \
-defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
-EXPORT_SYMBOL(drive_info);
-#endif
 struct screen_info screen_info;
 EXPORT_SYMBOL(screen_info);
 struct apm_info apm_info;
 EXPORT_SYMBOL(apm_info);
-struct sys_desc_table_struct {
-   unsigned short length;
-   unsigned char table[0];
-};
 struct edid_info edid_info;
 EXPORT_SYMBOL_GPL(edid_info);
 struct ist_info ist_info;
@@ -134,7 +125,7 @@ unsigned long saved_videomode;
 
 static char __initdata command_line[COMMAND_LINE_SIZE];
 
-unsigned char __initdata boot_params[PARAM_SIZE];
+struct boot_params __initdata boot_params;
 
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
 struct edd edd;
@@ -528,7 +519,6 @@ void __init setup_arch(char **cmdline_p)
 #endif
 
ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
-   drive_info = DRIVE_INFO;
screen_info = SCREEN_INFO;
edid_info = EDID_INFO;
apm_info.bios = APM_BIOS_INFO;
diff --git a/include/asm-i386/bootparam.h b/include/asm-i386/bootparam.h
new file mode 100644
index 000..427d865
--- /dev/null
+++ b/include/asm-i386/bootparam.h
@@ -0,0 +1,85 @@
+#ifndef _ASM_BOOTPARAM_H
+#define _ASM_BOOTPARAM_H
+
+#include linux/types.h
+#include linux/screen_info.h
+#include linux/apm_bios.h
+#include asm/e820.h
+#include linux/edd.h
+#include video/edid.h
+
+struct setup_header {
+   u8  setup_sects;
+   u16 root_flags;
+   u32 syssize;
+   u16 ram_size;
+   u16 vid_mode;
+   u16 root_dev;
+   u16 boot_flag;
+   u16 jump;
+   u32 header;
+   u16 version;
+   u32 realmode_swtch;
+   u16 start_sys;
+   u16 kernel_version;
+   u8  type_of_loader;
+   u8  loadflags;
+#define LOADED_HIGH0x01
+#define CAN_USE_HEAP   0x80
+   u16 setup_move_size;
+   u32 code32_start;
+   u32 ramdisk_image;
+   u32 ramdisk_size;
+   u32 bootsect_kludge;
+   u16 heap_end_ptr;
+   u16 _pad1;
+   u32 cmd_line_ptr;
+   u32 initrd_addr_max;
+   u32 kernel_alignment;
+   u8  relocatable_kernel;
+} __attribute__((packed));
+
+struct sys_desc_table {
+   u16 length;
+   u8  table[14];
+};
+
+struct efi_info {
+   u32 _pad1;
+   u32 efi_systab;
+   u32 efi_memdesc_size;
+   u32 efi_memdec_version;
+   u32 efi_memmap;
+   u32 fi_memmap_size;
+   u32 _pad2[2];
+};
+
+/* The so-called zeropage */
+struct boot_params {
+   struct screen_info screen_info; /* 0x000 */
+   struct apm_bios_info apm_bios_info; /* 0x040 */
+   u8  _pad2[12];  /* 0x054 */
+   u32 speedstep_info[4];  /* 0x060 */
+   u8  _pad3[16];  /* 0x070 */
+   u8  hd0_info[16];   /* obsolete! */ /* 0x080 */
+   u8  hd1_info[16];   /* obsolete! */ /* 0x090 */
+   struct sys_desc_table sys_desc_table;   /* 0x0a0 */
+   u8  _pad4[144]; /* 0x0b0 */
+   struct edid_info edid_info; /* 0x140 */
+   struct efi_info efi_info;   /* 0x1c0 */
+   u32 alt_mem_k;  /* 0x1e0 */
+   u32 scratch;/* Scratch field! *//* 0x1e4 */
+   u8  e820_entries;   

x86-64: add CONFIG_PHYSICAL_ALIGN for consistency with i386

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=77e1dd654bc24182a7ad34f415abd488ae7af6eb
Commit: 77e1dd654bc24182a7ad34f415abd488ae7af6eb
Parent: 48c7ae674f03e56c78ff42c6796a36e90db67874
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:36 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

x86-64: add CONFIG_PHYSICAL_ALIGN for consistency with i386

Add CONFIG_PHYSICAL_ALIGN (currently as a hardcoded constant) to provide
consistency with i386.  This value is manifest in the bzImage header.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/Kconfig |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 5ce9443..8bdd25a 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -427,6 +427,10 @@ config NR_CPUS
  This is purely to save memory - each supported CPU requires
  memory in the static kernel configuration.
 
+config PHYSICAL_ALIGN
+   hex
+   default 0x20
+
 config HOTPLUG_CPU
bool Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)
depends on SMP  HOTPLUG  EXPERIMENTAL
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86-64: add symbolic constants for the boot segment selectors

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8afd2af88921c2cb1c9540cecd0714da7ae4fcd0
Commit: 8afd2af88921c2cb1c9540cecd0714da7ae4fcd0
Parent: 77e1dd654bc24182a7ad34f415abd488ae7af6eb
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:37 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

x86-64: add symbolic constants for the boot segment selectors

Add symbolic constants for the segment selectors/GDT slots used by
the setup code, for consistency with i386.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-x86_64/segment.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86_64/segment.h b/include/asm-x86_64/segment.h
index adf2bf1..04b8ab2 100644
--- a/include/asm-x86_64/segment.h
+++ b/include/asm-x86_64/segment.h
@@ -3,6 +3,14 @@
 
 #include asm/cache.h
 
+/* Simple and small GDT entries for booting only */
+
+#define GDT_ENTRY_BOOT_CS  2
+#define __BOOT_CS  (GDT_ENTRY_BOOT_CS * 8)
+
+#define GDT_ENTRY_BOOT_DS  (GDT_ENTRY_BOOT_CS + 1)
+#define __BOOT_DS  (GDT_ENTRY_BOOT_DS * 8)
+
 #define __KERNEL_CS0x10
 #define __KERNEL_DS0x18
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Header file to produce 16-bit code with gcc

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f7f4a5fbd21bf7fc4f207ddaf5126c78c0d1e0b5
Commit: f7f4a5fbd21bf7fc4f207ddaf5126c78c0d1e0b5
Parent: 8afd2af88921c2cb1c9540cecd0714da7ae4fcd0
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:38 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

Header file to produce 16-bit code with gcc

gcc for i386 can be used with the assembly prefix .code16gcc to generate
16-bit (real-mode) code.  This header file provides the assembly prefix.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/code16gcc.h |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/code16gcc.h b/arch/i386/boot/code16gcc.h
new file mode 100644
index 000..3bd8480
--- /dev/null
+++ b/arch/i386/boot/code16gcc.h
@@ -0,0 +1,15 @@
+/*
+ * code16gcc.h
+ *
+ * This file is -include'd when compiling 16-bit C code.
+ * Note: this asm() needs to be emitted before gcc omits any code.
+ * Depending on gcc version, this requires -fno-unit-at-a-time or
+ * -fno-toplevel-reorder.
+ *
+ * Hopefully gcc will eventually have a real -m16 option so we can
+ * drop this hack long term.
+ */
+
+#ifndef __ASSEMBLY__
+asm(.code16gcc);
+#endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Top header file for new x86 setup code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=62bd0337d0c4a77902502558aa30ceeb15655407
Commit: 62bd0337d0c4a77902502558aa30ceeb15655407
Parent: f7f4a5fbd21bf7fc4f207ddaf5126c78c0d1e0b5
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:39 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

Top header file for new x86 setup code

Top header file for the new x86 setup code.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/boot.h |  296 +
 1 files changed, 296 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/boot.h b/arch/i386/boot/boot.h
new file mode 100644
index 000..0329c4f
--- /dev/null
+++ b/arch/i386/boot/boot.h
@@ -0,0 +1,296 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/boot.h
+ *
+ * Header file for the real-mode kernel code
+ */
+
+#ifndef BOOT_BOOT_H
+#define BOOT_BOOT_H
+
+#ifndef __ASSEMBLY__
+
+#include stdarg.h
+#include linux/types.h
+#include linux/edd.h
+#include asm/boot.h
+#include asm/bootparam.h
+
+/* Useful macros */
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+
+extern struct setup_header hdr;
+extern struct boot_params boot_params;
+
+/* Basic port I/O */
+static inline void outb(u8 v, u16 port)
+{
+   asm volatile(outb %0,%1 : : a (v), dN (port));
+}
+static inline u8 inb(u16 port)
+{
+   u8 v;
+   asm volatile(inb %1,%0 : =a (v) : dN (port));
+   return v;
+}
+
+static inline void outw(u16 v, u16 port)
+{
+   asm volatile(outw %0,%1 : : a (v), dN (port));
+}
+static inline u16 inw(u16 port)
+{
+   u16 v;
+   asm volatile(inw %1,%0 : =a (v) : dN (port));
+   return v;
+}
+
+static inline void outl(u32 v, u16 port)
+{
+   asm volatile(outl %0,%1 : : a (v), dn (port));
+}
+static inline u32 inl(u32 port)
+{
+   u32 v;
+   asm volatile(inl %1,%0 : =a (v) : dN (port));
+   return v;
+}
+
+static inline void io_delay(void)
+{
+   const u16 DELAY_PORT = 0x80;
+   asm volatile(outb %%al,%0 : : dN (DELAY_PORT));
+}
+
+/* These functions are used to reference data in other segments. */
+
+static inline u16 ds(void)
+{
+   u16 seg;
+   asm(movw %%ds,%0 : =rm (seg));
+   return seg;
+}
+
+static inline void set_fs(u16 seg)
+{
+   asm volatile(movw %0,%%fs : : rm (seg));
+}
+static inline u16 fs(void)
+{
+   u16 seg;
+   asm(movw %%fs,%0 : =rm (seg));
+   return seg;
+}
+
+static inline void set_gs(u16 seg)
+{
+   asm volatile(movw %0,%%gs : : rm (seg));
+}
+static inline u16 gs(void)
+{
+   u16 seg;
+   asm(movw %%gs,%0 : =rm (seg));
+   return seg;
+}
+
+typedef unsigned int addr_t;
+
+static inline u8 rdfs8(addr_t addr)
+{
+   u8 v;
+   asm(movb %%fs:%1,%0 : =r (v) : m (*(u8 *)addr));
+   return v;
+}
+static inline u16 rdfs16(addr_t addr)
+{
+   u16 v;
+   asm(movw %%fs:%1,%0 : =r (v) : m (*(u16 *)addr));
+   return v;
+}
+static inline u32 rdfs32(addr_t addr)
+{
+   u32 v;
+   asm(movl %%fs:%1,%0 : =r (v) : m (*(u32 *)addr));
+   return v;
+}
+
+static inline void wrfs8(u8 v, addr_t addr)
+{
+   asm volatile(movb %1,%%fs:%0 : +m (*(u8 *)addr) : r (v));
+}
+static inline void wrfs16(u16 v, addr_t addr)
+{
+   asm volatile(movw %1,%%fs:%0 : +m (*(u16 *)addr) : r (v));
+}
+static inline void wrfs32(u32 v, addr_t addr)
+{
+   asm volatile(movl %1,%%fs:%0 : +m (*(u32 *)addr) : r (v));
+}
+
+static inline u8 rdgs8(addr_t addr)
+{
+   u8 v;
+   asm(movb %%gs:%1,%0 : =r (v) : m (*(u8 *)addr));
+   return v;
+}
+static inline u16 rdgs16(addr_t addr)
+{
+   u16 v;
+   asm(movw %%gs:%1,%0 : =r (v) : m (*(u16 *)addr));
+   return v;
+}
+static inline u32 rdgs32(addr_t addr)
+{
+   u32 v;
+   asm(movl %%gs:%1,%0 : =r (v) : m (*(u32 *)addr));
+   return v;
+}
+
+static inline void wrgs8(u8 v, addr_t addr)
+{
+   asm volatile(movb %1,%%gs:%0 : +m (*(u8 *)addr) : r (v));
+}
+static inline void wrgs16(u16 v, addr_t addr)
+{
+   asm volatile(movw %1,%%gs:%0 : +m (*(u16 *)addr) : r (v));
+}
+static inline void wrgs32(u32 v, addr_t addr)
+{
+   asm volatile(movl %1,%%gs:%0 : +m (*(u32 *)addr) : r (v));
+}
+
+/* Note: these only return true/false, not a signed return value! */
+static inline int memcmp(const void *s1, const void *s2, size_t len)
+{
+   u8 diff;
+   asm(repe; cmpsb; setnz %0
+   : =qm (diff), +D (s1), 

Simple bitops for the new x86 setup code.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ad7e906d5687bb076fe6c3c980d6e013a3a42bde
Commit: ad7e906d5687bb076fe6c3c980d6e013a3a42bde
Parent: 62bd0337d0c4a77902502558aa30ceeb15655407
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:40 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

Simple bitops for the new x86 setup code.

A simple collection of bitops for the new x86 setup code.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/bitops.h |   45 +
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/bitops.h b/arch/i386/boot/bitops.h
new file mode 100644
index 000..8dcc8dc
--- /dev/null
+++ b/arch/i386/boot/bitops.h
@@ -0,0 +1,45 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/bitops.h
+ *
+ * Very simple bitops for the boot code.
+ */
+
+#ifndef BOOT_BITOPS_H
+#define BOOT_BITOPS_H
+#define _LINUX_BITOPS_H/* Inhibit inclusion of 
linux/bitops.h */
+
+static inline int constant_test_bit(int nr, const void *addr)
+{
+   const u32 *p = (const u32 *)addr;
+   return ((1UL  (nr  31))  (p[nr  5])) != 0;
+}
+static inline int variable_test_bit(int nr, const void *addr)
+{
+   u8 v;
+   const u32 *p = (const u32 *)addr;
+
+   asm(btl %2,%1; setc %0 : =qm (v) : m (*p), Ir (nr));
+   return v;
+}
+
+#define test_bit(nr,addr) \
+(__builtin_constant_p(nr) ? \
+ constant_test_bit((nr),(addr)) : \
+ variable_test_bit((nr),(addr)))
+
+static inline void set_bit(int nr, void *addr)
+{
+   asm(btsl %1,%0 : +m (*(u32 *)addr) : Ir (nr));
+}
+
+#endif /* BOOT_BITOPS_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Make definitions for struct e820entry and struct e820map consistent

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9c25d134b3735a4b197e108b4c7d6bbec1a275e8
Commit: 9c25d134b3735a4b197e108b4c7d6bbec1a275e8
Parent: 85414b693ac037d709582a167a330db3a5d186d8
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:34 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:54 2007 -0700

Make definitions for struct e820entry and struct e820map consistent

Make definitions for struct e820entry and struct e820map
consistent between i386 and x86-64.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/e820.c   |2 +-
 include/asm-i386/e820.h   |   14 --
 include/asm-x86_64/e820.h |4 +---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/i386/kernel/e820.c b/arch/i386/kernel/e820.c
index 9645bb5..fc822a4 100644
--- a/arch/i386/kernel/e820.c
+++ b/arch/i386/kernel/e820.c
@@ -734,7 +734,7 @@ void __init print_memory_map(char *who)
case E820_NVS:
printk((ACPI NVS)\n);
break;
-   default:printk(type %lu\n, e820.map[i].type);
+   default:printk(type %u\n, e820.map[i].type);
break;
}
}
diff --git a/include/asm-i386/e820.h b/include/asm-i386/e820.h
index 096a2a8..c03290c 100644
--- a/include/asm-i386/e820.h
+++ b/include/asm-i386/e820.h
@@ -25,13 +25,15 @@
 
 #ifndef __ASSEMBLY__
 
+struct e820entry {
+   u64 addr;   /* start of memory segment */
+   u64 size;   /* size of memory segment */
+   u32 type;   /* type of memory segment */
+} __attribute__((packed));
+
 struct e820map {
-int nr_map;
-struct e820entry {
-   unsigned long long addr;/* start of memory segment */
-   unsigned long long size;/* size of memory segment */
-   unsigned long type; /* type of memory segment */
-} map[E820MAX];
+   u32 nr_map;
+   struct e820entry map[E820MAX];
 };
 
 extern struct e820map e820;
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h
index 6216fa3..3486e70 100644
--- a/include/asm-x86_64/e820.h
+++ b/include/asm-x86_64/e820.h
@@ -11,8 +11,6 @@
 #ifndef __E820_HEADER
 #define __E820_HEADER
 
-#include linux/mmzone.h
-
 #define E820MAP0x2d0   /* our map */
 #define E820MAX128 /* number of entries in E820MAP */
 #define E820NR 0x1e8   /* # entries in E820MAP */
@@ -30,7 +28,7 @@ struct e820entry {
 } __attribute__((packed));
 
 struct e820map {
-int nr_map;
+   u32 nr_map;
struct e820entry map[E820MAX];
 };
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


String-handling functions for the new x86 setup code.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5be865661516263d90317a6b35b588a2d7c3cb55
Commit: 5be865661516263d90317a6b35b588a2d7c3cb55
Parent: ad7e906d5687bb076fe6c3c980d6e013a3a42bde
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:41 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

String-handling functions for the new x86 setup code.

strcmp(), memcpy(), memset(), as well as routines to copy to and from
other segments (as pointed to by fs and gs).

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/copy.S   |  101 +++
 arch/i386/boot/string.c |   52 
 2 files changed, 153 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/copy.S b/arch/i386/boot/copy.S
new file mode 100644
index 000..ef127e5
--- /dev/null
+++ b/arch/i386/boot/copy.S
@@ -0,0 +1,101 @@
+/* --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/copy.S
+ *
+ * Memory copy routines
+ */
+
+   .code16gcc
+   .text
+
+   .globl  memcpy
+   .type   memcpy, @function
+memcpy:
+   pushw   %si
+   pushw   %di
+   movw%ax, %di
+   movw%dx, %si
+   pushw   %cx
+   shrw$2, %cx
+   rep; movsl
+   popw%cx
+   andw$3, %cx
+   rep; movsb
+   popw%di
+   popw%si
+   ret
+   .size   memcpy, .-memcpy
+
+   .globl  memset
+   .type   memset, @function
+memset:
+   pushw   %di
+   movw%ax, %di
+   movzbl  %dl, %eax
+   imull   $0x01010101,%eax
+   pushw   %cx
+   shrw$2, %cx
+   rep; stosl
+   popw%cx
+   andw$3, %cx
+   rep; stosb
+   popw%di
+   ret
+   .size   memset, .-memset
+
+   .globl  copy_from_fs
+   .type   copy_from_fs, @function
+copy_from_fs:
+   pushw   %ds
+   pushw   %fs
+   popw%ds
+   callmemcpy
+   popw%ds
+   ret
+   .size   copy_from_fs, .-copy_from_fs
+
+   .globl  copy_to_fs
+   .type   copy_to_fs, @function
+copy_to_fs:
+   pushw   %es
+   pushw   %fs
+   popw%es
+   callmemcpy
+   popw%es
+   ret
+   .size   copy_to_fs, .-copy_to_fs
+
+#if 0 /* Not currently used, but can be enabled as needed */
+
+   .globl  copy_from_gs
+   .type   copy_from_gs, @function
+copy_from_gs:
+   pushw   %ds
+   pushw   %gs
+   popw%ds
+   callmemcpy
+   popw%ds
+   ret
+   .size   copy_from_gs, .-copy_from_gs
+   .globl  copy_to_gs
+
+   .type   copy_to_gs, @function
+copy_to_gs:
+   pushw   %es
+   pushw   %gs
+   popw%es
+   callmemcpy
+   popw%es
+   ret
+   .size   copy_to_gs, .-copy_to_gs
+
+#endif
diff --git a/arch/i386/boot/string.c b/arch/i386/boot/string.c
new file mode 100644
index 000..481a220
--- /dev/null
+++ b/arch/i386/boot/string.c
@@ -0,0 +1,52 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/string.c
+ *
+ * Very basic string functions
+ */
+
+#include boot.h
+
+int strcmp(const char *str1, const char *str2)
+{
+   const unsigned char *s1 = (const unsigned char *)str1;
+   const unsigned char *s2 = (const unsigned char *)str2;
+   int delta = 0;
+
+   while (*s1 || *s2) {
+   delta = *s2 - *s1;
+   if (delta)
+   return delta;
+   s1++;
+   s2++;
+   }
+   return 0;
+}
+
+size_t strnlen(const char *s, size_t maxlen)
+{
+   const char *es = s;
+   while (*es  maxlen) {
+   es++;
+   maxlen--;
+   }
+
+   return (es - s);
+}
+
+unsigned int atou(const char *s)
+{
+   unsigned int i = 0;
+   while (isdigit(*s))
+   i = i * 10 + (*s++ - '0');
+   return i;
+}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


A20 handling code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5a8a8128bc218ebd067c660912d838344b05c608
Commit: 5a8a8128bc218ebd067c660912d838344b05c608
Parent: 5be865661516263d90317a6b35b588a2d7c3cb55
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:42 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

A20 handling code

A20 handling code for the new x86 setup code.  This implements the same
algorithms as the assembly version.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/a20.c |  161 ++
 1 files changed, 161 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/a20.c b/arch/i386/boot/a20.c
new file mode 100644
index 000..31348d0
--- /dev/null
+++ b/arch/i386/boot/a20.c
@@ -0,0 +1,161 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/a20.c
+ *
+ * Enable A20 gate (return -1 on failure)
+ */
+
+#include boot.h
+
+#define MAX_8042_LOOPS 10
+
+static int empty_8042(void)
+{
+   u8 status;
+   int loops = MAX_8042_LOOPS;
+
+   while (loops--) {
+   io_delay();
+
+   status = inb(0x64);
+   if (status  1) {
+   /* Read and discard input data */
+   io_delay();
+   (void)inb(0x60);
+   } else if (!(status  2)) {
+   /* Buffers empty, finished! */
+   return 0;
+   }
+   }
+
+   return -1;
+}
+
+/* Returns nonzero if the A20 line is enabled.  The memory address
+   used as a test is the int $0x80 vector, which should be safe. */
+
+#define A20_TEST_ADDR  (4*0x80)
+#define A20_TEST_SHORT  32
+#define A20_TEST_LONG  2097152 /* 2^21 */
+
+static int a20_test(int loops)
+{
+   int ok = 0;
+   int saved, ctr;
+
+   set_fs(0x);
+   set_gs(0x);
+
+   saved = ctr = rdfs32(A20_TEST_ADDR);
+
+   while (loops--) {
+   wrfs32(++ctr, A20_TEST_ADDR);
+   io_delay(); /* Serialize and make delay constant */
+   ok = rdgs32(A20_TEST_ADDR+0x10) ^ ctr;
+   if (ok)
+   break;
+   }
+
+   wrfs32(saved, A20_TEST_ADDR);
+   return ok;
+}
+
+/* Quick test to see if A20 is already enabled */
+static int a20_test_short(void)
+{
+   return a20_test(A20_TEST_SHORT);
+}
+
+/* Longer test that actually waits for A20 to come on line; this
+   is useful when dealing with the KBC or other slow external circuitry. */
+static int a20_test_long(void)
+{
+   return a20_test(A20_TEST_LONG);
+}
+
+static void enable_a20_bios(void)
+{
+   asm volatile(pushfl; int $0x15; popfl
+: : a ((u16)0x2401));
+}
+
+static void enable_a20_kbc(void)
+{
+   empty_8042();
+
+   outb(0xd1, 0x64);   /* Command write */
+   empty_8042();
+
+   outb(0xdf, 0x60);   /* A20 on */
+   empty_8042();
+}
+
+static void enable_a20_fast(void)
+{
+   u8 port_a;
+
+   port_a = inb(0x92); /* Configuration port A */
+   port_a |=  0x02;/* Enable A20 */
+   port_a = ~0x01;/* Do not reset machine */
+   outb(port_a, 0x92);
+}
+
+/*
+ * Actual routine to enable A20; return 0 on ok, -1 on failure
+ */
+
+#define A20_ENABLE_LOOPS 255   /* Number of times to try */
+
+int enable_a20(void)
+{
+   int loops = A20_ENABLE_LOOPS;
+
+#if defined(CONFIG_X86_ELAN)
+   /* Elan croaks if we try to touch the KBC */
+   enable_a20_fast();
+   while (!a20_test_long())
+   ;
+   return 0;
+#elif defined(CONFIG_X86_VOYAGER)
+   /* On Voyager, a20_test() is unsafe? */
+   enable_a20_kbc();
+   return 0;
+#else
+   while (loops--) {
+   /* First, check to see if A20 is already enabled
+  (legacy free, etc.) */
+   if (a20_test_short())
+   return 0;
+
+   /* Next, try the BIOS (INT 0x15, AX=0x2401) */
+   enable_a20_bios();
+   if (a20_test_short())
+   return 0;
+
+   /* Try enabling A20 through the keyboard controller */
+   empty_8042();
+   if (a20_test_short())
+   return 0; /* BIOS worked, but with delayed reaction */
+
+   enable_a20_kbc();
+   if (a20_test_long())
+   return 0;
+
+   /* Finally, 

APM probing code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=49df18fa3f95a5c988b64e4e20e15372282e96ea
Commit: 49df18fa3f95a5c988b64e4e20e15372282e96ea
Parent: 5a8a8128bc218ebd067c660912d838344b05c608
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:43 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

APM probing code

APM probing code for the new x86 setup code.  This implements the
same functionality as the assembly version.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/apm.c |   97 ++
 1 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/apm.c b/arch/i386/boot/apm.c
new file mode 100644
index 000..a34087c
--- /dev/null
+++ b/arch/i386/boot/apm.c
@@ -0,0 +1,97 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   Original APM BIOS checking by Stephen Rothwell, May 1994
+ *   ([EMAIL PROTECTED])
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/apm.c
+ *
+ * Get APM BIOS information
+ */
+
+#include boot.h
+
+#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
+
+int query_apm_bios(void)
+{
+   u16 ax, bx, cx, dx, di;
+   u32 ebx, esi;
+   u8 err;
+
+   /* APM BIOS installation check */
+   ax = 0x5300;
+   bx = cx = 0;
+   asm volatile(pushl %%ebp ; int $0x15 ; popl %%ebp ; setc %0
+: =d (err), +a (ax), +b (bx), +c (cx)
+: : esi, edi);
+
+   if (err)
+   return -1;  /* No APM BIOS */
+
+   if (bx != 0x504d)   /* PM signature */
+   return -1;
+
+   if (cx  0x02)  /* 32 bits supported? */
+   return -1;
+
+   /* Disconnect first, just in case */
+   ax = 0x5304;
+   asm volatile(pushl %%ebp ; int $0x15 ; popl %%ebp
+: +a (ax)
+: : ebx, ecx, edx, esi, edi);
+
+   /* Paranoia */
+   ebx = esi = 0;
+   cx = dx = di = 0;
+
+   /* 32-bit connect */
+   asm volatile(pushl %%ebp ; int $0x15 ; popl %%ebp ; setc %6
+: =a (ax), +b (ebx), +c (cx), +d (dx),
+  +S (esi), +D (di), =m (err)
+: a (0x5303));
+
+   boot_params.apm_bios_info.cseg = ax;
+   boot_params.apm_bios_info.offset = ebx;
+   boot_params.apm_bios_info.cseg_16 = cx;
+   boot_params.apm_bios_info.dseg = dx;
+   boot_params.apm_bios_info.cseg_len = (u16)esi;
+   boot_params.apm_bios_info.cseg_16_len = esi  16;
+   boot_params.apm_bios_info.dseg_len = di;
+
+   if (err)
+   return -1;
+
+   /* Redo the installation check as the 32-bit connect;
+  some BIOSes return different flags this way... */
+
+   ax = 0x5300;
+   bx = cx = 0;
+   asm volatile(pushl %%ebp ; int $0x15 ; popl %%ebp ; setc %0
+: =d (err), +a (ax), +b (bx), +c (cx)
+: : esi, edi);
+
+   if (err || bx != 0x504d) {
+   /* Failure with 32-bit connect, try to disconect and ignore */
+   ax = 0x5304;
+   bx = 0;
+   asm volatile(pushl %%ebp ; int $0x15 ; popl %%ebp
+: +a (ax), +b (bx)
+: : ecx, edx, esi, edi);
+   return -1;
+   }
+
+   boot_params.apm_bios_info.version = ax;
+   boot_params.apm_bios_info.flags = cx;
+   return 0;
+}
+
+#endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Command-line parsing code for the new x86 setup code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e44c22f65f96217692e1a915032fbe7d22236751
Commit: e44c22f65f96217692e1a915032fbe7d22236751
Parent: 49df18fa3f95a5c988b64e4e20e15372282e96ea
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:44 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

Command-line parsing code for the new x86 setup code

Simple command-line parser which allows us to access the kernel command
line from the setup code.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/cmdline.c |   97 ++
 1 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/cmdline.c b/arch/i386/boot/cmdline.c
new file mode 100644
index 000..34bb778
--- /dev/null
+++ b/arch/i386/boot/cmdline.c
@@ -0,0 +1,97 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/cmdline.c
+ *
+ * Simple command-line parser for early boot.
+ */
+
+#include boot.h
+
+static inline int myisspace(u8 c)
+{
+   return c = ' ';/* Close enough approximation */
+}
+
+/*
+ * Find a non-boolean option, that is, option=argument.  In accordance
+ * with standard Linux practice, if this option is repeated, this returns
+ * the last instance on the command line.
+ *
+ * Returns the length of the argument (regardless of if it was
+ * truncated to fit in the buffer), or -1 on not found.
+ */
+int cmdline_find_option(const char *option, char *buffer, int bufsize)
+{
+   u32 cmdline_ptr = boot_params.hdr.cmd_line_ptr;
+   addr_t cptr;
+   char c;
+   int len = -1;
+   const char *opptr = NULL;
+   char *bufptr = buffer;
+   enum {
+   st_wordstart,   /* Start of word/after whitespace */
+   st_wordcmp, /* Comparing this word */
+   st_wordskip,/* Miscompare, skip */
+   st_bufcpy   /* Copying this to buffer */
+   } state = st_wordstart;
+
+   if (!cmdline_ptr || cmdline_ptr = 0x10)
+   return -1;  /* No command line, or inaccessible */
+
+   cptr = cmdline_ptr  0xf;
+   set_fs(cmdline_ptr  4);
+
+   while (cptr  0x1  (c = rdfs8(cptr++))) {
+   switch (state) {
+   case st_wordstart:
+   if (myisspace(c))
+   break;
+
+   /* else */
+   state = st_wordcmp;
+   opptr = option;
+   /* fall through */
+
+   case st_wordcmp:
+   if (c == '='  !*opptr) {
+   len = 0;
+   bufptr = buffer;
+   state = st_bufcpy;
+   } else if (myisspace(c)) {
+   state = st_wordstart;
+   } else if (c != *opptr++) {
+   state = st_wordskip;
+   }
+   break;
+
+   case st_wordskip:
+   if (myisspace(c))
+   state = st_wordstart;
+   break;
+
+   case st_bufcpy:
+   if (myisspace(c)) {
+   state = st_wordstart;
+   } else {
+   if (len  bufsize-1)
+   *bufptr++ = c;
+   len++;
+   }
+   break;
+   }
+   }
+
+   if (bufsize)
+   *bufptr = '\0';
+
+   return len;
+}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Console-writing code for the new x86 setup code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1543610ad79ac4cc61c26f8a29c84e4229faa9a3
Commit: 1543610ad79ac4cc61c26f8a29c84e4229faa9a3
Parent: e44c22f65f96217692e1a915032fbe7d22236751
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:45 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

Console-writing code for the new x86 setup code

This implements writing text to the console, including printf().

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/printf.c |  307 +++
 arch/i386/boot/tty.c|  112 +
 2 files changed, 419 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/printf.c b/arch/i386/boot/printf.c
new file mode 100644
index 000..1a09f93
--- /dev/null
+++ b/arch/i386/boot/printf.c
@@ -0,0 +1,307 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/printf.c
+ *
+ * Oh, it's a waste of space, but oh-so-yummy for debugging.  This
+ * version of printf() does not include 64-bit support.  Live with
+ * it.
+ *
+ */
+
+#include boot.h
+
+static int skip_atoi(const char **s)
+{
+   int i = 0;
+
+   while (isdigit(**s))
+   i = i * 10 + *((*s)++) - '0';
+   return i;
+}
+
+#define ZEROPAD1   /* pad with zero */
+#define SIGN   2   /* unsigned/signed long */
+#define PLUS   4   /* show plus */
+#define SPACE  8   /* space if plus */
+#define LEFT   16  /* left justified */
+#define SPECIAL32  /* 0x */
+#define LARGE  64  /* use 'ABCDEF' instead of 'abcdef' */
+
+#define do_div(n,base) ({ \
+int __res; \
+__res = ((unsigned long) n) % (unsigned) base; \
+n = ((unsigned long) n) / (unsigned) base; \
+__res; })
+
+static char *number(char *str, long num, int base, int size, int precision,
+   int type)
+{
+   char c, sign, tmp[66];
+   const char *digits = 0123456789abcdefghijklmnopqrstuvwxyz;
+   int i;
+
+   if (type  LARGE)
+   digits = 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ;
+   if (type  LEFT)
+   type = ~ZEROPAD;
+   if (base  2 || base  36)
+   return 0;
+   c = (type  ZEROPAD) ? '0' : ' ';
+   sign = 0;
+   if (type  SIGN) {
+   if (num  0) {
+   sign = '-';
+   num = -num;
+   size--;
+   } else if (type  PLUS) {
+   sign = '+';
+   size--;
+   } else if (type  SPACE) {
+   sign = ' ';
+   size--;
+   }
+   }
+   if (type  SPECIAL) {
+   if (base == 16)
+   size -= 2;
+   else if (base == 8)
+   size--;
+   }
+   i = 0;
+   if (num == 0)
+   tmp[i++] = '0';
+   else
+   while (num != 0)
+   tmp[i++] = digits[do_div(num, base)];
+   if (i  precision)
+   precision = i;
+   size -= precision;
+   if (!(type  (ZEROPAD + LEFT)))
+   while (size--  0)
+   *str++ = ' ';
+   if (sign)
+   *str++ = sign;
+   if (type  SPECIAL) {
+   if (base == 8)
+   *str++ = '0';
+   else if (base == 16) {
+   *str++ = '0';
+   *str++ = digits[33];
+   }
+   }
+   if (!(type  LEFT))
+   while (size--  0)
+   *str++ = c;
+   while (i  precision--)
+   *str++ = '0';
+   while (i--  0)
+   *str++ = tmp[i];
+   while (size--  0)
+   *str++ = ' ';
+   return str;
+}
+
+int vsprintf(char *buf, const char *fmt, va_list args)
+{
+   int len;
+   unsigned long num;
+   int i, base;
+   char *str;
+   const char *s;
+
+   int flags;  /* flags to number() */
+
+   int field_width;/* width of output field */
+   int precision;  /* min. # of digits for integers; max
+  number of chars for from string */
+   int qualifier;  /* 'h', 'l', or 'L' for integer fields */
+
+   for (str = buf; *fmt; ++fmt) {
+   if (*fmt != '%') {
+   *str++ = *fmt;
+

EDD probing code for the new x86 setup code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d13444a5a53b0159e6316a7a7be9890143a5af71
Commit: d13444a5a53b0159e6316a7a7be9890143a5af71
Parent: 31b54f40e12e4d04941762be6615edaf3c6ed811
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:48 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

EDD probing code for the new x86 setup code

Probe EDD and MBR signatures, in order to make it easier to map
physical hard drives to BIOS drives.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/edd.c |  196 ++
 1 files changed, 196 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/edd.c b/arch/i386/boot/edd.c
new file mode 100644
index 000..25a2824
--- /dev/null
+++ b/arch/i386/boot/edd.c
@@ -0,0 +1,196 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/edd.c
+ *
+ * Get EDD BIOS disk information
+ */
+
+#include boot.h
+#include linux/edd.h
+
+#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
+
+struct edd_dapa {
+   u8  pkt_size;
+   u8  rsvd;
+   u16 sector_cnt;
+   u16 buf_off, buf_seg;
+   u64 lba;
+   u64 buf_lin_addr;
+};
+
+/*
+ * Read the MBR (first sector) from a specific device.
+ */
+static int read_mbr(u8 devno, void *buf)
+{
+   struct edd_dapa dapa;
+   u16 ax, bx, cx, dx, si;
+
+   memset(dapa, 0, sizeof dapa);
+   dapa.pkt_size = sizeof(dapa);
+   dapa.sector_cnt = 1;
+   dapa.buf_off = (size_t)buf;
+   dapa.buf_seg = ds();
+   /* dapa.lba = 0; */
+
+   ax = 0x4200;/* Extended Read */
+   si = (size_t)dapa;
+   dx = devno;
+   asm(pushfl; stc; int $0x13; setc %%al; popfl
+   : +a (ax), +S (si), +d (dx)
+   : m (dapa)
+   : ebx, ecx, edi, memory);
+
+   if (!(u8)ax)
+   return 0;   /* OK */
+
+   ax = 0x0201;/* Legacy Read, one sector */
+   cx = 0x0001;/* Sector 0-0-1 */
+   dx = devno;
+   bx = (size_t)buf;
+   asm(pushfl; stc; int $0x13; setc %%al; popfl
+   : +a (ax), +c (cx), +d (dx), +b (bx)
+   : : esi, edi, memory);
+
+   return -(u8)ax; /* 0 or -1 */
+}
+
+static u32 read_mbr_sig(u8 devno, struct edd_info *ei)
+{
+   int sector_size;
+   char *mbrbuf_ptr, *mbrbuf_end;
+   u32 mbrsig;
+   u32 buf_base, mbr_base;
+   extern char _end[];
+   static char mbr_buf[1024];
+
+   sector_size = ei-params.bytes_per_sector;
+   if (!sector_size)
+   sector_size = 512; /* Best available guess */
+
+   buf_base = (ds()  4) + (u32)_end;
+   mbr_base = (buf_base+sector_size-1)  ~(sector_size-1);
+   mbrbuf_ptr = mbr_buf + (mbr_base-buf_base);
+   mbrbuf_end = mbrbuf_ptr + sector_size;
+
+   if (!(boot_params.hdr.loadflags  CAN_USE_HEAP))
+   return 0;
+   if (mbrbuf_end  (char *)(size_t)boot_params.hdr.heap_end_ptr)
+   return 0;
+
+   if (read_mbr(devno, mbrbuf_ptr))
+   return 0;
+
+   mbrsig = *(u32 *)mbrbuf_ptr[EDD_MBR_SIG_OFFSET];
+   return mbrsig;
+}
+
+static int get_edd_info(u8 devno, struct edd_info *ei)
+{
+   u16 ax, bx, cx, dx, di;
+
+   memset(ei, 0, sizeof *ei);
+
+   /* Check Extensions Present */
+
+   ax = 0x4100;
+   bx = EDDMAGIC1;
+   dx = devno;
+   asm(pushfl; stc; int $0x13; setc %%al; popfl
+   : +a (ax), +b (bx), =c (cx), +d (dx)
+   : : esi, edi);
+
+   if ((u8)ax)
+   return -1;  /* No extended information */
+
+   if (bx != EDDMAGIC2)
+   return -1;
+
+   ei-device  = devno;
+   ei-version = ax  8;  /* EDD version number */
+   ei-interface_support = cx; /* EDD functionality subsets */
+
+   /* Extended Get Device Parameters */
+
+   ei-params.length = sizeof(ei-params);
+   ax = 0x4800;
+   dx = devno;
+   asm(pushfl; int $0x13; popfl
+   : +a (ax), +d (dx)
+   : S (ei-params)
+   : ebx, ecx, edi);
+
+   /* Get legacy CHS parameters */
+
+   /* Ralf Brown recommends setting ES:DI to 0:0 */
+   ax = 0x0800;
+   dx = devno;
+   di = 0;
+   asm(pushw %%es; 
+   movw %%di,%%es; 
+   pushfl; stc; int $0x13; setc %%al; popfl; 
+   popw %%es
+   : +a (ax), =b (bx), =c (cx), +d (dx), +D (di)
+   : : 

MCA support for new x86 setup code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b53d3045bbb8ea3c9dce663b102eab0903817c5
Commit: 3b53d3045bbb8ea3c9dce663b102eab0903817c5
Parent: d13444a5a53b0159e6316a7a7be9890143a5af71
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:49 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

MCA support for new x86 setup code

MCA probing support for the new x86 setup code.  This implements the
same functionality as the assembly version.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/mca.c |   43 +++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/mca.c b/arch/i386/boot/mca.c
new file mode 100644
index 000..9b68bd1
--- /dev/null
+++ b/arch/i386/boot/mca.c
@@ -0,0 +1,43 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/mca.c
+ *
+ * Get the MCA system description table
+ */
+
+#include boot.h
+
+int query_mca(void)
+{
+   u8 err;
+   u16 es, bx, len;
+
+   asm(pushw %%es ; 
+   int $0x15 ; 
+   setc %0 ; 
+   movw %%es, %1 ; 
+   popw %%es
+   : =acdSDm (err), =acdSDm (es), =b (bx)
+   : a (0xc000));
+
+   if (err)
+   return -1;  /* No MCA present */
+
+   set_fs(es);
+   len = rdfs16(bx);
+
+   if (len  sizeof(boot_params.sys_desc_table))
+   len = sizeof(boot_params.sys_desc_table);
+
+   copy_from_fs(boot_params.sys_desc_table, bx, len);
+   return 0;
+}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Memory probing support for the new x86 setup code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=449f2ab946b5ffbc357d815e8e3cce8def642984
Commit: 449f2ab946b5ffbc357d815e8e3cce8def642984
Parent: 3b53d3045bbb8ea3c9dce663b102eab0903817c5
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:50 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

Memory probing support for the new x86 setup code

Probe memory (INT 15h: E820, E801, 88).

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/memory.c |   99 +++
 1 files changed, 99 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/memory.c b/arch/i386/boot/memory.c
new file mode 100644
index 000..1a2e62d
--- /dev/null
+++ b/arch/i386/boot/memory.c
@@ -0,0 +1,99 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/memory.c
+ *
+ * Memory detection code
+ */
+
+#include boot.h
+
+#define SMAP   0x534d4150  /* ASCII SMAP */
+
+static int detect_memory_e820(void)
+{
+   u32 next = 0;
+   u32 size, id;
+   u8 err;
+   struct e820entry *desc = boot_params.e820_map;
+
+   do {
+   size = sizeof(struct e820entry);
+   id = SMAP;
+   asm(int $0x15; setc %0
+   : =am (err), +b (next), +d (id), +c (size),
+ =m (*desc)
+   : D (desc), a (0xe820));
+
+   if (err || id != SMAP)
+   break;
+
+   boot_params.e820_entries++;
+   desc++;
+   } while (next  boot_params.e820_entries  E820MAX);
+
+   return boot_params.e820_entries;
+}
+
+static int detect_memory_e801(void)
+{
+   u16 ax, bx, cx, dx;
+   u8 err;
+
+   bx = cx = dx = 0;
+   ax = 0xe801;
+   asm(stc; int $0x15; setc %0
+   : =m (err), +a (ax), +b (bx), +c (cx), +d (dx));
+
+   if (err)
+   return -1;
+
+   /* Do we really need to do this? */
+   if (cx || dx) {
+   ax = cx;
+   bx = dx;
+   }
+
+   if (ax  15*1024)
+   return -1;  /* Bogus! */
+
+   /* This ignores memory above 16MB if we have a memory hole
+  there.  If someone actually finds a machine with a memory
+  hole at 16MB and no support for 0E820h they should probably
+  generate a fake e820 map. */
+   boot_params.alt_mem_k = (ax == 15*1024) ? (dx  6)+ax : ax;
+
+   return 0;
+}
+
+static int detect_memory_88(void)
+{
+   u16 ax;
+   u8 err;
+
+   ax = 0x8800;
+   asm(stc; int $0x15; setc %0 : =bcdm (err), +a (ax));
+
+   boot_params.screen_info.ext_mem_k = ax;
+
+   return -err;
+}
+
+int detect_memory(void)
+{
+   if (detect_memory_e820()  0)
+   return 0;
+
+   if (!detect_memory_e801())
+   return 0;
+
+   return detect_memory_88();
+}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Voyager support for the new x86 setup code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=337496eb73ec970fe008095fdb2b2af60a2a7fa3
Commit: 337496eb73ec970fe008095fdb2b2af60a2a7fa3
Parent: 449f2ab946b5ffbc357d815e8e3cce8def642984
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:51 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

Voyager support for the new x86 setup code

Voyager support for the new x86 setup code.  This implements the same
functionality as the assembly version.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/voyager.c |   46 ++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/voyager.c b/arch/i386/boot/voyager.c
new file mode 100644
index 000..9221614
--- /dev/null
+++ b/arch/i386/boot/voyager.c
@@ -0,0 +1,46 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/voyager.c
+ *
+ * Get the Voyager config information
+ */
+
+#include boot.h
+
+#ifdef CONFIG_X86_VOYAGER
+
+int query_voyager(void)
+{
+   u8 err;
+   u16 es, di;
+   /* Abuse the apm_bios_info area for this */
+   u8 *data_ptr = (u8 *)boot_params.apm_bios_info;
+
+   data_ptr[0] = 0xff; /* Flag on config not found(?) */
+
+   asm(pushw %%es ; 
+   int $0x15 ; 
+   setc %0 ; 
+   movw %%es, %1 ; 
+   popw %%es
+   : =qm (err), =rm (es), =D (di)
+   : a (0xffc0));
+
+   if (err)
+   return -1;  /* Not Voyager */
+
+   set_fs(es);
+   copy_from_fs(data_ptr, di, 7);  /* Table is 7 bytes apparently */
+   return 0;
+}
+
+#endif /* CONFIG_X86_VOYAGER */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Video mode probing support for the new x86 setup code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e8ddcbe8692ca9854991c6875d302fa7e424e3c
Commit: 5e8ddcbe8692ca9854991c6875d302fa7e424e3c
Parent: 337496eb73ec970fe008095fdb2b2af60a2a7fa3
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:52 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

Video mode probing support for the new x86 setup code

Video mode probing for the new x86 setup code.  This code breaks down
different drivers into modules.  This code deliberately drops support
for a lot of the vendor-specific mode probing present in the assembly
version, since a lot of those probes have been found to be stale in
current versions of those chips -- frequently, support for those modes
have been dropped from recent video BIOSes due to space constraints,
but the video BIOS signatures are still the same.

However, additional drivers should be extremely straightforward to plug
in, if desirable.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/vesa.h   |   79 
 arch/i386/boot/video-bios.c |  125 
 arch/i386/boot/video-vesa.c |  284 +++
 arch/i386/boot/video-vga.c  |  260 
 arch/i386/boot/video.c  |  456 +++
 arch/i386/boot/video.h  |  145 ++
 6 files changed, 1349 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/vesa.h b/arch/i386/boot/vesa.h
new file mode 100644
index 000..ff5b73c
--- /dev/null
+++ b/arch/i386/boot/vesa.h
@@ -0,0 +1,79 @@
+/* --- *
+ *
+ *   Copyright 1999-2007 H. Peter Anvin - All Rights Reserved
+ *
+ *   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, Inc., 53 Temple Place Ste 330,
+ *   Boston MA 02111-1307, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * --- */
+
+#ifndef BOOT_VESA_H
+#define BOOT_VESA_H
+
+typedef struct {
+   u16 off, seg;
+} far_ptr;
+
+/* VESA General Information table */
+struct vesa_general_info {
+   u32 signature;  /* 0 Magic number = VESA */
+   u16 version;/* 4 */
+   far_ptr vendor_string;  /* 6 */
+   u32 capabilities;   /* 10 */
+   far_ptr video_mode_ptr; /* 14 */
+   u16 total_memory;   /* 18 */
+
+   u16 oem_software_rev;   /* 20 */
+   far_ptr oem_vendor_name_ptr;/* 22 */
+   far_ptr oem_product_name_ptr;   /* 26 */
+   far_ptr oem_product_rev_ptr;/* 30 */
+
+   u8 reserved[222];   /* 34 */
+   u8 oem_data[256];   /* 256 */
+} __attribute__ ((packed));
+
+#define VESA_MAGIC ('V' + ('E'  8) + ('S'  16) + ('A'  24))
+#define VBE2_MAGIC ('V' + ('B'  8) + ('E'  16) + ('2'  24))
+
+struct vesa_mode_info {
+   u16 mode_attr;  /* 0 */
+   u8 win_attr[2]; /* 2 */
+   u16 win_grain;  /* 4 */
+   u16 win_size;   /* 6 */
+   u16 win_seg[2]; /* 8 */
+   far_ptr win_scheme; /* 12 */
+   u16 logical_scan;   /* 16 */
+
+   u16 h_res;  /* 18 */
+   u16 v_res;  /* 20 */
+   u8 char_width;  /* 22 */
+   u8 char_height; /* 23 */
+   u8 memory_planes;   /* 24 */
+   u8 bpp; /* 25 */
+   u8 banks;   /* 26 */
+   u8 memory_layout;   /* 27 */
+   u8 bank_size;   /* 28 */
+   u8 image_planes;/* 29 */
+   u8 page_function;   /* 30 */
+
+   u8 rmask;   /* 31 */
+   u8 rpos;/* 32 */
+   u8 gmask;   /* 33 */
+   u8 gpos;/* 34 */
+   u8 bmask;   /* 35 */
+   u8 bpos;/* 36 */
+   u8 resv_mask;   /* 37 */
+   u8 resv_pos;/* 38 */
+   u8 dcm_info;/* 39 */
+
+   u32 lfb_ptr;/* 40 Linear frame buffer address */
+   u32 offscreen_ptr;  /* 44 Offscreen memory address */
+   u16 offscreen_size; /* 48 */
+
+   u8 reserved[206];   /* 50 */
+} __attribute__ ((packed));
+
+#endif /* LIB_SYS_VESA_H */
diff --git a/arch/i386/boot/video-bios.c b/arch/i386/boot/video-bios.c
new file mode 100644
index 000..afea46c
--- /dev/null
+++ b/arch/i386/boot/video-bios.c
@@ -0,0 +1,125 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All 

Code for actual protected-mode entry

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7052fdd890bda0b3904674b69a1d24aec0a10d67
Commit: 7052fdd890bda0b3904674b69a1d24aec0a10d67
Parent: 5e8ddcbe8692ca9854991c6875d302fa7e424e3c
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:53 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

Code for actual protected-mode entry

This is the code which actually does the switch to protected mode,
including all preparation.  It is also responsible for invoking the
boot loader hooks, if present.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/pm.c |  170 +++
 arch/i386/boot/pmjump.S |   54 +++
 2 files changed, 224 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/pm.c b/arch/i386/boot/pm.c
new file mode 100644
index 000..3fa53e1
--- /dev/null
+++ b/arch/i386/boot/pm.c
@@ -0,0 +1,170 @@
+/* -*- linux-c -*- --- *
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *
+ *   This file is part of the Linux kernel, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * --- */
+
+/*
+ * arch/i386/boot/pm.c
+ *
+ * Prepare the machine for transition to protected mode.
+ */
+
+#include boot.h
+#include asm/segment.h
+
+/*
+ * Invoke the realmode switch hook if present; otherwise
+ * disable all interrupts.
+ */
+static void realmode_switch_hook(void)
+{
+   if (boot_params.hdr.realmode_swtch) {
+   asm volatile(lcallw *%0
+: : m (boot_params.hdr.realmode_swtch)
+: eax, ebx, ecx, edx);
+   } else {
+   asm volatile(cli);
+   outb(0x80, 0x70); /* Disable NMI */
+   io_delay();
+   }
+}
+
+/*
+ * A zImage kernel is loaded at 0x1 but wants to run at 0x1000.
+ * A bzImage kernel is loaded and runs at 0x10.
+ */
+static void move_kernel_around(void)
+{
+   /* Note: rely on the compile-time option here rather than
+  the LOADED_HIGH flag.  The Qemu kernel loader unconditionally
+  sets the loadflags to zero. */
+#ifndef __BIG_KERNEL__
+   u16 dst_seg, src_seg;
+   u32 syssize;
+
+   dst_seg =  0x1000  4;
+   src_seg = 0x1  4;
+   syssize = boot_params.hdr.syssize; /* Size in 16-byte paragraphs */
+
+   while (syssize) {
+   int paras  = (syssize = 0x1000) ? 0x1000 : syssize;
+   int dwords = paras  2;
+
+   asm volatile(pushw %%es ; 
+pushw %%ds ; 
+movw %1,%%es ; 
+movw %2,%%ds ; 
+xorw %%di,%%di ; 
+xorw %%si,%%si ; 
+rep;movsl ; 
+popw %%ds ; 
+popw %%es
+: +c (dwords)
+: rm (dst_seg), rm (src_seg)
+: esi, edi);
+
+   syssize -= paras;
+   dst_seg += paras;
+   src_seg += paras;
+   }
+#endif
+}
+
+/*
+ * Disable all interrupts at the legacy PIC.
+ */
+static void mask_all_interrupts(void)
+{
+   outb(0xff, 0xa1);   /* Mask all interrupts on the seconday PIC */
+   io_delay();
+   outb(0xfb, 0x21);   /* Mask all but cascade on the primary PIC */
+   io_delay();
+}
+
+/*
+ * Reset IGNNE# if asserted in the FPU.
+ */
+static void reset_coprocessor(void)
+{
+   outb(0, 0xf0);
+   io_delay();
+   outb(0, 0xf1);
+   io_delay();
+}
+
+/*
+ * Set up the GDT
+ */
+#define GDT_ENTRY(flags,base,limit)\
+   (((u64)(base  0xff00)  32) | \
+((u64)flags  40) |   \
+((u64)(limit  0x00ff)  32) |\
+((u64)(base  0x0000)  16) | \
+((u64)(limit  0x)))
+
+struct gdt_ptr {
+   u16 len;
+   u32 ptr;
+} __attribute__((packed));
+
+static void setup_gdt(void)
+{
+   /* There are machines which are known to not boot with the GDT
+  being 8-byte unaligned.  Intel recommends 16 byte alignment. */
+   static const u64 boot_gdt[] __attribute__((aligned(16))) = {
+   /* CS: code, read/execute, 4 GB, base 0 */
+   [GDT_ENTRY_BOOT_CS] = GDT_ENTRY(0xc09b, 0, 0xf),
+   /* DS: data, read/write, 4 GB, base 0 */
+   [GDT_ENTRY_BOOT_DS] = GDT_ENTRY(0xc093, 0, 0xf),
+   };
+   struct gdt_ptr gdt;
+
+   gdt.len = sizeof(boot_gdt)-1;
+   gdt.ptr = (u32)boot_gdt + (ds()  4);
+
+   

Assembly header and main routine for new x86 setup code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=626073132b381684c4983e0d911e9aceb32e2cbc
Commit: 626073132b381684c4983e0d911e9aceb32e2cbc
Parent: 7052fdd890bda0b3904674b69a1d24aec0a10d67
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:54 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

Assembly header and main routine for new x86 setup code

The assembly header and initialization code, and the main() routine.
main.c also contains some miscellaneous very short routines.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/header.S |  283 +++
 arch/i386/boot/main.c   |  161 +++
 2 files changed, 444 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/header.S b/arch/i386/boot/header.S
new file mode 100644
index 000..6b9923f
--- /dev/null
+++ b/arch/i386/boot/header.S
@@ -0,0 +1,283 @@
+/*
+ * header.S
+ *
+ * Copyright (C) 1991, 1992 Linus Torvalds
+ *
+ * Based on bootsect.S and setup.S
+ * modified by more people than can be counted
+ *
+ * Rewritten as a common file by H. Peter Anvin (Apr 2007)
+ *
+ * BIG FAT NOTE: We're in real mode using 64k segments.  Therefore segment
+ * addresses must be multiplied by 16 to obtain their respective linear
+ * addresses. To avoid confusion, linear addresses are written using leading
+ * hex while segment addresses are written as segment:offset.
+ *
+ */
+
+#include asm/segment.h
+#include linux/utsrelease.h
+#include asm/boot.h
+#include asm/e820.h
+#include asm/page.h
+#include asm/setup.h
+#include boot.h
+
+SETUPSECTS = 4 /* default nr of setup-sectors */
+BOOTSEG= 0x07C0/* original address of 
boot-sector */
+SYSSEG = DEF_SYSSEG/* system loaded at 0x1 (65536) */
+SYSSIZE= DEF_SYSSIZE   /* system size: # of 16-byte 
clicks */
+   /* to be loaded */
+ROOT_DEV   = 0 /* ROOT_DEV is now written by build */
+SWAP_DEV   = 0 /* SWAP_DEV is now written by build */
+
+#ifndef SVGA_MODE
+#define SVGA_MODE ASK_VGA
+#endif
+
+#ifndef RAMDISK
+#define RAMDISK 0
+#endif
+
+#ifndef ROOT_RDONLY
+#define ROOT_RDONLY 1
+#endif
+
+   .code16
+   .section .bstext, ax
+
+   .global bootsect_start
+bootsect_start:
+
+   # Normalize the start address
+   ljmp$BOOTSEG, $start2
+
+start2:
+   movw%cs, %ax
+   movw%ax, %ds
+   movw%ax, %es
+   movw%ax, %ss
+   xorw%sp, %sp
+   sti
+   cld
+
+   movw$bugger_off_msg, %si
+
+msg_loop:
+   lodsb
+   andb%al, %al
+   jz  bs_die
+   movb$0xe, %ah
+   movw$7, %bx
+   int $0x10
+   jmp msg_loop
+
+bs_die:
+   # Allow the user to press a key, then reboot
+   xorw%ax, %ax
+   int $0x16
+   int $0x19
+
+   # int 0x19 should never return.  In case it does anyway,
+   # invoke the BIOS reset code...
+   ljmp$0xf000,$0xfff0
+
+   .section .bsdata, a
+bugger_off_msg:
+   .ascii  Direct booting from floppy is no longer supported.\r\n
+   .ascii  Please use a boot loader program instead.\r\n
+   .ascii  \n
+   .ascii  Remove disk and press any key to reboot . . .\r\n
+   .byte   0
+
+
+   # Kernel attributes; used by setup.  This is part 1 of the
+   # header, from the old boot sector.
+
+   .section .header, a
+   .globl  hdr
+hdr:
+setup_sects:   .byte SETUPSECTS
+root_flags:.word ROOT_RDONLY
+syssize:   .long SYSSIZE
+ram_size:  .word RAMDISK
+vid_mode:  .word SVGA_MODE
+root_dev:  .word ROOT_DEV
+boot_flag: .word 0xAA55
+
+   # offset 512, entry point
+
+   .globl  _start
+_start:
+   # Explicitly enter this as bytes, or the assembler
+   # tries to generate a 3-byte jump here, which causes
+   # everything else to push off to the wrong offset.
+   .byte   0xeb# short (2-byte) jump
+   .byte   start_of_setup-1f
+1:
+
+   # Part 2 of the header, from the old setup.S
+
+   .ascii  HdrS  # header signature
+   .word   0x0206  # header version number (= 0x0105)
+   # or else old loadlin-1.5 will fail)
+   .globl realmode_swtch
+realmode_swtch:.word   0, 0# default_switch, SETUPSEG
+start_sys_seg: .word   SYSSEG
+   .word   kernel_version-512 # pointing to kernel version string
+   # above section of header is compatible
+   # with loadlin-1.5 (header 

Linker script for the new x86 setup code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2d98ae63dc64dedb00499289e13a50677f771f9
Commit: f2d98ae63dc64dedb00499289e13a50677f771f9
Parent: 626073132b381684c4983e0d911e9aceb32e2cbc
Author: H. Peter Anvin [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 12:18:55 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu Jul 12 10:55:55 2007 -0700

Linker script for the new x86 setup code

Linker script to define the layout of the new x86 setup code.
Includes assert for size overflow and a misaligned setup header.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/boot/setup.ld |   54 +++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/arch/i386/boot/setup.ld b/arch/i386/boot/setup.ld
new file mode 100644
index 000..df9234b
--- /dev/null
+++ b/arch/i386/boot/setup.ld
@@ -0,0 +1,54 @@
+/*
+ * setup.ld
+ *
+ * Linker script for the i386 setup code
+ */
+OUTPUT_FORMAT(elf32-i386, elf32-i386, elf32-i386)
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+
+SECTIONS
+{
+   . = 0;
+   .bstext : { *(.bstext) }
+   .bsdata : { *(.bsdata) }
+
+   . = 497;
+   .header : { *(.header) }
+   .inittext   : { *(.inittext) }
+   .initdata   : { *(.initdata) }
+   .text   : { *(.text*) }
+
+   . = ALIGN(16);
+   .rodata : { *(.rodata*) }
+
+   .videocards : {
+   video_cards = .;
+   *(.videocards)
+   video_cards_end = .;
+   }
+
+   . = ALIGN(16);
+   .data   : { *(.data*) }
+
+   .signature  : {
+   setup_sig = .;
+   LONG(0x5a5aaa55)
+   }
+
+
+   . = ALIGN(16);
+   .bss:
+   {
+   __bss_start = .;
+   *(.bss)
+   __bss_end = .;
+   }
+   . = ALIGN(16);
+   _end = .;
+
+   /DISCARD/ : { *(.note*) }
+
+   . = ASSERT(_end = 0x8000, Setup too big!);
+   . = ASSERT(hdr == 0x1f1, The setup header has the wrong offset!);
+}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c: Add kernel documentation

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d64f73be1b59b9556de0a8fbd4f1a003c6a45a5c
Commit: d64f73be1b59b9556de0a8fbd4f1a003c6a45a5c
Parent: 4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4
Author: David Brownell [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:28 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:28 2007 +0200

i2c: Add kernel documentation

Generate I2C kerneldoc; fix various glitches and add context sections to
that documentation.  Most I2C and SMBus functions still have no kerneldoc.

Let me suggest providing kerneldoc for all the i2c_smbus_*() functions as
a small and mostly self-contained project for anyone so inclined.  :)

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 Documentation/DocBook/kernel-api.tmpl |   55 +
 drivers/i2c/i2c-core.c|   13 
 include/linux/i2c.h   |   11 +--
 3 files changed, 76 insertions(+), 3 deletions(-)

diff --git a/Documentation/DocBook/kernel-api.tmpl 
b/Documentation/DocBook/kernel-api.tmpl
index 8c5698a..46bcff2 100644
--- a/Documentation/DocBook/kernel-api.tmpl
+++ b/Documentation/DocBook/kernel-api.tmpl
@@ -643,6 +643,60 @@ X!Idrivers/video/console/fonts.c
 !Edrivers/spi/spi.c
   /chapter
 
+  chapter id=i2c
+ titleIsuperscript2/superscriptC and SMBus Subsystem/title
+
+ para
+   Isuperscript2/superscriptC (or without fancy typography, I2C)
+   is an acronym for the Inter-IC bus, a simple bus protocol which is
+   widely used where low data rate communications suffice.
+   Since it's also a licensed trademark, some vendors use another
+   name (such as Two-Wire Interface, TWI) for the same bus.
+   I2C only needs two signals (SCL for clock, SDA for data), conserving
+   board real estate and minimizing signal quality issues.
+   Most I2C devices use seven bit addresses, and bus speeds of up
+   to 400 kHz; there's a high speed extension (3.4 MHz) that's not yet
+   found wide use.
+   I2C is a multi-master bus; open drain signaling is used to
+   arbitrate between masters, as well as to handshake and to
+   synchronize clocks from slower clients.
+ /para
+
+ para
+   The Linux I2C programming interfaces support only the master
+   side of bus interactions, not the slave side.
+   The programming interface is structured around two kinds of driver,
+   and two kinds of device.
+   An I2C Adapter Driver abstracts the controller hardware; it binds
+   to a physical device (perhaps a PCI device or platform_device) and
+   exposes a structnamestruct i2c_adapter/structname representing
+   each I2C bus segment it manages.
+   On each I2C bus segment will be I2C devices represented by a
+   structnamestruct i2c_client/structname.  Those devices will
+   be bound to a structnamestruct i2c_driver/structname,
+   which should follow the standard Linux driver model.
+   (At this writing, a legacy model is more widely used.)
+   There are functions to perform various I2C protocol operations; at
+   this writing all such functions are usable only from task context.
+ /para
+
+ para
+   The System Management Bus (SMBus) is a sibling protocol.  Most SMBus
+   systems are also I2C conformant.  The electrical constraints are
+   tighter for SMBus, and it standardizes particular protocol messages
+   and idioms.  Controllers that support I2C can also support most
+   SMBus operations, but SMBus controllers don't support all the protocol
+   options that an I2C controller will.
+   There are functions to perform various SMBus protocol operations,
+   either using I2C primitives or by issuing SMBus commands to
+   i2c_adapter devices which don't support those I2C operations.
+ /para
+
+!Iinclude/linux/i2c.h
+!Fdrivers/i2c/i2c-boardinfo.c i2c_register_board_info
+!Edrivers/i2c/i2c-core.c
+  /chapter
+
   chapter id=splice
   titlesplice API/title
   para)
@@ -654,4 +708,5 @@ X!Idrivers/video/console/fonts.c
 !Ffs/splice.c
   /chapter
 
+
 /book
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 435925e..cccfa86 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -207,6 +207,7 @@ EXPORT_SYMBOL_GPL(i2c_bus_type);
  * i2c_new_device - instantiate an i2c device for use with a new style driver
  * @adap: the adapter managing the device
  * @info: describes one I2C device; bus_num is ignored
+ * Context: can sleep
  *
  * Create a device to work with a new style i2c driver, where binding is
  * handled through driver model probe()/remove() methods.  This call is not
@@ -255,6 +256,7 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
 /**
  * i2c_unregister_device - reverse effect of i2c_new_device()
  * @client: value returned from 

i2c: Fix sparse warning in i2c.h

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d75d53cd571c02990d56e72f615ab11e943772f9
Commit: d75d53cd571c02990d56e72f615ab11e943772f9
Parent: d64f73be1b59b9556de0a8fbd4f1a003c6a45a5c
Author: Mark M. Hoffman [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:28 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:28 2007 +0200

i2c: Fix sparse warning in i2c.h

Kill a sparse warning by un-nesting two container_of() calls.

Signed-off-by: Mark M. Hoffman [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 include/linux/i2c.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index a24e267..44f2ecf 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -185,7 +185,8 @@ struct i2c_client {
 
 static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
 {
-   return to_i2c_client(container_of(kobj, struct device, kobj));
+   struct device * const dev = container_of(kobj, struct device, kobj);
+   return to_i2c_client(dev);
 }
 
 static inline void *i2c_get_clientdata (struct i2c_client *dev)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


scx200_acb: Use mutex instead of semaphore

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d9c01ceff00fcba50043f500cac471ecf6752c9
Commit: 9d9c01ceff00fcba50043f500cac471ecf6752c9
Parent: d75d53cd571c02990d56e72f615ab11e943772f9
Author: Matthias Kaehlcke [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:28 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:28 2007 +0200

scx200_acb: Use mutex instead of semaphore

The scx200_acb driver use a semaphore as mutex.  Use the mutex API
instead of the (binary) semaphore.

Signed-off-by: Matthias Kaehlcke [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Cc: Jordan Crouse [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/scx200_acb.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 0d6bd4f..dc64f8b 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -388,7 +388,7 @@ static const struct i2c_algorithm scx200_acb_algorithm = {
 };
 
 static struct scx200_acb_iface *scx200_acb_list;
-static DECLARE_MUTEX(scx200_acb_list_mutex);
+static DEFINE_MUTEX(scx200_acb_list_mutex);
 
 static __init int scx200_acb_probe(struct scx200_acb_iface *iface)
 {
@@ -472,10 +472,10 @@ static int __init scx200_acb_create(struct 
scx200_acb_iface *iface)
return -ENODEV;
}
 
-   down(scx200_acb_list_mutex);
+   mutex_lock(scx200_acb_list_mutex);
iface-next = scx200_acb_list;
scx200_acb_list = iface;
-   up(scx200_acb_list_mutex);
+   mutex_unlock(scx200_acb_list_mutex);
 
return 0;
 }
@@ -633,10 +633,10 @@ static void __exit scx200_acb_cleanup(void)
 {
struct scx200_acb_iface *iface;
 
-   down(scx200_acb_list_mutex);
+   mutex_lock(scx200_acb_list_mutex);
while ((iface = scx200_acb_list) != NULL) {
scx200_acb_list = iface-next;
-   up(scx200_acb_list_mutex);
+   mutex_unlock(scx200_acb_list_mutex);
 
i2c_del_adapter(iface-adapter);
 
@@ -648,9 +648,9 @@ static void __exit scx200_acb_cleanup(void)
release_region(iface-base, 8);
 
kfree(iface);
-   down(scx200_acb_list_mutex);
+   mutex_lock(scx200_acb_list_mutex);
}
-   up(scx200_acb_list_mutex);
+   mutex_unlock(scx200_acb_list_mutex);
 }
 
 module_init(scx200_acb_init);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c: Delete outdated x1205 driver documentation

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=890e037509f5b3f967b16ea0ea525c7c75b213ae
Commit: 890e037509f5b3f967b16ea0ea525c7c75b213ae
Parent: 9d9c01ceff00fcba50043f500cac471ecf6752c9
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:28 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:28 2007 +0200

i2c: Delete outdated x1205 driver documentation

The x1205 driver moved to the RTC subsystem and was significantly
modified since then, so just delete the outdated documentation.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Cc: Alessandro Zummo [EMAIL PROTECTED]
---
 Documentation/i2c/chips/x1205 |   38 --
 drivers/rtc/rtc-x1205.c   |5 -
 2 files changed, 4 insertions(+), 39 deletions(-)

diff --git a/Documentation/i2c/chips/x1205 b/Documentation/i2c/chips/x1205
deleted file mode 100644
index 09407c9..000
--- a/Documentation/i2c/chips/x1205
+++ /dev/null
@@ -1,38 +0,0 @@
-Kernel driver x1205
-===
-
-Supported chips:
-  * Xicor X1205 RTC
-Prefix: 'x1205'
-Addresses scanned: none
-Datasheet: http://www.intersil.com/cda/deviceinfo/0,1477,X1205,00.html
-
-Authors:
-   Karen Spearel [EMAIL PROTECTED],
-   Alessandro Zummo [EMAIL PROTECTED]
-
-Description

-
-This module aims to provide complete access to the Xicor X1205 RTC.
-Recently Xicor has merged with Intersil, but the chip is
-still sold under the Xicor brand.
-
-This chip is located at address 0x6f and uses a 2-byte register addressing.
-Two bytes need to be written to read a single register, while most
-other chips just require one and take the second one as the data
-to be written. To prevent corrupting unknown chips, the user must
-explicitely set the probe parameter.
-
-example:
-
-modprobe x1205 probe=0,0x6f
-
-The module supports one more option, hctosys, which is used to set the
-software clock from the x1205. On systems where the x1205 is the
-only hardware rtc, this parameter could be used to achieve a correct
-date/time earlier in the system boot sequence.
-
-example:
-
-modprobe x1205 probe=0,0x6f hctosys=1
diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c
index 513d1a6..b3fae35 100644
--- a/drivers/rtc/rtc-x1205.c
+++ b/drivers/rtc/rtc-x1205.c
@@ -9,6 +9,9 @@
  *
  * based on a lot of other RTC drivers.
  *
+ * Information and datasheet:
+ * http://www.intersil.com/cda/deviceinfo/0,1477,X1205,00.html
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -26,7 +29,7 @@
  * Two bytes need to be written to read a single register,
  * while most other chips just require one and take the second
  * one as the data to be written. To prevent corrupting
- * unknown chips, the user must explicitely set the probe parameter.
+ * unknown chips, the user must explicitly set the probe parameter.
  */
 
 static unsigned short normal_i2c[] = { I2C_CLIENT_END };
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c: Deprecate legacy RTC drivers

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ba7fbb723f50ab2607989a282af655fb0fab0492
Commit: ba7fbb723f50ab2607989a282af655fb0fab0492
Parent: 890e037509f5b3f967b16ea0ea525c7c75b213ae
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:29 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:29 2007 +0200

i2c: Deprecate legacy RTC drivers

We have a new RTC subsystem with better drivers.

Legacy driver status:
* ds1337: The DS1337 and DS1339 are now supported by the rtc-ds1307
  driver, so it looks to me like we could even delete the ds1337
  driver right away.
* ds1374: Will soon be replaced with Scott Wood's rtc-ds1374 driver.
* m41t00: The M41T00 is supported by the rtc-ds1307 driver. For the
  M41T81 and M41T85, the rtc-m41t80 driver written by Atsushi Nemoto
  should work.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Cc: Alessandro Zummo [EMAIL PROTECTED]
Acked-by: Mark A. Greer [EMAIL PROTECTED]
Acked-by: James Chapman [EMAIL PROTECTED]
Cc: Randy Vinson [EMAIL PROTECTED]
---
 Documentation/feature-removal-schedule.txt |7 +++
 drivers/i2c/chips/Kconfig  |   15 ---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/Documentation/feature-removal-schedule.txt 
b/Documentation/feature-removal-schedule.txt
index 3a159da..281458b 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -330,3 +330,10 @@ Who:  Tejun Heo [EMAIL PROTECTED]
 
 ---
 
+What:  Legacy RTC drivers (under drivers/i2c/chips)
+When:  November 2007
+Why:   Obsolete. We have a RTC subsystem with better drivers.
+Who:   Jean Delvare [EMAIL PROTECTED]
+
+---
+
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index ea085a0..8113ce2 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -5,7 +5,7 @@
 menu Miscellaneous I2C Chip support
 
 config SENSORS_DS1337
-   tristate Dallas Semiconductor DS1337 and DS1339 Real Time Clock
+   tristate Dallas DS1337 and DS1339 Real Time Clock (DEPRECATED)
depends on EXPERIMENTAL
help
  If you say yes here you get support for Dallas Semiconductor
@@ -14,8 +14,11 @@ config SENSORS_DS1337
  This driver can also be built as a module.  If so, the module
  will be called ds1337.
 
+ This driver is deprecated and will be dropped soon. Use
+ rtc-ds1307 instead.
+
 config SENSORS_DS1374
-   tristate Maxim/Dallas Semiconductor DS1374 Real Time Clock
+   tristate Dallas DS1374 Real Time Clock (DEPRECATED)
depends on EXPERIMENTAL
help
  If you say yes here you get support for Dallas Semiconductor
@@ -24,6 +27,9 @@ config SENSORS_DS1374
  This driver can also be built as a module.  If so, the module
  will be called ds1374.
 
+ This driver is deprecated and will be dropped soon. Use
+ rtc-ds1374 instead.
+
 config SENSORS_EEPROM
tristate EEPROM reader
depends on EXPERIMENTAL
@@ -101,7 +107,7 @@ config TPS65010
  will be called tps65010.
 
 config SENSORS_M41T00
-   tristate ST M41T00 RTC chip
+   tristate ST M41T00 RTC chip (DEPRECATED)
depends on PPC32
help
  If you say yes here you get support for the ST M41T00 RTC chip.
@@ -109,6 +115,9 @@ config SENSORS_M41T00
  This driver can also be built as a module.  If so, the module
  will be called m41t00.
 
+ This driver is deprecated and will be dropped soon. Use
+ rtc-ds1307 or rtc-m41t80 instead.
+
 config SENSORS_MAX6875
tristate Maxim MAX6875 Power supply supervisor
depends on EXPERIMENTAL
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c: Fix the i2c_smbus_read_i2c_block_data() prototype

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4b2643d7d9bdcd776749e17f73c168ddf02e93cb
Commit: 4b2643d7d9bdcd776749e17f73c168ddf02e93cb
Parent: ba7fbb723f50ab2607989a282af655fb0fab0492
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:29 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:29 2007 +0200

i2c: Fix the i2c_smbus_read_i2c_block_data() prototype

Let the drivers specify how many bytes they want to read with
i2c_smbus_read_i2c_block_data(). So far, the block count was
hard-coded to I2C_SMBUS_BLOCK_MAX (32), which did not make much sense.
Many driver authors complained about this before, and I believe it's
about time to fix it. Right now, authors have to do technically stupid
things, such as individual byte reads or full-fledged I2C messaging,
to work around the problem. We do not want to encourage that.

I even found that some bus drivers (e.g. i2c-amd8111) already
implemented I2C block read the right way, that is, they didn't
follow the old, broken standard. The fact that it was never noticed
before just shows how little i2c_smbus_read_i2c_block_data() was used,
which isn't that surprising given how broken its prototype was so far.

There are some obvious compatiblity considerations:
* This changes the i2c_smbus_read_i2c_block_data() prototype. Users
  outside the kernel tree will notice at compilation time, and will
  have to update their code.
* User-space has access to i2c_smbus_xfer() directly using i2c-dev, so
  the changed expectations would affect tools such as i2cdump. In order
  to preserve binary compatibility, we give I2C_SMBUS_I2C_BLOCK_DATA
  a new numeric value, and define I2C_SMBUS_I2C_BLOCK_BROKEN with the
  old numeric value. When i2c-dev receives a transaction with the
  old value, it can convert it to the new format on the fly.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 Documentation/i2c/chips/max6875  |2 +-
 Documentation/i2c/writing-clients|2 +-
 drivers/i2c/busses/i2c-powermac.c|3 +--
 drivers/i2c/busses/i2c-viapro.c  |2 +-
 drivers/i2c/busses/scx200_acb.c  |2 --
 drivers/i2c/chips/eeprom.c   |6 --
 drivers/i2c/chips/max6875.c  |1 +
 drivers/i2c/i2c-core.c   |   12 +++-
 drivers/i2c/i2c-dev.c|9 +
 drivers/macintosh/windfarm_smu_sat.c |   28 
 include/linux/i2c.h  |5 +++--
 11 files changed, 32 insertions(+), 40 deletions(-)

diff --git a/Documentation/i2c/chips/max6875 b/Documentation/i2c/chips/max6875
index 96fec56..a0cd8af 100644
--- a/Documentation/i2c/chips/max6875
+++ b/Documentation/i2c/chips/max6875
@@ -99,7 +99,7 @@ And then read the data
 
   or
 
-  count = i2c_smbus_read_i2c_block_data(fd, 0x84, buffer);
+  count = i2c_smbus_read_i2c_block_data(fd, 0x84, 16, buffer);
 
 The block read should read 16 bytes.
 0x84 is the block read command.
diff --git a/Documentation/i2c/writing-clients 
b/Documentation/i2c/writing-clients
index 3d8d36b..2c17003 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -571,7 +571,7 @@ SMBus communication
 u8 command, u8 length,
 u8 *values);
   extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
-   u8 command, u8 *values);
+   u8 command, u8 length, u8 *values);
 
 These ones were removed in Linux 2.6.10 because they had no users, but could
 be added back later if needed:
diff --git a/drivers/i2c/busses/i2c-powermac.c 
b/drivers/i2c/busses/i2c-powermac.c
index 1425d22..0ab4f26 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -121,8 +121,7 @@ static s32 i2c_powermac_smbus_xfer( struct i2c_adapter* 
adap,
if (rc)
goto bail;
rc = pmac_i2c_xfer(bus, addrdir, 1, command,
-  read ? data-block : data-block[1],
-  data-block[0]);
+  data-block[1], data-block[0]);
break;
 
 default:
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
index 7a2bc06..a0f7e4a 100644
--- a/drivers/i2c/busses/i2c-viapro.c
+++ b/drivers/i2c/busses/i2c-viapro.c
@@ -235,7 +235,7 @@ static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
if (!(vt596_features  FEATURE_I2CBLOCK))
goto exit_unsupported;
if (read_write == I2C_SMBUS_READ)
-   outb_p(I2C_SMBUS_BLOCK_MAX, SMBHSTDAT0);
+   outb_p(data-block[0], SMBHSTDAT0);
   

i2c: New DS1682 chip driver

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5162b75b24963eebe62c4d4161d0fe0b337a313b
Commit: 5162b75b24963eebe62c4d4161d0fe0b337a313b
Parent: 4b2643d7d9bdcd776749e17f73c168ddf02e93cb
Author: Grant Likely [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:29 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:29 2007 +0200

i2c: New DS1682 chip driver

A driver for the Dallas DS1682 elapsed time recorder chip.

Tested on a MPC5200 based board using the integrated i2c adapter.

Signed-off-by: Grant Likely [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/chips/Kconfig  |   10 ++
 drivers/i2c/chips/Makefile |1 +
 drivers/i2c/chips/ds1682.c |  259 
 3 files changed, 270 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index 8113ce2..09fbc59 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -30,6 +30,16 @@ config SENSORS_DS1374
  This driver is deprecated and will be dropped soon. Use
  rtc-ds1374 instead.
 
+config DS1682
+   tristate Dallas DS1682 Total Elapsed Time Recorder with Alarm
+   depends on EXPERIMENTAL
+   help
+ If you say yes here you get support for Dallas Semiconductor
+ DS1682 Total Elapsed Time Recorder.
+
+ This driver can also be built as a module.  If so, the module
+ will be called ds1682.
+
 config SENSORS_EEPROM
tristate EEPROM reader
depends on EXPERIMENTAL
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index 779868e..cc54a4d 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -4,6 +4,7 @@
 
 obj-$(CONFIG_SENSORS_DS1337)   += ds1337.o
 obj-$(CONFIG_SENSORS_DS1374)   += ds1374.o
+obj-$(CONFIG_DS1682)   += ds1682.o
 obj-$(CONFIG_SENSORS_EEPROM)   += eeprom.o
 obj-$(CONFIG_SENSORS_MAX6875)  += max6875.o
 obj-$(CONFIG_SENSORS_M41T00)   += m41t00.o
diff --git a/drivers/i2c/chips/ds1682.c b/drivers/i2c/chips/ds1682.c
new file mode 100644
index 000..25fd467
--- /dev/null
+++ b/drivers/i2c/chips/ds1682.c
@@ -0,0 +1,259 @@
+/*
+ * Dallas Semiconductor DS1682 Elapsed Time Recorder device driver
+ *
+ * Written by: Grant Likely [EMAIL PROTECTED]
+ *
+ * Copyright (C) 2007 Secret Lab Technologies Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * The DS1682 elapsed timer recorder is a simple device that implements
+ * one elapsed time counter, one event counter, an alarm signal and 10
+ * bytes of general purpose EEPROM.
+ *
+ * This driver provides access to the DS1682 counters and user data via
+ * the sysfs.  The following attributes are added to the device node:
+ * elapsed_time (u32): Total elapsed event time in ms resolution
+ * alarm_time (u32): When elapsed time exceeds the value in alarm_time,
+ *   then the alarm pin is asserted.
+ * event_count (u16): number of times the event pin has gone low.
+ * eeprom (u8[10]): general purpose EEPROM
+ *
+ * Counter registers and user data are both read/write unless the device
+ * has been write protected.  This driver does not support turning off write
+ * protection.  Once write protection is turned on, it is impossible to
+ * turn it off again, so I have left the feature out of this driver to avoid
+ * accidental enabling, but it is trivial to add write protect support.
+ *
+ */
+
+#include linux/module.h
+#include linux/init.h
+#include linux/slab.h
+#include linux/i2c.h
+#include linux/string.h
+#include linux/list.h
+#include linux/sysfs.h
+#include linux/ctype.h
+#include linux/hwmon-sysfs.h
+
+/* Device registers */
+#define DS1682_REG_CONFIG  0x00
+#define DS1682_REG_ALARM   0x01
+#define DS1682_REG_ELAPSED 0x05
+#define DS1682_REG_EVT_CNTR0x09
+#define DS1682_REG_EEPROM  0x0b
+#define DS1682_REG_RESET   0x1d
+#define DS1682_REG_WRITE_DISABLE   0x1e
+#define DS1682_REG_WRITE_MEM_DISABLE   0x1f
+
+#define DS1682_EEPROM_SIZE 10
+
+/*
+ * Generic counter attributes
+ */
+static ssize_t ds1682_show(struct device *dev, struct device_attribute *attr,
+  char *buf)
+{
+   struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+   struct i2c_client *client = to_i2c_client(dev);
+   __le32 val = 0;
+   int rc;
+
+   dev_dbg(dev, ds1682_show() called on %s\n, attr-attr.name);
+
+   /* Read the register */
+   rc = i2c_smbus_read_i2c_block_data(client, sattr-index, sattr-nr,
+  (u8 *)  val);
+   if (rc  0)
+   return -EIO;
+
+   /* Special case: 

i2c-piix4: Add support for the ATI SB700

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c29c22218b99dad95f7cd0281415a854aeee805c
Commit: c29c22218b99dad95f7cd0281415a854aeee805c
Parent: 5162b75b24963eebe62c4d4161d0fe0b337a313b
Author: Henry Su [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:29 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:29 2007 +0200

i2c-piix4: Add support for the ATI SB700

Add the SMBus device ID for ATI SB700.

Signed-off-by: Henry Su [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 Documentation/i2c/busses/i2c-piix4 |2 +-
 drivers/i2c/busses/Kconfig |1 +
 drivers/i2c/busses/i2c-piix4.c |4 +++-
 include/linux/pci_ids.h|1 +
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/i2c/busses/i2c-piix4 
b/Documentation/i2c/busses/i2c-piix4
index 7cbe43f..fa0c786 100644
--- a/Documentation/i2c/busses/i2c-piix4
+++ b/Documentation/i2c/busses/i2c-piix4
@@ -6,7 +6,7 @@ Supported adapters:
 Datasheet: Publicly available at the Intel website
   * ServerWorks OSB4, CSB5, CSB6 and HT-1000 southbridges
 Datasheet: Only available via NDA from ServerWorks
-  * ATI IXP200, IXP300, IXP400 and SB600 southbridges
+  * ATI IXP200, IXP300, IXP400, SB600 and SB700 southbridges
 Datasheet: Not publicly available
   * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
 Datasheet: Publicly available at the SMSC website http://www.smsc.com
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 838dc1c..165c126 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -207,6 +207,7 @@ config I2C_PIIX4
ATI IXP300
ATI IXP400
ATI SB600
+   ATI SB700
Serverworks OSB4
Serverworks CSB5
Serverworks CSB6
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 5a52bf5..debc76c 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -23,7 +23,7 @@
Supports:
Intel PIIX4, 440MX
Serverworks OSB4, CSB5, CSB6, HT-1000
-   ATI IXP200, IXP300, IXP400, SB600
+   ATI IXP200, IXP300, IXP400, SB600, SB700
SMSC Victory66
 
Note: we assume there can only be one device, with one SMBus interface.
@@ -399,6 +399,8 @@ static struct pci_device_id piix4_ids[] = {
  .driver_data = 0 },
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SMBUS),
  .driver_data = 0 },
+   { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SMBUS),
+ .driver_data = 0 },
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4),
  .driver_data = 0 },
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5),
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 75c4d4d..831 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -371,6 +371,7 @@
 #define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385
 #define PCI_DEVICE_ID_ATI_IXP600_IDE   0x438c
 #define PCI_DEVICE_ID_ATI_IXP700_SATA  0x4390
+#define PCI_DEVICE_ID_ATI_IXP700_SMBUS 0x4395
 #define PCI_DEVICE_ID_ATI_IXP700_IDE   0x439c
 
 #define PCI_VENDOR_ID_VLSI 0x1004
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-mv64xxx: Use i2c_add_numbered_adapter

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=65b22ad9508b609b0625eccb2680996a1e09ed16
Commit: 65b22ad9508b609b0625eccb2680996a1e09ed16
Parent: c29c22218b99dad95f7cd0281415a854aeee805c
Author: Dale Farnsworth [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:29 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:29 2007 +0200

i2c-mv64xxx: Use i2c_add_numbered_adapter

Convert the Marvell mv64xxx I2C driver to use the new i2c infrastructure,
by calling i2c_add_numbered_adapter().  This allows clients to be
registered before the bus is instantiated.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Acked-by: Mark A. Greer [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-mv64xxx.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index a55b333..251154a 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -527,6 +527,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
drv_data-adapter.class = I2C_CLASS_HWMON;
drv_data-adapter.timeout = pdata-timeout;
drv_data-adapter.retries = pdata-retries;
+   drv_data-adapter.nr = pd-id;
platform_set_drvdata(pd, drv_data);
i2c_set_adapdata(drv_data-adapter, drv_data);
 
@@ -539,7 +540,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
drv_data-irq);
rc = -EINVAL;
goto exit_unmap_regs;
-   } else if ((rc = i2c_add_adapter(drv_data-adapter)) != 0) {
+   } else if ((rc = i2c_add_numbered_adapter(drv_data-adapter)) != 0) {
dev_err(drv_data-adapter.dev,
mv64xxx: Can't add i2c adapter, rc: %d\n, -rc);
goto exit_free_irq;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-mpc: Use i2c_add_numbered_adapter

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1469fa263870acd890a4b9f6ef557acc5d673b44
Commit: 1469fa263870acd890a4b9f6ef557acc5d673b44
Parent: 65b22ad9508b609b0625eccb2680996a1e09ed16
Author: Grant Likely [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:29 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:29 2007 +0200

i2c-mpc: Use i2c_add_numbered_adapter

Move the i2c-mpc driver over to using the new i2c infrastructure.
Specifically, it now uses i2c_add_numbered_adapter so that the bus number
can be determined ahead of time and used to register i2c clients before
the bus is instantiated.

Tested on an MPC5200 based board

Signed-off-by: Grant Likely [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-mpc.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index c6b6898..a769efc 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -327,9 +327,10 @@ static int fsl_i2c_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, i2c);
 
i2c-adap = mpc_ops;
+   i2c-adap.nr = pdev-id;
i2c_set_adapdata(i2c-adap, i2c);
i2c-adap.dev.parent = pdev-dev;
-   if ((result = i2c_add_adapter(i2c-adap))  0) {
+   if ((result = i2c_add_numbered_adapter(i2c-adap))  0) {
printk(KERN_ERR i2c-mpc - failed to add adapter\n);
goto fail_add;
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-nforce2: Add support for SMBus block transactions

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b53c82211a7239643aa7c9b4887429c30f353406
Commit: b53c82211a7239643aa7c9b4887429c30f353406
Parent: 1469fa263870acd890a4b9f6ef557acc5d673b44
Author: Oleg Ryjkov [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:29 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:29 2007 +0200

i2c-nforce2: Add support for SMBus block transactions

Add support for SMBus block read/write transactions to i2c-nforce2
driver, in particular to host controllers MCP51 and MCP55.

Signed-off-by: Oleg Ryjkov [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-nforce2.c |   44 +-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
index 3cd0d63..c48140f 100644
--- a/drivers/i2c/busses/i2c-nforce2.c
+++ b/drivers/i2c/busses/i2c-nforce2.c
@@ -61,6 +61,7 @@ struct nforce2_smbus {
struct i2c_adapter adapter;
int base;
int size;
+   int blockops;
 };
 
 
@@ -80,6 +81,8 @@ struct nforce2_smbus {
 #define NVIDIA_SMB_ADDR(smbus-base + 0x02)/* address */
 #define NVIDIA_SMB_CMD (smbus-base + 0x03)/* command */
 #define NVIDIA_SMB_DATA(smbus-base + 0x04)/* 32 data 
registers */
+#define NVIDIA_SMB_BCNT(smbus-base + 0x24)/* number of 
data
+  bytes */
 
 #define NVIDIA_SMB_STS_DONE0x80
 #define NVIDIA_SMB_STS_ALRM0x40
@@ -92,6 +95,7 @@ struct nforce2_smbus {
 #define NVIDIA_SMB_PRTCL_BYTE  0x04
 #define NVIDIA_SMB_PRTCL_BYTE_DATA 0x06
 #define NVIDIA_SMB_PRTCL_WORD_DATA 0x08
+#define NVIDIA_SMB_PRTCL_BLOCK_DATA0x0a
 #define NVIDIA_SMB_PRTCL_PEC   0x80
 
 static struct pci_driver nforce2_driver;
@@ -103,6 +107,8 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 
addr,
 {
struct nforce2_smbus *smbus = adap-algo_data;
unsigned char protocol, pec, temp;
+   u8 len;
+   int i;
 
protocol = (read_write == I2C_SMBUS_READ) ? NVIDIA_SMB_PRTCL_READ :
NVIDIA_SMB_PRTCL_WRITE;
@@ -137,6 +143,25 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 
addr,
protocol |= NVIDIA_SMB_PRTCL_WORD_DATA | pec;
break;
 
+   case I2C_SMBUS_BLOCK_DATA:
+   outb_p(command, NVIDIA_SMB_CMD);
+   if (read_write == I2C_SMBUS_WRITE) {
+   len = data-block[0];
+   if ((len == 0) || (len  I2C_SMBUS_BLOCK_MAX)) {
+   dev_err(adap-dev,
+   Transaction failed 
+   (requested block size: %d)\n,
+   len);
+   return -1;
+   }
+   outb_p(len, NVIDIA_SMB_BCNT);
+   for (i = 0; i  I2C_SMBUS_BLOCK_MAX; i++)
+   outb_p(data-block[i + 1],
+  NVIDIA_SMB_DATA+i);
+   }
+   protocol |= NVIDIA_SMB_PRTCL_BLOCK_DATA | pec;
+   break;
+
default:
dev_err(adap-dev, Unsupported transaction %d\n, 
size);
return -1;
@@ -174,6 +199,14 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 
addr,
case I2C_SMBUS_WORD_DATA:
data-word = inb_p(NVIDIA_SMB_DATA) | 
(inb_p(NVIDIA_SMB_DATA+1)  8);
break;
+
+   case I2C_SMBUS_BLOCK_DATA:
+   len = inb_p(NVIDIA_SMB_BCNT);
+   len = min_t(u8, len, I2C_SMBUS_BLOCK_MAX);
+   for (i = 0; i  len; i++)
+   data-block[i+1] = inb_p(NVIDIA_SMB_DATA + i);
+   data-block[0] = len;
+   break;
}
 
return 0;
@@ -184,7 +217,9 @@ static u32 nforce2_func(struct i2c_adapter *adapter)
 {
/* other functionality might be possible, but is not tested */
return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
-   I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA;
+  I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
+  (((struct nforce2_smbus*)adapter-algo_data)-blockops ?
+   I2C_FUNC_SMBUS_BLOCK_DATA : 0);
 }
 
 static struct i2c_algorithm smbus_algorithm = {
@@ -268,6 +303,13 @@ static int __devinit nforce2_probe(struct pci_dev *dev, 
const struct pci_device_
 

matroxfb: Clean-up i2c header inclusions

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7d13714650ec8868f999d2dc3d06e2723687d0c3
Commit: 7d13714650ec8868f999d2dc3d06e2723687d0c3
Parent: b53c82211a7239643aa7c9b4887429c30f353406
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:30 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:30 2007 +0200

matroxfb: Clean-up i2c header inclusions

matroxfb_crtc2 has nothing to do with i2c, so there's no reason why
matroxfb_crtc2.h should include i2c header files.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Acked-by: Petr Vandrovec [EMAIL PROTECTED]
---
 drivers/video/matrox/matroxfb_crtc2.h |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/video/matrox/matroxfb_crtc2.h 
b/drivers/video/matrox/matroxfb_crtc2.h
index 608e40b..1771776 100644
--- a/drivers/video/matrox/matroxfb_crtc2.h
+++ b/drivers/video/matrox/matroxfb_crtc2.h
@@ -2,8 +2,6 @@
 #define __MATROXFB_CRTC2_H__
 
 #include linux/ioctl.h
-#include linux/i2c.h
-#include linux/i2c-algo-bit.h
 #include matroxfb_base.h
 
 struct matroxfb_dh_fb_info {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-sis5595: Resolve resource conflict with sis5595

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7375cd822d600b4e8b83cbc025422e4267bf5fac
Commit: 7375cd822d600b4e8b83cbc025422e4267bf5fac
Parent: 7d13714650ec8868f999d2dc3d06e2723687d0c3
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:30 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:30 2007 +0200

i2c-sis5595: Resolve resource conflict with sis5595

Let the i2c-sis5595 driver release its PCI device after registering.
This is to allow the sis5595 hardware monitoring driver to also
access this PCI device. The same trick is already used in the
i2c-viapro and via686a drivers to let them both load.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-sis5595.c |   27 ---
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c
index a6feed4..283769c 100644
--- a/drivers/i2c/busses/i2c-sis5595.c
+++ b/drivers/i2c/busses/i2c-sis5595.c
@@ -129,6 +129,7 @@ MODULE_PARM_DESC(force_addr, Initialize the base address 
of the i2c controller
 
 static struct pci_driver sis5595_driver;
 static unsigned short sis5595_base;
+static struct pci_dev *sis5595_pdev;
 
 static u8 sis5595_read(u8 reg)
 {
@@ -379,6 +380,8 @@ MODULE_DEVICE_TABLE (pci, sis5595_ids);
 
 static int __devinit sis5595_probe(struct pci_dev *dev, const struct 
pci_device_id *id)
 {
+   int err;
+
if (sis5595_setup(dev)) {
dev_err(dev-dev, SIS5595 not detected, module not 
inserted.\n);
return -ENODEV;
@@ -389,20 +392,24 @@ static int __devinit sis5595_probe(struct pci_dev *dev, 
const struct pci_device_
 
sprintf(sis5595_adapter.name, SMBus SIS5595 adapter at %04x,
sis5595_base + SMB_INDEX);
-   return i2c_add_adapter(sis5595_adapter);
-}
+   err = i2c_add_adapter(sis5595_adapter);
+   if (err) {
+   release_region(sis5595_base + SMB_INDEX, 2);
+   return err;
+   }
 
-static void __devexit sis5595_remove(struct pci_dev *dev)
-{
-   i2c_del_adapter(sis5595_adapter);
-   release_region(sis5595_base + SMB_INDEX, 2);
+   /* Always return failure here.  This is to allow other drivers to bind
+* to this pci device.  We don't really want to have control over the
+* pci device, we only wanted to read as few register values from it.
+*/
+   sis5595_pdev =  pci_dev_get(dev);
+   return -ENODEV;
 }
 
 static struct pci_driver sis5595_driver = {
.name   = sis5595_smbus,
.id_table   = sis5595_ids,
.probe  = sis5595_probe,
-   .remove = __devexit_p(sis5595_remove),
 };
 
 static int __init i2c_sis5595_init(void)
@@ -413,6 +420,12 @@ static int __init i2c_sis5595_init(void)
 static void __exit i2c_sis5595_exit(void)
 {
pci_unregister_driver(sis5595_driver);
+   if (sis5595_pdev) {
+   i2c_del_adapter(sis5595_adapter);
+   release_region(sis5595_base + SMB_INDEX, 2);
+   pci_dev_put(sis5595_pdev);
+   sis5595_pdev = NULL;
+   }
 }
 
 MODULE_AUTHOR(Frodo Looijaard [EMAIL PROTECTED]);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-iop3xx: Switch to static adapter numbering

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=757ba4c697244da878b65585d8cb671da1cb9eaf
Commit: 757ba4c697244da878b65585d8cb671da1cb9eaf
Parent: 7375cd822d600b4e8b83cbc025422e4267bf5fac
Author: Martin Michlmayr [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:30 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:30 2007 +0200

i2c-iop3xx: Switch to static adapter numbering

Update the IOP3xx I2C driver to use i2c_add_numbered_adapter(), so that
later patches can convert boards to using new-style drivers.

Signed-off-by: Martin Michlmayr [EMAIL PROTECTED]
Tested-by: Voipio Riku [EMAIL PROTECTED]
Cc: Dan J Williams [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-iop3xx.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index 90e2d93..440342b 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -491,6 +491,7 @@ iop3xx_i2c_probe(struct platform_device *pdev)
new_adapter-id = I2C_HW_IOP3XX;
new_adapter-owner = THIS_MODULE;
new_adapter-dev.parent = pdev-dev;
+   new_adapter-nr = pdev-id;
 
/*
 * Default values...should these come in from board code?
@@ -508,7 +509,7 @@ iop3xx_i2c_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, new_adapter);
new_adapter-algo_data = adapter_data;
 
-   i2c_add_adapter(new_adapter);
+   i2c_add_numbered_adapter(new_adapter);
 
return 0;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-gpio: Add support for new-style clients

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7e69c3ac93a9a7aa29dab7179f86da67db7b0ca3
Commit: 7e69c3ac93a9a7aa29dab7179f86da67db7b0ca3
Parent: 757ba4c697244da878b65585d8cb671da1cb9eaf
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:30 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:30 2007 +0200

i2c-gpio: Add support for new-style clients

Use i2c_bit_add_numbered_bus() so that the i2c-gpio adapter works well
with new-style pre-declared devices.

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-gpio.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index a7dd546..d6dbd6a 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -142,7 +142,13 @@ static int __init i2c_gpio_probe(struct platform_device 
*pdev)
adap-algo_data = bit_data;
adap-dev.parent = pdev-dev;
 
-   ret = i2c_bit_add_bus(adap);
+   /*
+* If dev-id is negative we consider it as zero.
+* The reason to do so is to avoid sysfs names that only make
+* sense when there are multiple adapters.
+*/
+   adap-nr = pdev-id = 0 ? pdev-id : 0;
+   ret = i2c_bit_add_numbered_bus(adap);
if (ret)
goto err_add_bus;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-gpio: Make some internal functions static

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d6ceed4426cd85e1203a3153246334a3537f92b
Commit: 4d6ceed4426cd85e1203a3153246334a3537f92b
Parent: 7e69c3ac93a9a7aa29dab7179f86da67db7b0ca3
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:30 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:30 2007 +0200

i2c-gpio: Make some internal functions static

i2c_gpio_getsda() and i2c_gpio_getscl() are only used in this file.

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Acked-by: Haavard Skinnemoen [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-gpio.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index d6dbd6a..025f194 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -63,14 +63,14 @@ static void i2c_gpio_setscl_val(void *data, int state)
gpio_set_value(pdata-scl_pin, state);
 }
 
-int i2c_gpio_getsda(void *data)
+static int i2c_gpio_getsda(void *data)
 {
struct i2c_gpio_platform_data *pdata = data;
 
return gpio_get_value(pdata-sda_pin);
 }
 
-int i2c_gpio_getscl(void *data)
+static int i2c_gpio_getscl(void *data)
 {
struct i2c_gpio_platform_data *pdata = data;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-pxa: Support new-style I2C drivers

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=066af983c74162fa98e7c5ffa8a5ead4a6979b1f
Commit: 066af983c74162fa98e7c5ffa8a5ead4a6979b1f
Parent: 4d6ceed4426cd85e1203a3153246334a3537f92b
Author: Rodolfo Giometti [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:30 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:30 2007 +0200

i2c-pxa: Support new-style I2C drivers

Signed-off-by: Rodolfo Giometti [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-pxa.c |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 28e7b91..9d6b790 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -921,7 +921,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
i2c-adap.class = plat-class;
}
 
-   ret = i2c_add_adapter(i2c-adap);
+   /*
+* If dev-id is negative we consider it as zero.
+* The reason to do so is to avoid sysfs names that only make
+* sense when there are multiple adapters.
+*/
+   i2c-adap.nr = dev-id = 0 ? dev-id : 0;
+
+   ret = i2c_add_numbered_adapter(i2c-adap);
if (ret  0) {
printk(KERN_INFO I2C: Failed to add bus\n);
goto eadapt;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c: Add support for the TSL2550

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a92c344d8c640a812c7a9f5a5202d862cd052a0f
Commit: a92c344d8c640a812c7a9f5a5202d862cd052a0f
Parent: 066af983c74162fa98e7c5ffa8a5ead4a6979b1f
Author: Rodolfo Giometti [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:30 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:30 2007 +0200

i2c: Add support for the TSL2550

Add support for Taos TSL2550 ambient light sensors.
(http://www.taosinc.com/product_detail.asp?cateid=4proid=18).

Signed-off-by: Rodolfo Giometti [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/chips/Kconfig   |   10 +
 drivers/i2c/chips/Makefile  |1 +
 drivers/i2c/chips/tsl2550.c |  454 +++
 3 files changed, 465 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index 09fbc59..3944e88 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -143,4 +143,14 @@ config SENSORS_MAX6875
  This driver can also be built as a module.  If so, the module
  will be called max6875.
 
+config SENSORS_TSL2550
+   tristate Taos TSL2550 ambient light sensor
+   depends on EXPERIMENTAL
+   help
+ If you say yes here you get support for the Taos TSL2550
+ ambient light sensor.
+
+ This driver can also be built as a module.  If so, the module
+ will be called tsl2550.
+
 endmenu
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index cc54a4d..d8cbeb3 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o
 obj-$(CONFIG_SENSORS_PCF8591)  += pcf8591.o
 obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
 obj-$(CONFIG_TPS65010) += tps65010.o
+obj-$(CONFIG_SENSORS_TSL2550)  += tsl2550.o
 
 ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
 EXTRA_CFLAGS += -DDEBUG
diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c
new file mode 100644
index 000..ef80330
--- /dev/null
+++ b/drivers/i2c/chips/tsl2550.c
@@ -0,0 +1,454 @@
+/*
+ *  tsl2550.c - Linux kernel modules for ambient light sensor
+ *
+ *  Copyright (C) 2007 Rodolfo Giometti [EMAIL PROTECTED]
+ *  Copyright (C) 2007 Eurotech S.p.A. [EMAIL PROTECTED]
+ *
+ *  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.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include linux/module.h
+#include linux/init.h
+#include linux/slab.h
+#include linux/i2c.h
+#include linux/mutex.h
+#include linux/delay.h
+
+#define TSL2550_DRV_NAME   tsl2550
+#define DRIVER_VERSION 1.1.0
+
+/*
+ * Defines
+ */
+
+#define TSL2550_POWER_DOWN 0x00
+#define TSL2550_POWER_UP   0x03
+#define TSL2550_STANDARD_RANGE 0x18
+#define TSL2550_EXTENDED_RANGE 0x1d
+#define TSL2550_READ_ADC0  0x43
+#define TSL2550_READ_ADC1  0x83
+
+/*
+ * Structs
+ */
+
+struct tsl2550_data {
+   struct i2c_client *client;
+   struct mutex update_lock;
+
+   unsigned int power_state : 1;
+   unsigned int operating_mode : 1;
+};
+
+/*
+ * Global data
+ */
+
+static const u8 TSL2550_MODE_RANGE[2] = {
+   TSL2550_STANDARD_RANGE, TSL2550_EXTENDED_RANGE,
+};
+
+/*
+ * Management functions
+ */
+
+static int tsl2550_set_operating_mode(struct i2c_client *client, int mode)
+{
+   struct tsl2550_data *data = i2c_get_clientdata(client);
+
+   int ret = i2c_smbus_write_byte(client, TSL2550_MODE_RANGE[mode]);
+
+   data-operating_mode = mode;
+
+   return ret;
+}
+
+static int tsl2550_set_power_state(struct i2c_client *client, int state)
+{
+   struct tsl2550_data *data = i2c_get_clientdata(client);
+   int ret;
+
+   if (state == 0)
+   ret = i2c_smbus_write_byte(client, TSL2550_POWER_DOWN);
+   else {
+   ret = i2c_smbus_write_byte(client, TSL2550_POWER_UP);
+
+   /* On power up we should reset operating mode also... */
+   tsl2550_set_operating_mode(client, data-operating_mode);
+   }
+
+   data-power_state = state;
+
+   return ret;
+}
+
+static int tsl2550_get_adc_value(struct i2c_client *client, u8 cmd)
+{
+   unsigned long end;
+   int loop = 0, ret = 0;
+
+   

i2c-i801: Various cleanups

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ca8b9e32a11a7cbfecbef00c8451a79fe1af392e
Commit: ca8b9e32a11a7cbfecbef00c8451a79fe1af392e
Parent: a92c344d8c640a812c7a9f5a5202d862cd052a0f
Author: Oleg Ryjkov [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:31 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:31 2007 +0200

i2c-i801: Various cleanups

* Use defines instead of raw numbers for register bits
* Fix several wrong indentations and trailing whitespace
* Move hwpec timeout checking to a separate function

Signed-off-by: Oleg Ryjkov [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-i801.c |  116 ++--
 1 files changed, 75 insertions(+), 41 deletions(-)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 611b571..d5e12a4 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -22,10 +22,10 @@
 
 /*
 SUPPORTED DEVICES  PCI ID
-82801AA2413   
-82801AB2423   
-82801BA2443   
-82801CA/CAM2483   
+82801AA2413
+82801AB2423
+82801BA2443
+82801CA/CAM2483
 82801DB24C3   (HW PEC supported, 32 byte buffer not supported)
 82801EB24D3   (HW PEC supported, 32 byte buffer not supported)
 6300ESB25A4
@@ -74,6 +74,13 @@
 #define SMBHSTCFG_SMB_SMI_EN   2
 #define SMBHSTCFG_I2C_EN   4
 
+/* Auxillary control register bits, ICH4+ only */
+#define SMBAUXCTL_CRC  1
+#define SMBAUXCTL_E32B 2
+
+/* kill bit for SMBHSTCNT */
+#define SMBHSTCNT_KILL 2
+
 /* Other settings */
 #define MAX_TIMEOUT100
 #define ENABLE_INT90   /* set to 0x01 to enable - untested */
@@ -91,10 +98,15 @@
 #define I801_START 0x40
 #define I801_PEC_EN0x80/* ICH4 only */
 
-
-static int i801_transaction(void);
-static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
- int command, int hwpec);
+/* I801 Hosts Status register bits */
+#define SMBHSTSTS_BYTE_DONE0x80
+#define SMBHSTSTS_INUSE_STS0x40
+#define SMBHSTSTS_SMBALERT_STS 0x20
+#define SMBHSTSTS_FAILED   0x10
+#define SMBHSTSTS_BUS_ERR  0x08
+#define SMBHSTSTS_DEV_ERR  0x04
+#define SMBHSTSTS_INTR 0x02
+#define SMBHSTSTS_HOST_BUSY0x01
 
 static unsigned long i801_smba;
 static unsigned char i801_original_hstcfg;
@@ -133,27 +145,32 @@ static int i801_transaction(void)
do {
msleep(1);
temp = inb_p(SMBHSTSTS);
-   } while ((temp  0x01)  (timeout++  MAX_TIMEOUT));
+   } while ((temp  SMBHSTSTS_HOST_BUSY)  (timeout++  MAX_TIMEOUT));
 
/* If the SMBus is still busy, we give up */
if (timeout = MAX_TIMEOUT) {
dev_dbg(I801_dev-dev, SMBus Timeout!\n);
result = -1;
+   /* try to stop the current command */
+   dev_dbg(I801_dev-dev, Terminating the current operation\n);
+   outb_p(inb_p(SMBHSTCNT) | SMBHSTCNT_KILL, SMBHSTCNT);
+   msleep(1);
+   outb_p(inb_p(SMBHSTCNT)  (~SMBHSTCNT_KILL), SMBHSTCNT);
}
 
-   if (temp  0x10) {
+   if (temp  SMBHSTSTS_FAILED) {
result = -1;
dev_dbg(I801_dev-dev, Error: Failed bus transaction\n);
}
 
-   if (temp  0x08) {
+   if (temp  SMBHSTSTS_BUS_ERR) {
result = -1;
dev_err(I801_dev-dev, Bus collision! SMBus may be locked 
until next hard reset. (sorry!)\n);
/* Clock stops and slave is stuck in mid-transmission */
}
 
-   if (temp  0x04) {
+   if (temp  SMBHSTSTS_DEV_ERR) {
result = -1;
dev_dbg(I801_dev-dev, Error: no response!\n);
}
@@ -172,6 +189,24 @@ static int i801_transaction(void)
return result;
 }
 
+/* wait for INTR bit as advised by Intel */
+static void i801_wait_hwpec(void)
+{
+   int timeout = 0;
+   int temp;
+
+   do {
+   msleep(1);
+   temp = inb_p(SMBHSTSTS);
+   } while ((!(temp  SMBHSTSTS_INTR))
+ (timeout++  MAX_TIMEOUT));
+
+   if (timeout = MAX_TIMEOUT) {
+   dev_dbg(I801_dev-dev, PEC Timeout!\n);
+   }
+   outb_p(temp, SMBHSTSTS);
+}
+
 /* All-inclusive block transaction function */
 static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
  int command, int hwpec)
@@ -227,13 +262,13 @@ static int i801_block_transaction(union i2c_smbus_data 
*data, char read_write,
/* Make sure the SMBus host is ready to start transmitting 

i2c-i801: Use the internal 32-byte buffer on ICH4+

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7edcb9abb594a8f3b4ca756e03d01c870aeae127
Commit: 7edcb9abb594a8f3b4ca756e03d01c870aeae127
Parent: ca8b9e32a11a7cbfecbef00c8451a79fe1af392e
Author: Oleg Ryjkov [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:31 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:31 2007 +0200

i2c-i801: Use the internal 32-byte buffer on ICH4+

Add an ability to utilize the internal SRAM buffer on ICH4
and newer host controllers to speed up execution of block operations.

I've split the code so that it is more clear which block transaction is
performed.

First of all the host controller's type is identified. isich4 is set when
we think that the controller has the internal buffer. Then, before every
block transaction, if isich4 is set, we attempt to enable the E32B bit in
SMBAUXCTL register.

Signed-off-by: Oleg Ryjkov [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 Documentation/i2c/busses/i2c-i801 |4 +-
 drivers/i2c/busses/i2c-i801.c |  151 -
 2 files changed, 102 insertions(+), 53 deletions(-)

diff --git a/Documentation/i2c/busses/i2c-i801 
b/Documentation/i2c/busses/i2c-i801
index c34f0db..fe6406f 100644
--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -5,8 +5,8 @@ Supported adapters:
 '810' and '810E' chipsets)
   * Intel 82801BA (ICH2 - part of the '815E' chipset)
   * Intel 82801CA/CAM (ICH3)
-  * Intel 82801DB (ICH4) (HW PEC supported, 32 byte buffer not supported)
-  * Intel 82801EB/ER (ICH5) (HW PEC supported, 32 byte buffer not supported)
+  * Intel 82801DB (ICH4) (HW PEC supported)
+  * Intel 82801EB/ER (ICH5) (HW PEC supported)
   * Intel 6300ESB
   * Intel 82801FB/FR/FW/FRW (ICH6)
   * Intel 82801G (ICH7)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index d5e12a4..8f5c686 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -26,8 +26,8 @@
 82801AB2423
 82801BA2443
 82801CA/CAM2483
-82801DB24C3   (HW PEC supported, 32 byte buffer not supported)
-82801EB24D3   (HW PEC supported, 32 byte buffer not supported)
+82801DB24C3   (HW PEC supported)
+82801EB24D3   (HW PEC supported)
 6300ESB25A4
 ICH6   266A
 ICH7   27DA
@@ -114,7 +114,7 @@ static struct pci_driver i801_driver;
 static struct pci_dev *I801_dev;
 static int isich4;
 
-static int i801_transaction(void)
+static int i801_transaction(int xact)
 {
int temp;
int result = 0;
@@ -139,7 +139,9 @@ static int i801_transaction(void)
}
}
 
-   outb_p(inb(SMBHSTCNT) | I801_START, SMBHSTCNT);
+   /* the current contents of SMBHSTCNT can be overwritten, since PEC,
+* INTREN, SMBSCMD are passed in xact */
+   outb_p(xact | I801_START, SMBHSTCNT);
 
/* We will always wait for a fraction of a second! */
do {
@@ -207,44 +209,52 @@ static void i801_wait_hwpec(void)
outb_p(temp, SMBHSTSTS);
 }
 
-/* All-inclusive block transaction function */
-static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
- int command, int hwpec)
+static int i801_block_transaction_by_block(union i2c_smbus_data *data,
+  char read_write, int hwpec)
+{
+   int i, len;
+
+   inb_p(SMBHSTCNT); /* reset the data buffer index */
+
+   /* Use 32-byte buffer to process this transaction */
+   if (read_write == I2C_SMBUS_WRITE) {
+   len = data-block[0];
+   outb_p(len, SMBHSTDAT0);
+   for (i = 0; i  len; i++)
+   outb_p(data-block[i+1], SMBBLKDAT);
+   }
+
+   if (i801_transaction(I801_BLOCK_DATA | ENABLE_INT9 |
+I801_PEC_EN * hwpec))
+   return -1;
+
+   if (read_write == I2C_SMBUS_READ) {
+   len = inb_p(SMBHSTDAT0);
+   if (len  1 || len  I2C_SMBUS_BLOCK_MAX)
+   return -1;
+
+   data-block[0] = len;
+   for (i = 0; i  len; i++)
+   data-block[i + 1] = inb_p(SMBBLKDAT);
+   }
+   return 0;
+}
+
+static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data,
+  char read_write, int hwpec)
 {
int i, len;
int smbcmd;
int temp;
int result = 0;
int timeout;
-   unsigned char hostc, errmask;
+   unsigned char errmask;
 
-   if (command == I2C_SMBUS_I2C_BLOCK_DATA) {
-   if (read_write == I2C_SMBUS_WRITE) {
-   /* set I2C_EN bit in configuration register */
-   

i2c: New bus driver for the TAOS evaluation modules

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9cdad74883a797952de52464d118d685cafc05a
Commit: b9cdad74883a797952de52464d118d685cafc05a
Parent: 7edcb9abb594a8f3b4ca756e03d01c870aeae127
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:31 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:31 2007 +0200

i2c: New bus driver for the TAOS evaluation modules

This is a new I2C bus driver for the TAOS evaluation modules. Developped
and tested on the TAOS TSL2550 EVM.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 Documentation/i2c/busses/i2c-taos-evm |   46 +
 drivers/i2c/busses/Kconfig|   16 ++
 drivers/i2c/busses/Makefile   |1 +
 drivers/i2c/busses/i2c-taos-evm.c |  330 +
 include/linux/serio.h |1 +
 5 files changed, 394 insertions(+), 0 deletions(-)

diff --git a/Documentation/i2c/busses/i2c-taos-evm 
b/Documentation/i2c/busses/i2c-taos-evm
new file mode 100644
index 000..9146e33
--- /dev/null
+++ b/Documentation/i2c/busses/i2c-taos-evm
@@ -0,0 +1,46 @@
+Kernel driver i2c-taos-evm
+
+Author: Jean Delvare [EMAIL PROTECTED]
+
+This is a driver for the evaluation modules for TAOS I2C/SMBus chips.
+The modules include an SMBus master with limited capabilities, which can
+be controlled over the serial port. Virtually all evaluation modules
+are supported, but a few lines of code need to be added for each new
+module to instantiate the right I2C chip on the bus. Obviously, a driver
+for the chip in question is also needed.
+
+Currently supported devices are:
+
+* TAOS TSL2550 EVM
+
+For addtional information on TAOS products, please see
+  http://www.taosinc.com/
+
+
+Using this driver
+-
+
+In order to use this driver, you'll need the serport driver, and the
+inputattach tool, which is part of the input-utils package. The following
+commands will tell the kernel that you have a TAOS EVM on the first
+serial port:
+
+# modprobe serport
+# inputattach --taos-evm /dev/ttyS0
+
+
+Technical details
+-
+
+Only 4 SMBus transaction types are supported by the TAOS evaluation
+modules:
+* Receive Byte
+* Send Byte
+* Read Byte
+* Write Byte
+
+The communication protocol is text-based and pretty simple. It is
+described in a PDF document on the CD which comes with the evaluation
+module. The communication is rather slow, because the serial port has
+to operate at 1200 bps. However, I don't think this is a big concern in
+practice, as these modules are meant for evaluation and testing only.
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 165c126..c093b07 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -513,6 +513,22 @@ config I2C_SIS96X
  This driver can also be built as a module.  If so, the module
  will be called i2c-sis96x.
 
+config I2C_TAOS_EVM
+   tristate TAOS evaluation module
+   depends on EXPERIMENTAL
+   select SERIO
+   select SERIO_SERPORT
+   default n
+   help
+ This supports TAOS evaluation modules on serial port. In order to
+ use this driver, you will need the inputattach tool, which is part
+ of the input-utils package.
+
+ If unsure, say N.
+
+ This support is also available as a module.  If so, the module
+ will be called i2c-taos-evm.
+
 config I2C_STUB
tristate I2C/SMBus Test Stub
depends on EXPERIMENTAL  m
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index 14d1432..a49c0a3 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -44,6 +44,7 @@ obj-$(CONFIG_I2C_SIS5595) += i2c-sis5595.o
 obj-$(CONFIG_I2C_SIS630)   += i2c-sis630.o
 obj-$(CONFIG_I2C_SIS96X)   += i2c-sis96x.o
 obj-$(CONFIG_I2C_STUB) += i2c-stub.o
+obj-$(CONFIG_I2C_TAOS_EVM) += i2c-taos-evm.o
 obj-$(CONFIG_I2C_TINY_USB) += i2c-tiny-usb.o
 obj-$(CONFIG_I2C_VERSATILE)+= i2c-versatile.o
 obj-$(CONFIG_I2C_ACORN)+= i2c-acorn.o
diff --git a/drivers/i2c/busses/i2c-taos-evm.c 
b/drivers/i2c/busses/i2c-taos-evm.c
new file mode 100644
index 000..1b0cfd5
--- /dev/null
+++ b/drivers/i2c/busses/i2c-taos-evm.c
@@ -0,0 +1,330 @@
+/*
+ * Driver for the TAOS evaluation modules
+ * These devices include an I2C master which can be controlled over the
+ * serial port.
+ *
+ * Copyright (C) 2007 Jean Delvare [EMAIL PROTECTED]
+ *
+ * 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; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General 

i2c/tsl2550: Speed up initialization

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e296fb7f301f3c3398adc6d991b097cfa73e1c0c
Commit: e296fb7f301f3c3398adc6d991b097cfa73e1c0c
Parent: b9cdad74883a797952de52464d118d685cafc05a
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:31 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:31 2007 +0200

i2c/tsl2550: Speed up initialization

There's some redundancy in the tsl2550 initialization sequence. It is
powering up the device twice, and setting the operating mode twice
too. Setting things just once saves SMBus transactions, which aren't
always cheap, speeding up the device initialization.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Cc: Rodolfo Giometti [EMAIL PROTECTED]
---
 drivers/i2c/chips/tsl2550.c |   46 --
 1 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c
index ef80330..3de4b19 100644
--- a/drivers/i2c/chips/tsl2550.c
+++ b/drivers/i2c/chips/tsl2550.c
@@ -27,7 +27,7 @@
 #include linux/delay.h
 
 #define TSL2550_DRV_NAME   tsl2550
-#define DRIVER_VERSION 1.1.0
+#define DRIVER_VERSION 1.1.1
 
 /*
  * Defines
@@ -333,13 +333,30 @@ static const struct attribute_group tsl2550_attr_group = {
  * Initialization function
  */
 
-static void tsl2550_init_client(struct i2c_client *client)
+static int tsl2550_init_client(struct i2c_client *client)
 {
struct tsl2550_data *data = i2c_get_clientdata(client);
+   int err;
 
-   /* Power up the device and set the default operating mode */
-   tsl2550_set_power_state(client, 1);
-   tsl2550_set_operating_mode(client, data-operating_mode);
+   /*
+* Probe the chip. To do so we try to power up the device and then to
+* read back the 0x03 code
+*/
+   err = i2c_smbus_write_byte(client, TSL2550_POWER_UP);
+   if (err  0)
+   return err;
+   mdelay(1);
+   if (i2c_smbus_read_byte(client) != TSL2550_POWER_UP)
+   return -ENODEV;
+   data-power_state = 1;
+
+   /* Set the default operating mode */
+   err = i2c_smbus_write_byte(client,
+  TSL2550_MODE_RANGE[data-operating_mode]);
+   if (err  0)
+   return err;
+
+   return 0;
 }
 
 /*
@@ -381,24 +398,12 @@ static int __devinit tsl2550_probe(struct i2c_client 
*client)
dev_info(client-dev, %s operating mode\n,
data-operating_mode ? extended : standard);
 
-   /*
-* Probe the chip. To do so we try to power up the device and then to
-* read back the 0x03 code
-*/
-   err = i2c_smbus_write_byte(client, TSL2550_POWER_UP);
-   if (err  0)
-   goto exit_kfree;
-   mdelay(1);
-   err = i2c_smbus_read_byte(client);
-   if (err != TSL2550_POWER_UP) {
-   err = -ENODEV;
-   goto exit_kfree;
-   }
-
mutex_init(data-update_lock);
 
/* Initialize the TSL2550 chip */
-   tsl2550_init_client(client);
+   err = tsl2550_init_client(client);
+   if (err)
+   goto exit_kfree;
 
/* Register sysfs hooks */
err = sysfs_create_group(client-dev.kobj, tsl2550_attr_group);
@@ -449,6 +454,7 @@ static void __exit tsl2550_exit(void)
 MODULE_AUTHOR(Rodolfo Giometti [EMAIL PROTECTED]);
 MODULE_DESCRIPTION(TSL2550 ambient light sensor driver);
 MODULE_LICENSE(GPL);
+MODULE_VERSION(DRIVER_VERSION);
 
 module_init(tsl2550_init);
 module_exit(tsl2550_exit);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c-savage4: Delete many unused defines

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c6e16295b71ec006c8cb6d13520e9194652a6026
Commit: c6e16295b71ec006c8cb6d13520e9194652a6026
Parent: e296fb7f301f3c3398adc6d991b097cfa73e1c0c
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:31 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:31 2007 +0200

i2c-savage4: Delete many unused defines

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-savage4.c |   21 +
 1 files changed, 1 insertions(+), 20 deletions(-)

diff --git a/drivers/i2c/busses/i2c-savage4.c b/drivers/i2c/busses/i2c-savage4.c
index b7fb65c..8adf4ab 100644
--- a/drivers/i2c/busses/i2c-savage4.c
+++ b/drivers/i2c/busses/i2c-savage4.c
@@ -25,8 +25,6 @@
 /* This interfaces to the I2C bus of the Savage4 to gain access to
the BT869 and possibly other I2C devices. The DDC bus is not
yet supported because its register is not memory-mapped.
-   However we leave the DDC code here, commented out, to make
-   it easier to add later.
 */
 
 #include linux/kernel.h
@@ -37,36 +35,19 @@
 #include linux/i2c-algo-bit.h
 #include asm/io.h
 
-/* 3DFX defines */
-#define PCI_CHIP_SAVAGE3D  0x8A20
-#define PCI_CHIP_SAVAGE3D_MV   0x8A21
+/* device IDs */
 #define PCI_CHIP_SAVAGE4   0x8A22
 #define PCI_CHIP_SAVAGE20000x9102
-#define PCI_CHIP_PROSAVAGE_PM  0x8A25
-#define PCI_CHIP_PROSAVAGE_KM  0x8A26
-#define PCI_CHIP_SAVAGE_MX_MV  0x8c10
-#define PCI_CHIP_SAVAGE_MX 0x8c11
-#define PCI_CHIP_SAVAGE_IX_MV  0x8c12
-#define PCI_CHIP_SAVAGE_IX 0x8c13
 
 #define REG0xff20  /* Serial Port 1 Register */
 
 /* bit locations in the register */
-#define DDC_ENAB   0x0004
-#define DDC_SCL_OUT0x0008
-#define DDC_SDA_OUT0x0010
-#define DDC_SCL_IN 0x0020
-#define DDC_SDA_IN 0x0040
 #define I2C_ENAB   0x0020
 #define I2C_SCL_OUT0x0001
 #define I2C_SDA_OUT0x0002
 #define I2C_SCL_IN 0x0008
 #define I2C_SDA_IN 0x0010
 
-/* initialization states */
-#define INIT2  0x20
-#define INIT3  0x04
-
 /* delays */
 #define CYCLE_DELAY10
 #define TIMEOUT(HZ / 2)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i2c: New PMC MSP71xx TWI bus driver

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1b144df1d7d69d6dd3394205933c8951dd8b6784
Commit: 1b144df1d7d69d6dd3394205933c8951dd8b6784
Parent: c6e16295b71ec006c8cb6d13520e9194652a6026
Author: Marc St-Jean [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:12:31 2007 +0200
Committer:  Jean Delvare [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:12:31 2007 +0200

i2c: New PMC MSP71xx TWI bus driver

Add TWI driver for the PMC-Sierra MSP71xx devices.

[JD: Drop the probe hack, don't set algo_data as we never use it, return
the right error code if the driver registration fails.]

Signed-off-by: Marc St-Jean [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
---
 drivers/i2c/busses/Kconfig  |9 +
 drivers/i2c/busses/Makefile |1 +
 drivers/i2c/busses/i2c-pmcmsp.c |  653 +++
 3 files changed, 663 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index c093b07..c477dcf 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -652,4 +652,13 @@ config I2C_PNX
  This driver can also be built as a module.  If so, the module
  will be called i2c-pnx.
 
+config I2C_PMCMSP
+   tristate PMC MSP I2C TWI Controller
+   depends on PMC_MSP
+   help
+ This driver supports the PMC TWI controller on MSP devices.
+
+ This driver can also be built as module. If so, the module
+ will be called i2c-pmcmsp.
+
 endmenu
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index a49c0a3..d7bbb90 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_I2C_PARPORT_LIGHT)   += i2c-parport-light.o
 obj-$(CONFIG_I2C_PASEMI)   += i2c-pasemi.o
 obj-$(CONFIG_I2C_PCA_ISA)  += i2c-pca-isa.o
 obj-$(CONFIG_I2C_PIIX4)+= i2c-piix4.o
+obj-$(CONFIG_I2C_PMCMSP)   += i2c-pmcmsp.o
 obj-$(CONFIG_I2C_PNX)  += i2c-pnx.o
 obj-$(CONFIG_I2C_PROSAVAGE)+= i2c-prosavage.o
 obj-$(CONFIG_I2C_PXA)  += i2c-pxa.o
diff --git a/drivers/i2c/busses/i2c-pmcmsp.c b/drivers/i2c/busses/i2c-pmcmsp.c
new file mode 100644
index 000..03188d2
--- /dev/null
+++ b/drivers/i2c/busses/i2c-pmcmsp.c
@@ -0,0 +1,653 @@
+/*
+ * Specific bus support for PMC-TWI compliant implementation on MSP71xx.
+ *
+ * Copyright 2005-2007 PMC-Sierra, Inc.
+ *
+ *  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.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
+ *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ *  NO  EVENT  SHALL   THE AUTHOR  BELIABLE FOR ANY   DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
+ *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  You should have received a copy of the  GNU General Public License along
+ *  with this program; if not, write  to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/i2c.h
+#include linux/interrupt.h
+#include linux/completion.h
+#include linux/mutex.h
+#include linux/delay.h
+#include asm/io.h
+
+#define DRV_NAME   pmcmsptwi
+
+#define MSP_TWI_SF_CLK_REG_OFFSET  0x00
+#define MSP_TWI_HS_CLK_REG_OFFSET  0x04
+#define MSP_TWI_CFG_REG_OFFSET 0x08
+#define MSP_TWI_CMD_REG_OFFSET 0x0c
+#define MSP_TWI_ADD_REG_OFFSET 0x10
+#define MSP_TWI_DAT_0_REG_OFFSET   0x14
+#define MSP_TWI_DAT_1_REG_OFFSET   0x18
+#define MSP_TWI_INT_STS_REG_OFFSET 0x1c
+#define MSP_TWI_INT_MSK_REG_OFFSET 0x20
+#define MSP_TWI_BUSY_REG_OFFSET0x24
+
+#define MSP_TWI_INT_STS_DONE   (1  0)
+#define MSP_TWI_INT_STS_LOST_ARBITRATION   (1  1)
+#define MSP_TWI_INT_STS_NO_RESPONSE(1  2)
+#define MSP_TWI_INT_STS_DATA_COLLISION (1  3)
+#define MSP_TWI_INT_STS_BUSY   (1  4)
+#define MSP_TWI_INT_STS_ALL0x1f
+
+#define MSP_MAX_BYTES_PER_RW   8
+#define MSP_MAX_POLL   5
+#define MSP_POLL_DELAY 10
+#define MSP_IRQ_TIMEOUT

Blackfin arch: new kernel config for BF548-EZKIT

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0ba9e350a2c129ce2878d415cf51e88611cbc0e5
Commit: 0ba9e350a2c129ce2878d415cf51e88611cbc0e5
Parent: 24a07a124198153540f8f43d9e91d16227aba66e
Author: Mike Frysinger [EMAIL PROTECTED]
AuthorDate: Mon Jul 2 13:47:45 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Mon Jul 2 13:47:45 2007 +0800

Blackfin arch: new kernel config for BF548-EZKIT

Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/configs/BF548-EZKIT_defconfig | 1100 +++
 1 files changed, 1100 insertions(+), 0 deletions(-)

diff --git a/arch/blackfin/configs/BF548-EZKIT_defconfig 
b/arch/blackfin/configs/BF548-EZKIT_defconfig
new file mode 100644
index 000..ac8390f
--- /dev/null
+++ b/arch/blackfin/configs/BF548-EZKIT_defconfig
@@ -0,0 +1,1100 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.21.5
+#
+# CONFIG_MMU is not set
+# CONFIG_FPU is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_BLACKFIN=y
+CONFIG_ZONE_DMA=y
+CONFIG_BFIN=y
+CONFIG_SEMAPHORE_SLEEPERS=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+# CONFIG_GENERIC_TIME is not set
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_FORCE_MAX_ZONEORDER=14
+CONFIG_IRQCHIP_DEMUX_GPIO=y
+CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
+# CONFIG_NP2 is not set
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
+CONFIG_TINY_SHMEM=y
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED=anticipatory
+# CONFIG_PREEMPT_NONE is not set
+CONFIG_PREEMPT_VOLUNTARY=y
+# CONFIG_PREEMPT is not set
+
+#
+# Blackfin Processor Options
+#
+
+#
+# Processor and Board Settings
+#
+# CONFIG_BF531 is not set
+# CONFIG_BF532 is not set
+# CONFIG_BF533 is not set
+# CONFIG_BF534 is not set
+# CONFIG_BF536 is not set
+# CONFIG_BF537 is not set
+# CONFIG_BF542 is not set
+# CONFIG_BF544 is not set
+# CONFIG_BF548 is not set
+CONFIG_BF549=y
+# CONFIG_BF561 is not set
+CONFIG_BF_REV_0_0=y
+# CONFIG_BF_REV_0_2 is not set
+# CONFIG_BF_REV_0_3 is not set
+# CONFIG_BF_REV_0_4 is not set
+# CONFIG_BF_REV_0_5 is not set
+# CONFIG_BF_REV_ANY is not set
+# CONFIG_BF_REV_NONE is not set
+CONFIG_BF54x=y
+CONFIG_BFIN_SINGLE_CORE=y
+# CONFIG_BFIN533_EZKIT is not set
+# CONFIG_BFIN533_STAMP is not set
+# CONFIG_BFIN537_STAMP is not set
+# CONFIG_BFIN533_BLUETECHNIX_CM is not set
+# CONFIG_BFIN537_BLUETECHNIX_CM is not set
+CONFIG_BFIN548_EZKIT=y
+# CONFIG_BFIN561_BLUETECHNIX_CM is not set
+# CONFIG_BFIN561_EZKIT is not set
+# CONFIG_BFIN561_TEPLA is not set
+# CONFIG_PNAV10 is not set
+# CONFIG_GENERIC_BOARD is not set
+CONFIG_IRQ_PLL_WAKEUP=7
+CONFIG_IRQ_TIMER0=11
+CONFIG_IRQ_TIMER1=11
+CONFIG_IRQ_TIMER2=11
+CONFIG_IRQ_TIMER3=11
+CONFIG_IRQ_TIMER4=11
+CONFIG_IRQ_TIMER5=11
+CONFIG_IRQ_TIMER6=11
+CONFIG_IRQ_TIMER7=11
+CONFIG_IRQ_TIMER8=11
+CONFIG_IRQ_TIMER9=11
+CONFIG_IRQ_TIMER10=11
+CONFIG_IRQ_RTC=8
+CONFIG_IRQ_SPORT0_RX=9
+CONFIG_IRQ_SPORT0_TX=9
+CONFIG_IRQ_SPORT1_RX=9
+CONFIG_IRQ_SPORT1_TX=9
+CONFIG_IRQ_UART0_RX=10
+CONFIG_IRQ_UART0_TX=10
+CONFIG_IRQ_UART1_RX=10
+CONFIG_IRQ_UART1_TX=10
+
+#
+# BF548 Specific Configuration
+#
+
+#
+# Interrupt Priority Assignment
+#
+
+#
+# Priority
+#
+CONFIG_IRQ_DMAC0_ERR=7
+CONFIG_IRQ_EPPI0_ERR=7
+CONFIG_IRQ_SPORT0_ERR=7

Blackfin arch: need to rename function after moving to match new internal dma API

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f8ffe652a01506e85e2dd579c58e50a3ba391921
Commit: f8ffe652a01506e85e2dd579c58e50a3ba391921
Parent: 7adfb58fbd0a27469d26536f99b66391c4c8e2a0
Author: Mike Frysinger [EMAIL PROTECTED]
AuthorDate: Thu Jun 21 11:34:16 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jun 21 11:34:16 2007 +0800

Blackfin arch: need to rename function after moving to match new internal 
dma API

Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/mach-bf533/dma.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/mach-bf533/dma.c b/arch/blackfin/mach-bf533/dma.c
index c4e4054..6c909cf 100644
--- a/arch/blackfin/mach-bf533/dma.c
+++ b/arch/blackfin/mach-bf533/dma.c
@@ -44,7 +44,7 @@ struct dma_register *base_addr[MAX_BLACKFIN_DMA_CHANNEL] = {
(struct dma_register *) MDMA_S1_NEXT_DESC_PTR,
 };
 
-int bf533_channel2irq(unsigned int channel)
+int channel2irq(unsigned int channel)
 {
int ret_irq = -1;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: add missing implementations SIC_IWR crosses several registers

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1c5d2265a82f8d3fa0471a60ca98072b3c53c299
Commit: 1c5d2265a82f8d3fa0471a60ca98072b3c53c299
Parent: f8ffe652a01506e85e2dd579c58e50a3ba391921
Author: Michael Hennerich [EMAIL PROTECTED]
AuthorDate: Thu Jun 21 11:34:16 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jun 21 11:34:16 2007 +0800

Blackfin arch: add missing implementations SIC_IWR crosses several registers

SIC_IWR crosses several registers
 - add missing implementations
 - make sure SIC_IWR is SET after boot

Signed-off-by: Michael Hennerich [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/mach-common/ints-priority-dc.c |3 ++
 arch/blackfin/mach-common/ints-priority-sc.c |4 +++
 include/asm-blackfin/mach-bf548/cdefBF54x_base.h |   27 +-
 include/asm-blackfin/mach-bf561/cdefBF561.h  |   10 +--
 4 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/arch/blackfin/mach-common/ints-priority-dc.c 
b/arch/blackfin/mach-common/ints-priority-dc.c
index 80943bb..e6511db 100644
--- a/arch/blackfin/mach-common/ints-priority-dc.c
+++ b/arch/blackfin/mach-common/ints-priority-dc.c
@@ -371,6 +371,9 @@ int __init init_arch_irq(void)
bfin_write_SICA_IMASK1(SIC_UNMASK_ALL);
SSYNC();
 
+   bfin_write_SICA_IWR0(IWR_ENABLE_ALL);  
+   bfin_write_SICA_IWR1(IWR_ENABLE_ALL);  
+
local_irq_disable();
 
init_exception_buff();
diff --git a/arch/blackfin/mach-common/ints-priority-sc.c 
b/arch/blackfin/mach-common/ints-priority-sc.c
index cec0f84..27838da 100644
--- a/arch/blackfin/mach-common/ints-priority-sc.c
+++ b/arch/blackfin/mach-common/ints-priority-sc.c
@@ -472,8 +472,12 @@ int __init init_arch_irq(void)
bfin_write_SIC_IMASK0(SIC_UNMASK_ALL);
bfin_write_SIC_IMASK1(SIC_UNMASK_ALL);
bfin_write_SIC_IMASK2(SIC_UNMASK_ALL);
+   bfin_write_SIC_IWR0(IWR_ENABLE_ALL);
+   bfin_write_SIC_IWR1(IWR_ENABLE_ALL);
+   bfin_write_SIC_IWR2(IWR_ENABLE_ALL);
 #else
bfin_write_SIC_IMASK(SIC_UNMASK_ALL);
+   bfin_write_SIC_IWR(IWR_ENABLE_ALL);
 #endif
 
SSYNC();
diff --git a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h 
b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
index b133800..87f2385 100644
--- a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
+++ b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
@@ -32,6 +32,7 @@
 #define _CDEF_BF54X_H
 
 #include defBF54x_base.h
+#include asm/system.h
 
 /* ** */
 /* SYSTEM  MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x*/
@@ -44,7 +45,31 @@
 #define bfin_read_PLL_DIV()bfin_read16(PLL_DIV)
 #define bfin_write_PLL_DIV(val)bfin_write16(PLL_DIV, val)
 #define bfin_read_VR_CTL() bfin_read16(VR_CTL)
-#define bfin_write_VR_CTL(val) bfin_write16(VR_CTL, val)
+/* Writing to VR_CTL initiates a PLL relock sequence. */
+static __inline__ void bfin_write_VR_CTL(unsigned int val)
+{
+   unsigned long flags, iwr0, iwr1, iwr2;
+
+   /* Enable the PLL Wakeup bit in SIC IWR */
+   iwr0 = bfin_read32(SIC_IWR0);
+   iwr1 = bfin_read32(SIC_IWR1);
+   iwr2 = bfin_read32(SIC_IWR2);
+   /* Only allow PPL Wakeup) */
+   bfin_write32(SIC_IWR0, IWR_ENABLE(0));
+   bfin_write32(SIC_IWR1, 0);
+   bfin_write32(SIC_IWR2, 0);
+
+   bfin_write16(VR_CTL, val);
+   __builtin_bfin_ssync();
+
+   local_irq_save(flags);
+   asm(IDLE;);
+   local_irq_restore(flags);
+   bfin_write32(SIC_IWR0, iwr0);
+   bfin_write32(SIC_IWR1, iwr1);
+   bfin_write32(SIC_IWR2, iwr2);
+   
+}
 #define bfin_read_PLL_STAT()   bfin_read16(PLL_STAT)
 #define bfin_write_PLL_STAT(val)   bfin_write16(PLL_STAT, val)
 #define bfin_read_PLL_LOCKCNT()bfin_read16(PLL_LOCKCNT)
diff --git a/include/asm-blackfin/mach-bf561/cdefBF561.h 
b/include/asm-blackfin/mach-bf561/cdefBF561.h
index b14f872..6e8b816 100644
--- a/include/asm-blackfin/mach-bf561/cdefBF561.h
+++ b/include/asm-blackfin/mach-bf561/cdefBF561.h
@@ -57,12 +57,14 @@
 /* Writing to VR_CTL initiates a PLL relock sequence. */
 static __inline__ void bfin_write_VR_CTL(unsigned int val)
 {
-   unsigned long flags, iwr;
+   unsigned long flags, iwr0, iwr1;
 
/* Enable the PLL Wakeup bit in SIC IWR */
-   iwr = bfin_read32(SICA_IWR0);
+   iwr0 = bfin_read32(SICA_IWR0);
+   iwr1 = bfin_read32(SICA_IWR1);
/* Only allow PPL Wakeup) */
bfin_write32(SICA_IWR0, IWR_ENABLE(0));
+   bfin_write32(SICA_IWR1, 0);
 
bfin_write16(VR_CTL, val);
__builtin_bfin_ssync();
@@ -70,7 +72,9 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
local_irq_save(flags);
asm(IDLE;);
local_irq_restore(flags);
-   

Blackfin arch: Add header files for BF548

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=088eec1192a0ae60fc218796027e622008af36c0
Commit: 088eec1192a0ae60fc218796027e622008af36c0
Parent: 4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4
Author: Roy Huang [EMAIL PROTECTED]
AuthorDate: Thu Jun 21 11:34:16 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jun 21 11:34:16 2007 +0800

Blackfin arch: Add header files for BF548

Signed-off-by: Roy Huang [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 include/asm-blackfin/mach-bf548/anomaly.h |   72 +
 include/asm-blackfin/mach-bf548/bf548.h   |  284 +++
 include/asm-blackfin/mach-bf548/bfin_serial_5xx.h |  147 ++
 include/asm-blackfin/mach-bf548/blackfin.h|  166 +++
 include/asm-blackfin/mach-bf548/dma.h |   63 +
 include/asm-blackfin/mach-bf548/irq.h |  306 +
 include/asm-blackfin/mach-bf548/mem_init.h|  189 +
 include/asm-blackfin/mach-bf548/mem_map.h |   97 +++
 8 files changed, 1324 insertions(+), 0 deletions(-)

diff --git a/include/asm-blackfin/mach-bf548/anomaly.h 
b/include/asm-blackfin/mach-bf548/anomaly.h
new file mode 100644
index 000..ddc150e
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/anomaly.h
@@ -0,0 +1,72 @@
+
+/*
+ * File: include/asm-blackfin/mach-bf548/anomaly.h
+ * Based on:
+ * Author:
+ *
+ * Created:
+ * Description:
+ *
+ * Rev:
+ *
+ * Modified:
+ *
+ *
+ * Bugs: Enter bugs at http://blackfin.uclinux.org/
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING.
+ * If not, write to the Free Software Foundation,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _MACH_ANOMALY_H_
+#define _MACH_ANOMALY_H_
+#define ANOMALY_0574 /* A multi issue instruction with dsp32shiftimm in
+   slot1 and store of a P register in slot 2 is not
+   supported */
+#define ANOMALY_05000119 /* DMA_RUN bit is not valid after a Peripheral Receive
+   Channel DMA stops */
+#define ANOMALY_05000122 /* Rx.H can not be used to access 16-bit System MMR
+   registers. */
+#define ANOMALY_05000245 /* Spurious Hardware Error from an Access in the
+   Shadow of a Conditional Branch */
+#define ANOMALY_05000255 /* Entering Hibernate Mode with RTC Seconds event
+   interrupt not functional */
+#define ANOMALY_05000265 /* Sensitivity to noise with slow input edge rates on
+   SPORT external receive and transmit clocks. */
+#define ANOMALY_05000272 /* Certain data cache write through modes fail for
+   VDDint =0.9V */
+#define ANOMALY_05000310 /* False Hardware Errors Caused by Fetches at the
+   Boundary of Reserved Memory */
+#define ANOMALY_05000312 /* Errors When SSYNC, CSYNC, or Loads to LT, LB and
+   LC Registers Are Interrupted */
+#define ANOMALY_05000324 /* TWI Slave Boot Mode Is Not Functional */
+#define ANOMALY_05000325 /* External FIFO Boot Mode Is Not Functional */
+#define ANOMALY_05000327 /* Data Lost When Core and DMA Accesses Are Made to
+   the USB FIFO Simultaneously */
+#define ANOMALY_05000328 /* Incorrect Access of OTP_STATUS During otp_write()
+   function */
+#define ANOMALY_05000329 /* Synchronous Burst Flash Boot Mode Is Not Functional
+   */
+#define ANOMALY_05000330 /* Host DMA Boot Mode Is Not Functional */
+#define ANOMALY_05000334 /* Inadequate Timing Margins on DDR DQS to DQ and DQM
+   Skew */
+#define ANOMALY_05000335 /* Inadequate Rotary Debounce Logic Duration */
+#define ANOMALY_05000336 /* Phantom Interrupt Occurs After First Configuration
+   of Host DMA Port */
+#define ANOMALY_05000337 /* Disallowed Configuration Prevents Subsequent
+   Allowed Configuration on Host DMA Port */
+#define ANOMALY_05000338 /* Slave-Mode SPI0 MISO Failure With CPHA = 0 */
+
+#endif /* _MACH_ANOMALY_H_ */
diff --git a/include/asm-blackfin/mach-bf548/bf548.h 
b/include/asm-blackfin/mach-bf548/bf548.h
new file mode 100644
index 000..0b21102
--- /dev/null
+++ 

Blackfin arch: Start untangling the CPLB handling code.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29440a2b4cd37e32dfe0fa60ef1665775b24dab1
Commit: 29440a2b4cd37e32dfe0fa60ef1665775b24dab1
Parent: 474f1a667d4bd40b6dcacc6870b70f4d2ba4e155
Author: Bernd Schmidt [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 16:25:29 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 16:25:29 2007 +0800

Blackfin arch: Start untangling the CPLB handling code.

 - Move cache initialization to C from assembly.
 - Move anomaly workaround for writing [ID]MEM_CONTROL to assembly, so
   that we don't have to mess around with .align directives in C source.
 - Fix a bug where bfin_write_DMEM_CONTROL would write to IMEM_CONTROL
 - Break out CPLB related code from kernel/setup.c into their own file.
 - Don't define variables in header files, only declare them.

Signed-off-by: Bernd Schmidt [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/kernel/Makefile  |2 +-
 arch/blackfin/kernel/cacheinit.c   |   66 +++
 arch/blackfin/kernel/cplbinit.c|  433 
 arch/blackfin/kernel/setup.c   |  289 +-
 arch/blackfin/mach-common/cacheinit.S  |   89 +
 include/asm-blackfin/cplbinit.h|  133 +--
 include/asm-blackfin/mach-common/cdef_LPBlackfin.h |   23 +-
 7 files changed, 528 insertions(+), 507 deletions(-)

diff --git a/arch/blackfin/kernel/Makefile b/arch/blackfin/kernel/Makefile
index 6fac57f..f429ebc 100644
--- a/arch/blackfin/kernel/Makefile
+++ b/arch/blackfin/kernel/Makefile
@@ -7,7 +7,7 @@ extra-y := init_task.o vmlinux.lds
 obj-y := \
entry.o process.o bfin_ksyms.o ptrace.o setup.o signal.o \
sys_bfin.o time.o traps.o irqchip.o dma-mapping.o flat.o \
-   fixed_code.o
+   fixed_code.o cplbinit.o cacheinit.o
 
 obj-$(CONFIG_BF53x) += bfin_gpio.o
 obj-$(CONFIG_BF561) += bfin_gpio.o
diff --git a/arch/blackfin/kernel/cacheinit.c b/arch/blackfin/kernel/cacheinit.c
new file mode 100644
index 000..4d41a40
--- /dev/null
+++ b/arch/blackfin/kernel/cacheinit.c
@@ -0,0 +1,66 @@
+/*
+ *   Copyright 2004-2007 Analog Devices Inc.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include linux/cpu.h
+
+#include asm/cacheflush.h
+#include asm/blackfin.h
+#include asm/cplbinit.h
+
+#if defined(CONFIG_BLKFIN_CACHE)
+void bfin_icache_init(void)
+{
+   unsigned long *table = icplb_table;
+   unsigned long ctrl;
+   int i;
+
+   for (i = 0; i  MAX_CPLBS; i++) {
+   unsigned long addr = *table++;
+   unsigned long data = *table++;
+   if (addr == (unsigned long)-1)
+   break;
+   bfin_write32(ICPLB_ADDR0 + i * 4, addr);
+   bfin_write32(ICPLB_DATA0 + i * 4, data);
+   }
+   ctrl = bfin_read_IMEM_CONTROL();
+   ctrl |= IMC | ENICPLB;
+   bfin_write_IMEM_CONTROL(ctrl);
+}
+#endif
+
+#if defined(CONFIG_BLKFIN_DCACHE)
+void bfin_dcache_init(void)
+{
+   unsigned long *table = dcplb_table;
+   unsigned long ctrl;
+   int i;
+
+   for (i = 0; i  MAX_CPLBS; i++) {
+   unsigned long addr = *table++;
+   unsigned long data = *table++;
+   if (addr == (unsigned long)-1)
+   break;
+   bfin_write32(DCPLB_ADDR0 + i * 4, addr);
+   bfin_write32(DCPLB_DATA0 + i * 4, data);
+   }
+   ctrl = bfin_read_DMEM_CONTROL();
+   ctrl |= DMEM_CNTR;
+   bfin_write_DMEM_CONTROL(ctrl);
+}
+#endif
diff --git a/arch/blackfin/kernel/cplbinit.c b/arch/blackfin/kernel/cplbinit.c
new file mode 100644
index 000..bbdb403
--- /dev/null
+++ b/arch/blackfin/kernel/cplbinit.c
@@ -0,0 +1,433 @@
+/*
+ * Blackfin CPLB initialization
+ *
+ *   Copyright 2004-2007 Analog Devices Inc.
+ *
+ * Bugs: Enter bugs at http://blackfin.uclinux.org/
+ *
+ * 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 

Blackfin arch: Clean up trace buffer handling, No major functional changes.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=669b792c77bbc30e9f4d9c95dbc918dc348c49c2
Commit: 669b792c77bbc30e9f4d9c95dbc918dc348c49c2
Parent: 29440a2b4cd37e32dfe0fa60ef1665775b24dab1
Author: Robin Getz [EMAIL PROTECTED]
AuthorDate: Thu Jun 21 16:34:08 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jun 21 16:34:08 2007 +0800

Blackfin arch: Clean up trace buffer handling, No major functional changes.

Turns on trace earlier, so crashes at kernel start should print out a
trace, making things easier to debug.

Signed-off-by: Robin Getz [EMAIL PROTECTED]
Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/kernel/setup.c  |   14 +++--
 arch/blackfin/kernel/traps.c  |   11 +--
 arch/blackfin/mach-bf533/head.S   |5 +++
 arch/blackfin/mach-bf537/head.S   |6 
 arch/blackfin/mach-bf548/head.S   |5 +++
 arch/blackfin/mach-bf561/head.S   |6 
 arch/blackfin/mach-common/entry.S |   33 
 arch/blackfin/mach-common/interrupt.S |8 ++--
 include/asm-blackfin/trace.h  |   52 +
 9 files changed, 97 insertions(+), 43 deletions(-)

diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 07c1cfd..a86bf65 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -194,6 +194,17 @@ void __init setup_arch(char **cmdline_p)
/* this give a chance to get printk() working before crash. */
 #endif
 
+   printk(KERN_INFO Hardware Trace );
+   if (bfin_read_TBUFCTL()  0x1 )
+   printk(Active );
+   else
+   printk(Off );
+   if (bfin_read_TBUFCTL()  0x2)
+   printk(and Enabled\n);
+   else
+   printk(and Disabled\n);
+
+
 #if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH)
/* we need to initialize the Flashrom device here since we might
 * do things with flash early on in the boot
@@ -397,9 +408,6 @@ void __init setup_arch(char **cmdline_p)
_bfin_swrst = bfin_read_SWRST();
 #endif
 
-   printk(KERN_INFO Hardware Trace Enabled\n);
-   bfin_write_TBUFCTL(0x03);
-
/* Copy atomic sequences to their fixed location, and sanity check that
   these locations are the ones that we advertise to userspace.  */
memcpy((void *)FIXED_CODE_START, fixed_code_start,
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 56058b0..a58d0f5 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -33,6 +33,7 @@
 #include asm/blackfin.h
 #include asm/uaccess.h
 #include asm/irq_handler.h
+#include asm/trace.h
 #include linux/interrupt.h
 #include linux/module.h
 #include linux/kallsyms.h
@@ -131,16 +132,6 @@ static int printk_address(unsigned long address)
return printk([0x%p], (void*)address);
 }
 
-#define trace_buffer_save(x) \
-   do { \
-   (x) = bfin_read_TBUFCTL(); \
-   bfin_write_TBUFCTL((x)  ~TBUFEN); \
-   } while (0)
-#define trace_buffer_restore(x) \
-   do { \
-   bfin_write_TBUFCTL((x));\
-   } while (0)
-
 asmlinkage void trap_c(struct pt_regs *fp)
 {
int j, sig = 0;
diff --git a/arch/blackfin/mach-bf533/head.S b/arch/blackfin/mach-bf533/head.S
index 7e2aa8d..7dd0e9c 100644
--- a/arch/blackfin/mach-bf533/head.S
+++ b/arch/blackfin/mach-bf533/head.S
@@ -30,6 +30,7 @@
 #include linux/linkage.h
 #include linux/init.h
 #include asm/blackfin.h
+#include asm/trace.h
 #if CONFIG_BFIN_KERNEL_CLOCK
 #include asm/mach/mem_init.h
 #endif
@@ -96,6 +97,10 @@ ENTRY(__start)
M2 = r0;
M3 = r0;
 
+   trace_buffer_start(p0,r0);
+   P0 = R1;
+   R0 = R1;
+
 #if CONFIG_DEBUG_KERNEL_START
 
 /*
diff --git a/arch/blackfin/mach-bf537/head.S b/arch/blackfin/mach-bf537/head.S
index 7d902bb..429c8a1 100644
--- a/arch/blackfin/mach-bf537/head.S
+++ b/arch/blackfin/mach-bf537/head.S
@@ -30,6 +30,8 @@
 #include linux/linkage.h
 #include linux/init.h
 #include asm/blackfin.h
+#include asm/trace.h
+
 #if CONFIG_BFIN_KERNEL_CLOCK
 #include asm/mach/mem_init.h
 #endif
@@ -93,6 +95,10 @@ ENTRY(__start)
M2 = r0;
M3 = r0;
 
+   trace_buffer_start(p0,r0);
+   P0 = R1;
+   R0 = R1;
+
/* Turn off the icache */
p0.l = (IMEM_CONTROL  0x);
p0.h = (IMEM_CONTROL  16);
diff --git a/arch/blackfin/mach-bf548/head.S b/arch/blackfin/mach-bf548/head.S
index 0e1a254..06751ae 100644
--- a/arch/blackfin/mach-bf548/head.S
+++ b/arch/blackfin/mach-bf548/head.S
@@ -29,6 +29,7 @@
 
 #include linux/linkage.h
 #include asm/blackfin.h
+#include asm/trace.h
 #if CONFIG_BFIN_KERNEL_CLOCK
 #include asm/mach/mem_init.h
 #endif
@@ -91,6 +92,10 @@ ENTRY(__stext)
M2 = r0;
M3 = r0;
 
+   trace_buffer_start(p0,r0);

Blackfin arch: Enable BF54x PIN/GPIO interrupts

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=34e0fc89bdc1e6f50032dc43ed23167f5dbad6da
Commit: 34e0fc89bdc1e6f50032dc43ed23167f5dbad6da
Parent: 1f83b8f148a1eb967d2a628cbb741cd56fb54572
Author: Michael Hennerich [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 16:17:18 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 16:17:18 2007 +0800

Blackfin arch: Enable BF54x PIN/GPIO interrupts

Signed-off-bu: Michael Hennerich [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/Kconfig|2 +-
 arch/blackfin/kernel/setup.c |4 +-
 arch/blackfin/mach-bf548/Kconfig |   34 +++
 arch/blackfin/mach-common/ints-priority-sc.c |  339 +++---
 include/asm-blackfin/hardirq.h   |4 +
 include/asm-blackfin/mach-bf548/irq.h|  101 -
 6 files changed, 446 insertions(+), 38 deletions(-)

diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 385c262..e01bfc7 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -71,7 +71,7 @@ config GENERIC_CALIBRATE_DELAY
 
 config IRQCHIP_DEMUX_GPIO
bool
-   depends on (BF53x || BF561)
+   depends on (BF53x || BF561 || BF54x)
default y
 
 source init/Kconfig
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 3309238..f59dcee 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -396,11 +396,11 @@ void __init setup_arch(char **cmdline_p)
/* check the size of the l1 area */
l1_length = _etext_l1 - _stext_l1;
if (l1_length  L1_CODE_LENGTH)
-   panic(L1 memory overflow\n);
+   panic(L1 code memory overflow\n);
 
l1_length = _ebss_l1 - _sdata_l1;
if (l1_length  L1_DATA_A_LENGTH)
-   panic(L1 memory overflow\n);
+   panic(L1 data memory overflow\n);
 
 #ifdef BF561_FAMILY
_bfin_swrst = bfin_read_SICA_SWRST();
diff --git a/arch/blackfin/mach-bf548/Kconfig b/arch/blackfin/mach-bf548/Kconfig
index b28625e..e78b03d 100644
--- a/arch/blackfin/mach-bf548/Kconfig
+++ b/arch/blackfin/mach-bf548/Kconfig
@@ -277,6 +277,40 @@ config IRQ_PINT3
 
 endmenu
 
+comment Pin Interrupt to Port Assignment
+menu Assignment
+
+config PINTx_REASSIGN
+   bool Reprogram PINT Assignment
+   default n
+   help
+ The interrupt assignment registers controls the pin-to-interrupt
+ assignment in a byte-wide manner. Each option allows you to select
+ a set of pins (High/Low Byte) of an specific Port being mapped
+ to one of the four PIN Interrupts IRQ_PINTx.
+
+ You shouldn't change any of these unless you know exactly what you're 
doing.
+ Please consult the Blackfin BF54x Processor Hardware Reference Manual.
+
+config PINT0_ASSIGN
+   hex PINT0_ASSIGN
+   depends on PINTx_REASSIGN
+   default 0x0101
+config PINT1_ASSIGN
+   hex PINT1_ASSIGN
+   depends on PINTx_REASSIGN
+   default 0x0101
+config PINT2_ASSIGN
+   hex PINT2_ASSIGN
+   depends on PINTx_REASSIGN
+   default 0x0101
+config PINT3_ASSIGN
+   hex PINT3_ASSIGN
+   depends on PINTx_REASSIGN
+   default 0x02020303
+
+endmenu
+
 endmenu
 
 endif
diff --git a/arch/blackfin/mach-common/ints-priority-sc.c 
b/arch/blackfin/mach-common/ints-priority-sc.c
index 9f962f9..09373c9 100644
--- a/arch/blackfin/mach-common/ints-priority-sc.c
+++ b/arch/blackfin/mach-common/ints-priority-sc.c
@@ -88,14 +88,13 @@ static void __init search_IAR(void)
for (ivg = 0; ivg = IVG13 - IVG7; ivg++) {
int irqn;
 
-   ivg7_13[ivg].istop = ivg7_13[ivg].ifirst =
-   ivg_table[irq_pos];
+   ivg7_13[ivg].istop = ivg7_13[ivg].ifirst = ivg_table[irq_pos];
 
for (irqn = 0; irqn  NR_PERI_INTS; irqn++) {
int iar_shift = (irqn  7) * 4;
if (ivg ==
(0xf 
-bfin_read32((unsigned long *) SIC_IAR0 +
+bfin_read32((unsigned long *)SIC_IAR0 +
 (irqn  3))  iar_shift)) {
ivg_table[irq_pos].irqno = IVG7 + irqn;
ivg_table[irq_pos].isrflag = 1  (irqn % 32);
@@ -222,7 +221,7 @@ static struct irq_chip bfin_generic_error_irqchip = {
 };
 
 static void bfin_demux_error_irq(unsigned int int_err_irq,
- struct irq_desc *intb_desc)
+struct irq_desc *intb_desc)
 {
int irq = 0;
 
@@ -286,8 +285,8 @@ static void bfin_demux_error_irq(unsigned int int_err_irq,
}
 
pr_debug(IRQ %d:
-MASKED PERIPHERAL ERROR INTERRUPT ASSERTED\n,
-  

Blackfin arch: Some memory and code optimizations - Fix SYS_IRQS

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e3f2300036b5e0f60cb64063a9686361b6be8555
Commit: e3f2300036b5e0f60cb64063a9686361b6be8555
Parent: 34e0fc89bdc1e6f50032dc43ed23167f5dbad6da
Author: Michael Hennerich [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 16:39:29 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 16:39:29 2007 +0800

Blackfin arch: Some memory and code optimizations - Fix SYS_IRQS

Signed-off-by: Michael Hennerich [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/mach-common/ints-priority-dc.c |2 +-
 arch/blackfin/mach-common/ints-priority-sc.c |   43 -
 2 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/arch/blackfin/mach-common/ints-priority-dc.c 
b/arch/blackfin/mach-common/ints-priority-dc.c
index ceb61d9..7977c2c 100644
--- a/arch/blackfin/mach-common/ints-priority-dc.c
+++ b/arch/blackfin/mach-common/ints-priority-dc.c
@@ -396,7 +396,7 @@ int __init init_arch_irq(void)
bfin_write_EVT15(evt_system_call);
CSYNC();
 
-   for (irq = 0; irq  SYS_IRQS; irq++) {
+   for (irq = 0; irq = SYS_IRQS; irq++) {
if (irq = IRQ_CORETMR)
set_irq_chip(irq, bf561_core_irqchip);
else
diff --git a/arch/blackfin/mach-common/ints-priority-sc.c 
b/arch/blackfin/mach-common/ints-priority-sc.c
index 09373c9..c3bb2fb 100644
--- a/arch/blackfin/mach-common/ints-priority-sc.c
+++ b/arch/blackfin/mach-common/ints-priority-sc.c
@@ -434,6 +434,7 @@ static void bfin_demux_gpio_irq(unsigned int intb_irq,
struct irq_desc *intb_desc)
 {
u16 i;
+   struct irq_desc *desc;
 
for (i = 0; i  MAX_BLACKFIN_GPIOS; i += 16) {
int irq = IRQ_PF0 + i;
@@ -443,7 +444,7 @@ static void bfin_demux_gpio_irq(unsigned int intb_irq,
 
while (mask) {
if (mask  1) {
-   struct irq_desc *desc = irq_desc + irq;
+   desc = irq_desc + irq;
desc-handle_irq(irq, desc);
}
irq++;
@@ -464,7 +465,7 @@ static void bfin_demux_gpio_irq(unsigned int intb_irq,
 #define PINT_BIT(x)(1  (PINT_2_BIT(x)))
 
 static unsigned char irq2pint_lut[NR_PINTS];
-static unsigned short pint2irq_lut[NR_PINT_SYS_IRQS * NR_PINT_BITS];
+static unsigned char pint2irq_lut[NR_PINT_SYS_IRQS * NR_PINT_BITS];
 
 struct pin_int_t {
unsigned int mask_set;
@@ -523,7 +524,7 @@ void init_pint_lut(void)
irq_base += (bit % 8) + ((bit / 8)  1 ? 8 : 0);
bit_pos = bit + bank * NR_PINT_BITS;
 
-   pint2irq_lut[bit_pos] = irq_base;
+   pint2irq_lut[bit_pos] = irq_base - SYS_IRQS;
irq2pint_lut[irq_base - SYS_IRQS] = bit_pos;
 
}
@@ -545,9 +546,11 @@ static void bfin_gpio_ack_irq(unsigned int irq)
 static void bfin_gpio_mask_ack_irq(unsigned int irq)
 {
u8 pint_val = irq2pint_lut[irq - SYS_IRQS];
+   u32 pintbit = PINT_BIT(pint_val);
+   u8 bank = PINT_2_BANK(pint_val);
 
-   pint[PINT_2_BANK(pint_val)]-request = PINT_BIT(pint_val);
-   pint[PINT_2_BANK(pint_val)]-mask_clear = PINT_BIT(pint_val);
+   pint[bank]-request = pintbit;
+   pint[bank]-mask_clear = pintbit;
SSYNC();
 }
 
@@ -562,9 +565,11 @@ static void bfin_gpio_mask_irq(unsigned int irq)
 static void bfin_gpio_unmask_irq(unsigned int irq)
 {
u8 pint_val = irq2pint_lut[irq - SYS_IRQS];
+   u32 pintbit = PINT_BIT(pint_val);
+   u8 bank = PINT_2_BANK(pint_val);
 
-   pint[PINT_2_BANK(pint_val)]-request = PINT_BIT(pint_val);
-   pint[PINT_2_BANK(pint_val)]-mask_set = PINT_BIT(pint_val);
+   pint[bank]-request = pintbit;
+   pint[bank]-mask_set = pintbit;
SSYNC();
 }
 
@@ -602,6 +607,8 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned 
int type)
unsigned int ret;
u16 gpionr = irq - IRQ_PA0;
u8 pint_val = irq2pint_lut[irq - SYS_IRQS];
+   u32 pintbit = PINT_BIT(pint_val);
+   u8 bank = PINT_2_BANK(pint_val);
 
if (pint_val == IRQ_NOT_AVAIL)
return -ENODEV;
@@ -630,20 +637,20 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned 
int type)
gpio_direction_input(gpionr);
 
if (type  (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
-   pint[PINT_2_BANK(pint_val)]-edge_set = PINT_BIT(pint_val);
+   pint[bank]-edge_set = pintbit;
} else {
-   pint[PINT_2_BANK(pint_val)]-edge_clear = PINT_BIT(pint_val);
+   pint[bank]-edge_clear = pintbit;
}
 
if ((type  (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)))
-   pint[PINT_2_BANK(pint_val)]-invert_set = PINT_BIT(pint_val);   
/* low 

Blackfin arch: add BF54x missing GPIO access functions

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cefe658bca9cf1d4af841c45d170ebd0f881889e
Commit: cefe658bca9cf1d4af841c45d170ebd0f881889e
Parent: e3f2300036b5e0f60cb64063a9686361b6be8555
Author: Michael Hennerich [EMAIL PROTECTED]
AuthorDate: Mon Jul 2 11:45:50 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Mon Jul 2 11:45:50 2007 +0800

Blackfin arch: add BF54x missing GPIO access functions

Signed-off-by: Michael Hennerich [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/mach-bf548/gpio.c|   17 +
 include/asm-blackfin/gpio.h|4 +++-
 include/asm-blackfin/mach-bf548/gpio.h |4 ++--
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/arch/blackfin/mach-bf548/gpio.c b/arch/blackfin/mach-bf548/gpio.c
index fac7cf3..9b1a00a 100644
--- a/arch/blackfin/mach-bf548/gpio.c
+++ b/arch/blackfin/mach-bf548/gpio.c
@@ -52,6 +52,7 @@ inline int check_gpio(unsigned short gpio)
 {
if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 \
|| gpio == GPIO_PH14 || gpio == GPIO_PH15 \
+   || gpio == GPIO_PJ14 || gpio == GPIO_PJ15 \
|| gpio  MAX_BLACKFIN_GPIOS)
return -EINVAL;
return 0;
@@ -173,3 +174,19 @@ void gpio_direction_output(unsigned short gpio)
local_irq_restore(flags);
 }
 EXPORT_SYMBOL(gpio_direction_output);
+
+void gpio_set_value(unsigned short gpio, unsigned short arg)
+{
+   if (arg)
+   gpio_array[gpio_bank(gpio)]-port_set = gpio_bit(gpio);
+   else
+   gpio_array[gpio_bank(gpio)]-port_clear = gpio_bit(gpio);
+
+}
+EXPORT_SYMBOL(gpio_set_value);
+
+unsigned short gpio_get_value(unsigned short gpio)
+{
+   return (1  (gpio_array[gpio_bank(gpio)]-port_data  
gpio_sub_n(gpio)));
+}
+EXPORT_SYMBOL(gpio_get_value);
diff --git a/include/asm-blackfin/gpio.h b/include/asm-blackfin/gpio.h
index bc0cca0..e679703 100644
--- a/include/asm-blackfin/gpio.h
+++ b/include/asm-blackfin/gpio.h
@@ -234,6 +234,7 @@
 * MODIFICATION HISTORY :
 **/
 
+#ifndef BF548_FAMILY
 void set_gpio_dir(unsigned short, unsigned short);
 void set_gpio_inen(unsigned short, unsigned short);
 void set_gpio_polar(unsigned short, unsigned short);
@@ -268,7 +269,6 @@ unsigned short get_gpiop_maska(unsigned short);
 unsigned short get_gpiop_maskb(unsigned short);
 unsigned short get_gpiop_data(unsigned short);
 
-#ifndef BF548_FAMILY
 struct gpio_port_t {
unsigned short data;
unsigned short dummy1;
@@ -363,8 +363,10 @@ void gpio_free(unsigned short);
 void gpio_set_value(unsigned short gpio, unsigned short arg);
 unsigned short gpio_get_value(unsigned short gpio);
 
+#ifndef BF548_FAMILY
 #define gpio_get_value(gpio)   get_gpio_data(gpio)
 #define gpio_set_value(gpio, value)set_gpio_data(gpio, value)
+#endif
 
 void gpio_direction_input(unsigned short gpio);
 void gpio_direction_output(unsigned short gpio);
diff --git a/include/asm-blackfin/mach-bf548/gpio.h 
b/include/asm-blackfin/mach-bf548/gpio.h
index 4528942..8c5847a 100644
--- a/include/asm-blackfin/mach-bf548/gpio.h
+++ b/include/asm-blackfin/mach-bf548/gpio.h
@@ -187,8 +187,8 @@
 #define GPIO_PJ11  155
 #define GPIO_PJ12  156
 #define GPIO_PJ13  157
-#define GPIO_PJ14  158
-#define GPIO_PJ15  159
+#define GPIO_PJ14  158 /* N/A */
+#define GPIO_PJ15  159 /* N/A */
 
 #define MAX_BLACKFIN_GPIOS 160
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: Fix Warning add some defines in BF54x header file

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c9e27ece79f6170fd1cd1a40c5de5d93456606e7
Commit: c9e27ece79f6170fd1cd1a40c5de5d93456606e7
Parent: cefe658bca9cf1d4af841c45d170ebd0f881889e
Author: Michael Hennerich [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 11:48:14 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 11:48:14 2007 +0800

Blackfin arch: Fix Warning add some defines in BF54x header file

Signed-off-by: Michael Hennerich [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 include/asm-blackfin/mach-bf548/defBF54x_base.h |   85 +--
 1 files changed, 47 insertions(+), 38 deletions(-)

diff --git a/include/asm-blackfin/mach-bf548/defBF54x_base.h 
b/include/asm-blackfin/mach-bf548/defBF54x_base.h
index 2381ac5..895ddd4 100644
--- a/include/asm-blackfin/mach-bf548/defBF54x_base.h
+++ b/include/asm-blackfin/mach-bf548/defBF54x_base.h
@@ -3050,6 +3050,15 @@
 #define  FIFO_RWM  0x1800 /* FIFO Regular Watermarks */
 #define  FIFO_UWM  0x6000 /* FIFO Urgent Watermarks */
 
+#define DLEN_8 (0  15) /* 000 - 8 bits */
+#define DLEN_10(1  15) /* 001 - 10 bits */
+#define DLEN_12(2  15) /* 010 - 12 bits */
+#define DLEN_14(3  15) /* 011 - 14 bits */
+#define DLEN_16(4  15) /* 100 - 16 bits */
+#define DLEN_18(5  15) /* 101 - 18 bits */
+#define DLEN_24(6  15) /* 110 - 24 bits */
+
+
 /* Bit masks for EPPIx_FS2W_LVB */
 
 #define   F1VB_BD  0xff   /* Vertical Blanking before 
Field 1 Active Data */
@@ -3365,32 +3374,32 @@
 /* BCODE bit field options (SYSCFG register) */
 
 #define BCODE_WAKEUP0x  /* boot according to wake-up condition */
-#define BCODE_FULLBOOT  0x0010  /* always perform full boot */ 
+#define BCODE_FULLBOOT  0x0010  /* always perform full boot */
 #define BCODE_QUICKBOOT 0x0020  /* always perform quick boot */
 #define BCODE_NOBOOT0x0030  /* always perform full boot */
 
 /* CNT_COMMAND bit field options */
- 
+
 #define W1LCNT_ZERO   0x0001   /* write 1 to load CNT_COUNTER with zero */
 #define W1LCNT_MIN0x0004   /* write 1 to load CNT_COUNTER from CNT_MIN */
 #define W1LCNT_MAX0x0008   /* write 1 to load CNT_COUNTER from CNT_MAX */
- 
+
 #define W1LMIN_ZERO   0x0010   /* write 1 to load CNT_MIN with zero */
 #define W1LMIN_CNT0x0020   /* write 1 to load CNT_MIN from CNT_COUNTER */
 #define W1LMIN_MAX0x0080   /* write 1 to load CNT_MIN from CNT_MAX */
- 
+
 #define W1LMAX_ZERO   0x0100   /* write 1 to load CNT_MAX with zero */
 #define W1LMAX_CNT0x0200   /* write 1 to load CNT_MAX from CNT_COUNTER */
 #define W1LMAX_MIN0x0400   /* write 1 to load CNT_MAX from CNT_MIN */
- 
+
 /* CNT_CONFIG bit field options */
- 
+
 #define CNTMODE_QUADENC  0x  /* quadrature encoder mode */
 #define CNTMODE_BINENC   0x0100  /* binary encoder mode */
 #define CNTMODE_UDCNT0x0200  /* up/down counter mode */
 #define CNTMODE_DIRCNT   0x0400  /* direction counter mode */
 #define CNTMODE_DIRTMR   0x0500  /* direction timer mode */
- 
+
 #define BNDMODE_COMP 0x  /* boundary compare mode */
 #define BNDMODE_ZERO 0x1000  /* boundary compare and zero mode */
 #define BNDMODE_CAPT 0x2000  /* boundary capture mode */
@@ -3403,7 +3412,7 @@
 #define EXT_CLK  0x0003
 
 /* UARTx_LCR bit field options */
- 
+
 #define WLS_5   0x/* 5 data bits */
 #define WLS_6   0x0001/* 6 data bits */
 #define WLS_7   0x0002/* 7 data bits */
@@ -3451,7 +3460,7 @@
 #define PIQ30 0x4000
 #define PIQ31 0x8000
 
-/* PORT A Bit Definitions for the registers 
+/* PORT A Bit Definitions for the registers
 PORTA, PORTA_SET, PORTA_CLEAR,
 PORTA_DIR_SET, PORTA_DIR_CLEAR, PORTA_INEN,
 PORTA_FER registers
@@ -3474,7 +3483,7 @@ PORTA_FER registers
 #define PA14 0x4000
 #define PA15 0x8000
 
-/* PORT B Bit Definitions for the registers 
+/* PORT B Bit Definitions for the registers
 PORTB, PORTB_SET, PORTB_CLEAR,
 PORTB_DIR_SET, PORTB_DIR_CLEAR, PORTB_INEN,
 PORTB_FER registers
@@ -3497,7 +3506,7 @@ PORTB_FER registers
 #define PB14 0x4000
 
 
-/* PORT C Bit Definitions for the registers 
+/* PORT C Bit Definitions for the registers
 PORTC, PORTC_SET, PORTC_CLEAR,
 PORTC_DIR_SET, PORTC_DIR_CLEAR, PORTC_INEN,
 PORTC_FER registers
@@ -3520,7 +3529,7 @@ PORTC_FER registers
 #define PC13 0x2000
 
 
-/* PORT D Bit Definitions for the registers 
+/* PORT D Bit Definitions for the registers
 PORTD, PORTD_SET, PORTD_CLEAR,
 PORTD_DIR_SET, PORTD_DIR_CLEAR, PORTD_INEN,
 PORTD_FER registers
@@ -3543,7 +3552,7 @@ PORTD_FER registers
 #define PD14 0x4000
 #define PD15 0x8000
 
-/* PORT E Bit Definitions for the registers 
+/* PORT E Bit Definitions for the registers
 PORTE, PORTE_SET, PORTE_CLEAR,
 PORTE_DIR_SET, PORTE_DIR_CLEAR, PORTE_INEN,
 PORTE_FER registers
@@ -3567,7 +3576,7 @@ PORTE_FER 

Blackfin arch: scrub dead code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9401e618c8f70920f34893946239e24d40a3519a
Commit: 9401e618c8f70920f34893946239e24d40a3519a
Parent: c9e27ece79f6170fd1cd1a40c5de5d93456606e7
Author: Mike Frysinger [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 11:50:43 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 11:50:43 2007 +0800

Blackfin arch: scrub dead code

we converted to using a system call for userspace spinlocks
rather than a dedicated exception long ago

Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/kernel/traps.c  |5 ++---
 arch/blackfin/mach-common/entry.S |   37 +++--
 2 files changed, 5 insertions(+), 37 deletions(-)

diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 114277b..3909f5b 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -193,15 +193,14 @@ asmlinkage void trap_c(struct pt_regs *fp)
 #else
/* 0x02 - User Defined, Caught by default */
 #endif
-   /* 0x03  - Atomic test and set */
+   /* 0x03 - User Defined, userspace stack overflow */
case VEC_EXCPT03:
info.si_code = SEGV_STACKFLOW;
sig = SIGSEGV;
printk(KERN_EMERG EXC_0x03);
CHK_DEBUGGER_TRAP();
break;
-   /* 0x04 - spinlock - handled by _ex_spinlock,
-   getting here is an error */
+   /* 0x04 - User Defined, Caught by default */
/* 0x05 - User Defined, Caught by default */
/* 0x06 - User Defined, Caught by default */
/* 0x07 - User Defined, Caught by default */
diff --git a/arch/blackfin/mach-common/entry.S 
b/arch/blackfin/mach-common/entry.S
index fa4e633..d61bba9 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -97,17 +97,6 @@ ENTRY(_ex_icplb)
rtx;
 ENDPROC(_ex_icplb)
 
-ENTRY(_ex_spinlock)
-   /* Transform this into a syscall - twiddle the syscall vector.  */
-   p5.l = lo(EVT15);
-   p5.h = hi(EVT15);
-   r7.l = _spinlock_bh;
-   r7.h = _spinlock_bh;
-   [p5] = r7;
-   csync;
-   /* Fall through.  */
-ENDPROC(_ex_spinlock)
-
 ENTRY(_ex_syscall)
DEBUG_START_HWTRACE(p5, r7)
(R7:6,P5:4) = [sp++];
@@ -117,26 +106,6 @@ ENTRY(_ex_syscall)
rtx
 ENDPROC(_ex_syscall)
 
-ENTRY(_spinlock_bh)
-   SAVE_ALL_SYS
-   /* To end up here, vector 15 was changed - so we have to change it
-* back.
-*/
-   p0.l = lo(EVT15);
-   p0.h = hi(EVT15);
-   p1.l = _evt_system_call;
-   p1.h = _evt_system_call;
-   [p0] = p1;
-   csync;
-   r0 = [sp + PT_R0];
-   sp += -12;
-   call _sys_bfin_spinlock;
-   sp += 12;
-   [SP + PT_R0] = R0;
-   RESTORE_ALL_SYS
-   rti;
-ENDPROC(_spinlock_bh)
-
 ENTRY(_ex_soft_bp)
r7 = retx;
r7 += -2;
@@ -775,14 +744,14 @@ ENDPROC(_init_exception_buff)
 ALIGN
 _extable:
/* entry for each EXCAUSE[5:0]
-* This table bmust be in sync with the table in ./kernel/traps.c
+* This table must be in sync with the table in ./kernel/traps.c
 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be 
user defined
 */
.long _ex_syscall;  /* 0x00 - User Defined - Linux Syscall */
.long _ex_soft_bp   /* 0x01 - User Defined - Software breakpoint */
.long _ex_trap_c/* 0x02 - User Defined */
-   .long _ex_trap_c/* 0x03 - User Defined  - Atomic test and set 
service */
-   .long _ex_spinlock  /* 0x04 - User Defined */
+   .long _ex_trap_c/* 0x03 - User Defined - userspace stack 
overflow */
+   .long _ex_trap_c/* 0x04 - User Defined */
.long _ex_trap_c/* 0x05 - User Defined */
.long _ex_trap_c/* 0x06 - User Defined */
.long _ex_trap_c/* 0x07 - User Defined */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: There is no CDPRIO Bit in the EBIU_AMGCTL Register of BF54x arch

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9be343c5bcd1cf285c2150f363bc9dd7aab8b7fb
Commit: 9be343c5bcd1cf285c2150f363bc9dd7aab8b7fb
Parent: 9401e618c8f70920f34893946239e24d40a3519a
Author: Michael Hennerich [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 11:58:44 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 11:58:44 2007 +0800

Blackfin arch: There is no CDPRIO Bit in the EBIU_AMGCTL Register of BF54x 
arch

However there are similar things in the EBIU_DDRQUE Register

Signed-off-by: Michael Hennerich [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/Kconfig   |1 +
 include/asm-blackfin/mach-bf548/bf548.h |   17 +
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index e01bfc7..6d23bcc 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -729,6 +729,7 @@ config C_AMCKEN
 
 config C_CDPRIO
bool DMA has priority over core for ext. accesses
+   depends on !BF54x
default n
 
 config C_B0PEN
diff --git a/include/asm-blackfin/mach-bf548/bf548.h 
b/include/asm-blackfin/mach-bf548/bf548.h
index 163c79e..9498313 100644
--- a/include/asm-blackfin/mach-bf548/bf548.h
+++ b/include/asm-blackfin/mach-bf548/bf548.h
@@ -32,16 +32,6 @@
 
 #define SUPPORTED_REVID 0
 
-/* Masks for generic ERROR IRQ demultiplexing used in int-priority-sc.c */
-
-#define SPI_ERR_MASK (TXCOL | RBSY | MODF | TXE)   /* SPI_STAT */
-#define SPORT_ERR_MASK (ROVF | RUVF | TOVF | TUVF) /* SPORTx_STAT */
-#define PPI_ERR_MASK (0x  ~FLD)   /* PPI_STATUS */
-#define UART_ERR_MASK_STAT1 (0x4)  /* UARTx_IIR */
-#define UART_ERR_MASK_STAT0 (0x2)  /* UARTx_IIR */
-#define CAN_ERR_MASK  (EWTIF | EWRIF | EPIF | BOIF | WUIF | UIAIF | AAIF | \
-   RMLIF | UCEIF | EXTIF | ADIF)   /* CAN_GIF */
-
 #define OFFSET_(x) ((x)  0x)
 
 /*some misc defines*/
@@ -113,13 +103,8 @@
 #else
 #define V_AMCKEN 0x0
 #endif
-#ifdef CONFIG_C_CDPRIO
-#define V_CDPRIO 0x100
-#else
-#define V_CDPRIO 0x0
-#endif
 
-#define AMGCTLVAL  (V_AMBEN | V_AMCKEN | V_CDPRIO)
+#define AMGCTLVAL  (V_AMBEN | V_AMCKEN)
 
 #define MAX_VC 65000
 #define MIN_VC 5000
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: Port the dm9000 driver to Blackfin by using the correct low-level io routines

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f40d24d909ad99c802a6813ff32b6feb20ab8c71
Commit: f40d24d909ad99c802a6813ff32b6feb20ab8c71
Parent: 9be343c5bcd1cf285c2150f363bc9dd7aab8b7fb
Author: Alex Landau [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 12:11:48 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 12:11:48 2007 +0800

Blackfin arch: Port the dm9000 driver to Blackfin by using the correct 
low-level io routines

Signed-off-by: Alex Landau [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/mach-bf537/boards/stamp.c |   26 ++
 drivers/net/Kconfig |2 +-
 drivers/net/dm9000.c|   17 -
 3 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/arch/blackfin/mach-bf537/boards/stamp.c 
b/arch/blackfin/mach-bf537/boards/stamp.c
index c637353..9c43d77 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -157,6 +157,28 @@ static struct platform_device smc91x_device = {
 };
 #endif
 
+#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
+static struct resource dm9000_resources[] = {
+   [0] = {
+   .start  = 0x203FB800,
+   .end= 0x203FB800 + 8,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = IRQ_PF9,
+   .end= IRQ_PF9,
+   .flags  = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
+   },
+};
+
+static struct platform_device dm9000_device = {
+   .name   = dm9000,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(dm9000_resources),
+   .resource   = dm9000_resources,
+};
+#endif
+
 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
 static struct resource sl811_hcd_resources[] = {
{
@@ -568,6 +590,10 @@ static struct platform_device *stamp_devices[] __initdata 
= {
smc91x_device,
 #endif
 
+#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
+   dm9000_device,
+#endif
+
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
bfin_mac_device,
 #endif
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index b941c74..80572e2 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -877,7 +877,7 @@ config NET_NETX
 
 config DM9000
tristate DM9000 support
-   depends on ARM || MIPS
+   depends on ARM || BLACKFIN || MIPS
select CRC32
select MII
---help---
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 264fa0e..c3de81b 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -104,6 +104,18 @@
 #define PRINTK(args...)   printk(KERN_DEBUG args)
 #endif
 
+#ifdef CONFIG_BLACKFIN
+#define readsb insb
+#define readsw insw
+#define readsl insl
+#define writesboutsb
+#define writeswoutsw
+#define writesloutsl
+#define DM9000_IRQ_FLAGS   (IRQF_SHARED | IRQF_TRIGGER_HIGH)
+#else
+#define DM9000_IRQ_FLAGS   IRQF_SHARED
+#endif
+
 /*
  * Transmit timeout, default 5 seconds.
  */
@@ -431,6 +443,9 @@ dm9000_probe(struct platform_device *pdev)
db-io_addr = (void __iomem *)base;
db-io_data = (void __iomem *)(base + 4);
 
+   /* ensure at least we have a default set of IO routines */
+   dm9000_set_io(db, 2);
+
} else {
db-addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
db-data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -614,7 +629,7 @@ dm9000_open(struct net_device *dev)
 
PRINTK2(entering dm9000_open\n);
 
-   if (request_irq(dev-irq, dm9000_interrupt, IRQF_SHARED, dev-name, 
dev))
+   if (request_irq(dev-irq, dm9000_interrupt, DM9000_IRQ_FLAGS, 
dev-name, dev))
return -EAGAIN;
 
/* Initialize DM9000 board */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: Disable CACHELINE_ALIGNED_L1 for BF54x by default

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=157cc5aad94fb7025c41a60788c1bfb5299010aa
Commit: 157cc5aad94fb7025c41a60788c1bfb5299010aa
Parent: f40d24d909ad99c802a6813ff32b6feb20ab8c71
Author: Michael Hennerich [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 16:20:21 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 16:20:21 2007 +0800

Blackfin arch: Disable CACHELINE_ALIGNED_L1 for BF54x by default

Signed-off-by: Michael Hennerich [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/Kconfig |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 6d23bcc..2372b03 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -540,7 +540,8 @@ config IP_CHECKSUM_L1
 
 config CACHELINE_ALIGNED_L1
bool Locate cacheline_aligned data to L1 Data Memory
-   default y
+   default y if !BF54x
+   default n if BF54x
depends on !BF531
help
  If enabled cacheline_anligned data is linked
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: fix bug set dma_address properly in dma_map_sg

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b07af760c9bd8e87c3aa9275298566379ec4e9c1
Commit: b07af760c9bd8e87c3aa9275298566379ec4e9c1
Parent: 157cc5aad94fb7025c41a60788c1bfb5299010aa
Author: Sonic Zhang [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 12:18:08 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 12:18:08 2007 +0800

Blackfin arch: fix bug set dma_address properly in dma_map_sg

Signed-off-by: Sonic Zhang [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/kernel/dma-mapping.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/blackfin/kernel/dma-mapping.c 
b/arch/blackfin/kernel/dma-mapping.c
index bda57ec..ea48d5b 100644
--- a/arch/blackfin/kernel/dma-mapping.c
+++ b/arch/blackfin/kernel/dma-mapping.c
@@ -159,10 +159,13 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, 
int nents,
 
BUG_ON(direction == DMA_NONE);
 
-   for (i = 0; i  nents; i++)
-   invalidate_dcache_range(sg_dma_address(sg[i]),
-   sg_dma_address(sg[i]) +
-   sg_dma_len(sg[i]));
+   for (i = 0; i  nents; i++, sg++) {
+   sg-dma_address = page_address(sg-page) + sg-offset;
+
+   invalidate_dcache_range(sg_dma_address(sg),
+   sg_dma_address(sg) +
+   sg_dma_len(sg));
+   }
 
return nents;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: use PAGE_SIZE when doing aligns rather than hardcoded values

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=520473b0775ce046d179afa686fb3222884c389d
Commit: 520473b0775ce046d179afa686fb3222884c389d
Parent: b07af760c9bd8e87c3aa9275298566379ec4e9c1
Author: Mike Frysinger [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 12:20:20 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 12:20:20 2007 +0800

Blackfin arch: use PAGE_SIZE when doing aligns rather than hardcoded values

Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/kernel/vmlinux.lds.S |   12 +++-
 include/asm-blackfin/page.h|4 
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/blackfin/kernel/vmlinux.lds.S 
b/arch/blackfin/kernel/vmlinux.lds.S
index 1ef1e36..d06f860 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -31,6 +31,7 @@
 
 #include asm-generic/vmlinux.lds.h
 #include asm/mem_map.h
+#include asm/page.h
 
 OUTPUT_FORMAT(elf32-bfin)
 ENTRY(__start)
@@ -63,8 +64,8 @@ SECTIONS
 
.data :
{
+   . = ALIGN(PAGE_SIZE);
__sdata = .;
-   . = ALIGN(0x2000);
*(.data.init_task)
DATA_DATA
CONSTRUCTORS
@@ -72,14 +73,14 @@ SECTIONS
. = ALIGN(32);
*(.data.cacheline_aligned)
 
-   . = ALIGN(0x2000);
+   . = ALIGN(PAGE_SIZE);
__edata = .;
}
 
+   . = ALIGN(PAGE_SIZE);
___init_begin = .;
.init :
{
-   . = ALIGN(4096);
__sinittext = .;
*(.init.text)
__einittext = .;
@@ -152,9 +153,10 @@ SECTIONS
__ebss_b_l1 = .;
}
 
-   ___init_end = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
+   . = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
+   ___init_end = ALIGN(PAGE_SIZE);
 
-   .bss LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1) :
+   .bss ___init_end :
{
. = ALIGN(4);
___bss_start = .;
diff --git a/include/asm-blackfin/page.h b/include/asm-blackfin/page.h
index ffad947..8bc8671 100644
--- a/include/asm-blackfin/page.h
+++ b/include/asm-blackfin/page.h
@@ -4,7 +4,11 @@
 /* PAGE_SHIFT determines the page size */
 
 #define PAGE_SHIFT 12
+#ifdef __ASSEMBLY__
+#define PAGE_SIZE  (1  PAGE_SHIFT)
+#else
 #define PAGE_SIZE  (1UL  PAGE_SHIFT)
+#endif
 #define PAGE_MASK  (~(PAGE_SIZE-1))
 
 #ifdef __KERNEL__
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: Add Support for Peripheral PortMux and resouce allocation

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5610db61cf2945a5e74667e952f2792c96ba53a1
Commit: 5610db61cf2945a5e74667e952f2792c96ba53a1
Parent: 520473b0775ce046d179afa686fb3222884c389d
Author: Michael Hennerich [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 12:32:52 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 12:32:52 2007 +0800

Blackfin arch: Add Support for Peripheral PortMux and resouce allocation

Signed-off-by: Michael Hennerich [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/mach-bf548/gpio.c   |  189 -
 include/asm-blackfin/gpio.h   |   50 ++
 include/asm-blackfin/mach-bf533/portmux.h |   65 ++
 include/asm-blackfin/mach-bf537/portmux.h |  109 +++
 include/asm-blackfin/mach-bf548/portmux.h |  270 +++
 include/asm-blackfin/mach-bf561/portmux.h |   87 +++
 include/asm-blackfin/portmux.h| 1133 +
 7 files changed, 1874 insertions(+), 29 deletions(-)

diff --git a/arch/blackfin/mach-bf548/gpio.c b/arch/blackfin/mach-bf548/gpio.c
index 9b1a00a..0da5f00 100644
--- a/arch/blackfin/mach-bf548/gpio.c
+++ b/arch/blackfin/mach-bf548/gpio.c
@@ -31,38 +31,64 @@
 #include linux/err.h
 #include asm/blackfin.h
 #include asm/gpio.h
+#include asm/portmux.h
 #include linux/irq.h
 
 static struct gpio_port_t *gpio_array[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
-   (struct gpio_port_t *) PORTA_FER,
-   (struct gpio_port_t *) PORTB_FER,
-   (struct gpio_port_t *) PORTC_FER,
-   (struct gpio_port_t *) PORTD_FER,
-   (struct gpio_port_t *) PORTE_FER,
-   (struct gpio_port_t *) PORTF_FER,
-   (struct gpio_port_t *) PORTG_FER,
-   (struct gpio_port_t *) PORTH_FER,
-   (struct gpio_port_t *) PORTI_FER,
-   (struct gpio_port_t *) PORTJ_FER,
+   (struct gpio_port_t *)PORTA_FER,
+   (struct gpio_port_t *)PORTB_FER,
+   (struct gpio_port_t *)PORTC_FER,
+   (struct gpio_port_t *)PORTD_FER,
+   (struct gpio_port_t *)PORTE_FER,
+   (struct gpio_port_t *)PORTF_FER,
+   (struct gpio_port_t *)PORTG_FER,
+   (struct gpio_port_t *)PORTH_FER,
+   (struct gpio_port_t *)PORTI_FER,
+   (struct gpio_port_t *)PORTJ_FER,
 };
 
-static unsigned short reserved_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
+static unsigned short reserved_gpio_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
+static unsigned short reserved_peri_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
 
 inline int check_gpio(unsigned short gpio)
 {
-   if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 \
-   || gpio == GPIO_PH14 || gpio == GPIO_PH15 \
-   || gpio == GPIO_PJ14 || gpio == GPIO_PJ15 \
-   || gpio  MAX_BLACKFIN_GPIOS)
+   if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
+   || gpio == GPIO_PH14 || gpio == GPIO_PH15
+   || gpio == GPIO_PJ14 || gpio == GPIO_PJ15
+   || gpio  MAX_BLACKFIN_GPIOS)
return -EINVAL;
return 0;
 }
 
+inline void portmux_setup(unsigned short portno, unsigned short function)
+{
+   u32 pmux;
+
+   pmux = gpio_array[gpio_bank(portno)]-port_mux;
+
+   pmux = ~(0x3  (2 * gpio_sub_n(portno)));
+   pmux |= (function  0x3)  (2 * gpio_sub_n(portno));
+
+   gpio_array[gpio_bank(portno)]-port_mux = pmux;
+
+}
+
+inline u16 get_portmux(unsigned short portno)
+{
+   u32 pmux;
+
+   pmux = gpio_array[gpio_bank(portno)]-port_mux;
+
+   return (pmux  (2 * gpio_sub_n(portno))  0x3);
+
+}
+
 static void port_setup(unsigned short gpio, unsigned short usage)
 {
if (usage == GPIO_USAGE) {
if (gpio_array[gpio_bank(gpio)]-port_fer  gpio_bit(gpio))
-   printk(KERN_WARNING bfin-gpio: Possible Conflict with 
Peripheral 
+   printk(KERN_WARNING
+  bfin-gpio: Possible Conflict with Peripheral 
   usage and GPIO %d detected!\n, gpio);
gpio_array[gpio_bank(gpio)]-port_fer = ~gpio_bit(gpio);
} else
@@ -72,18 +98,116 @@ static void port_setup(unsigned short gpio, unsigned short 
usage)
 
 static int __init bfin_gpio_init(void)
 {
-   int i;
-
printk(KERN_INFO Blackfin GPIO Controller\n);
 
-   for (i = 0; i  MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE)
-   reserved_map[gpio_bank(i)] = 0;
-
return 0;
 }
 
 arch_initcall(bfin_gpio_init);
 
+int peripheral_request(unsigned short per, const char *label)
+{
+   unsigned long flags;
+   unsigned short ident = P_IDENT(per);
+
+   if (!(per  P_DEFINED))
+   return -ENODEV;
+
+   if (check_gpio(ident)  0)
+   return -EINVAL;
+
+   local_irq_save(flags);
+
+   if (unlikely(reserved_gpio_map[gpio_bank(ident)]  gpio_bit(ident))) {
+   printk(KERN_ERR
+  %s: Peripheral %d is 

Blackfin arch: combine the common code of free_initrd_mem and free_initmem

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1d1894749cca89f4bb013364524199b3015d7b00
Commit: 1d1894749cca89f4bb013364524199b3015d7b00
Parent: 5610db61cf2945a5e74667e952f2792c96ba53a1
Author: Mike Frysinger [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 12:32:00 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 12:32:00 2007 +0800

Blackfin arch: combine the common code of free_initrd_mem and free_initmem

Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/mm/init.c |   45 +
 1 files changed, 17 insertions(+), 28 deletions(-)

diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
index 2d12449..68459cc 100644
--- a/arch/blackfin/mm/init.c
+++ b/arch/blackfin/mm/init.c
@@ -168,42 +168,31 @@ void __init mem_init(void)
}
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
+static __init void free_init_pages(const char *what, unsigned long begin, 
unsigned long end)
 {
-   int pages = 0;
-   for (; start  end; start += PAGE_SIZE) {
-   ClearPageReserved(virt_to_page(start));
-   init_page_count(virt_to_page(start));
-   free_page(start);
+   unsigned long addr;
+   /* next to check that the page we free is not a partial page */
+   for (addr = begin; addr + PAGE_SIZE = end; addr += PAGE_SIZE) {
+   ClearPageReserved(virt_to_page(addr));
+   init_page_count(virt_to_page(addr));
+   free_page(addr);
totalram_pages++;
-   pages++;
}
-   printk(KERN_NOTICE Freeing initrd memory: %dk freed\n, pages);
+   printk(KERN_INFO Freeing %s: %ldk freed\n, what, (end - begin)  10);
+}
+
+#ifdef CONFIG_BLK_DEV_INITRD
+void __init free_initrd_mem(unsigned long start, unsigned long end)
+{
+   free_init_pages(initrd memory, start, end);
 }
 #endif
 
 void __init free_initmem(void)
 {
 #ifdef CONFIG_RAMKERNEL
-   unsigned long addr;
-   /*
-*  the following code should be cool even if these sections
-*  are not page aligned.
-*/
-   addr = PAGE_ALIGN((unsigned long)(__init_begin));
-   /* next to check that the page we free is not a partial page */
-   for (; addr + PAGE_SIZE  (unsigned long)(__init_end);
-addr += PAGE_SIZE) {
-   ClearPageReserved(virt_to_page(addr));
-   init_page_count(virt_to_page(addr));
-   free_page(addr);
-   totalram_pages++;
-   }
-   printk(KERN_NOTICE
-  Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n,
-  (addr - PAGE_ALIGN((long)__init_begin))  10,
-  (int)(PAGE_ALIGN((unsigned long)(__init_begin))),
-  (int)(addr - PAGE_SIZE));
+   free_init_pages(unused kernel memory,
+   (unsigned long)(__init_begin),
+   (unsigned long)(__init_end));
 #endif
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: clean up some coding style issues

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c04d66bbbdbbc7b5d55c42795f29e494190f8fb3
Commit: c04d66bbbdbbc7b5d55c42795f29e494190f8fb3
Parent: 1d1894749cca89f4bb013364524199b3015d7b00
Author: Bryan Wu [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 17:26:31 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:26:31 2007 +0800

Blackfin arch: clean up some coding style issues

Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/mach-common/ints-priority-dc.c |4 ++--
 arch/blackfin/mach-common/ints-priority-sc.c |   13 ++---
 include/asm-blackfin/mach-bf548/cdefBF54x_base.h |1 -
 include/asm-blackfin/mach-bf561/cdefBF561.h  |1 -
 include/asm-blackfin/mman.h  |2 --
 5 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/arch/blackfin/mach-common/ints-priority-dc.c 
b/arch/blackfin/mach-common/ints-priority-dc.c
index 7977c2c..6b9fd03 100644
--- a/arch/blackfin/mach-common/ints-priority-dc.c
+++ b/arch/blackfin/mach-common/ints-priority-dc.c
@@ -371,8 +371,8 @@ int __init init_arch_irq(void)
bfin_write_SICA_IMASK1(SIC_UNMASK_ALL);
SSYNC();
 
-   bfin_write_SICA_IWR0(IWR_ENABLE_ALL);  
-   bfin_write_SICA_IWR1(IWR_ENABLE_ALL);  
+   bfin_write_SICA_IWR0(IWR_ENABLE_ALL);
+   bfin_write_SICA_IWR1(IWR_ENABLE_ALL);
 
local_irq_disable();
 
diff --git a/arch/blackfin/mach-common/ints-priority-sc.c 
b/arch/blackfin/mach-common/ints-priority-sc.c
index c3bb2fb..28a878c 100644
--- a/arch/blackfin/mach-common/ints-priority-sc.c
+++ b/arch/blackfin/mach-common/ints-priority-sc.c
@@ -147,8 +147,8 @@ static void bfin_internal_mask_irq(unsigned int irq)
unsigned mask_bank, mask_bit;
mask_bank = (irq - (IRQ_CORETMR + 1)) / 32;
mask_bit = (irq - (IRQ_CORETMR + 1)) % 32;
-   bfin_write_SIC_IMASK( mask_bank, bfin_read_SIC_IMASK(mask_bank)  \
-   ~(1  mask_bit));
+   bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) 
+~(1  mask_bit));
 #endif
SSYNC();
 }
@@ -161,9 +161,9 @@ static void bfin_internal_unmask_irq(unsigned int irq)
 #else
unsigned mask_bank, mask_bit;
mask_bank = (irq - (IRQ_CORETMR + 1)) / 32;
-   mask_bit = (irq - (IRQ_CORETMR + 1))%32;
-   bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) | \
-   ( 1  mask_bit));
+   mask_bit = (irq - (IRQ_CORETMR + 1)) % 32;
+   bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) |
+(1  mask_bit));
 #endif
SSYNC();
 }
@@ -728,7 +728,7 @@ int __init init_arch_irq(void)
bfin_write_SIC_IMASK2(SIC_UNMASK_ALL);
bfin_write_SIC_IWR0(IWR_ENABLE_ALL);
bfin_write_SIC_IWR1(IWR_ENABLE_ALL);
-   bfin_write_SIC_IWR2(IWR_ENABLE_ALL);
+   bfin_write_SIC_IWR2(IWR_ENABLE_ALL);
 #else
bfin_write_SIC_IMASK(SIC_UNMASK_ALL);
bfin_write_SIC_IWR(IWR_ENABLE_ALL);
@@ -878,7 +878,6 @@ void do_irq(int vec, struct pt_regs *fp)
sic_status[0] = bfin_read_SIC_ISR(0)  bfin_read_SIC_IMASK(0);
sic_status[1] = bfin_read_SIC_ISR(1)  bfin_read_SIC_IMASK(1);
sic_status[2] = bfin_read_SIC_ISR(2)  bfin_read_SIC_IMASK(2);
-   
 
for (;; ivg++) {
if (ivg = ivg_stop) {
diff --git a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h 
b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
index 87f2385..98d35a9 100644
--- a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
+++ b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
@@ -68,7 +68,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
bfin_write32(SIC_IWR0, iwr0);
bfin_write32(SIC_IWR1, iwr1);
bfin_write32(SIC_IWR2, iwr2);
-   
 }
 #define bfin_read_PLL_STAT()   bfin_read16(PLL_STAT)
 #define bfin_write_PLL_STAT(val)   bfin_write16(PLL_STAT, val)
diff --git a/include/asm-blackfin/mach-bf561/cdefBF561.h 
b/include/asm-blackfin/mach-bf561/cdefBF561.h
index 6e8b816..1a8ec9e 100644
--- a/include/asm-blackfin/mach-bf561/cdefBF561.h
+++ b/include/asm-blackfin/mach-bf561/cdefBF561.h
@@ -74,7 +74,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
local_irq_restore(flags);
bfin_write32(SICA_IWR0, iwr0);
bfin_write32(SICA_IWR1, iwr1);
-
 }
 #define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
 #define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
diff --git a/include/asm-blackfin/mman.h b/include/asm-blackfin/mman.h
index 4d504f9..b58f5ad 100644
--- a/include/asm-blackfin/mman.h
+++ b/include/asm-blackfin/mman.h
@@ -22,8 +22,6 @@
 #define MAP_NORESERVE  0x4000  /* don't check for reservations */
 #define MAP_POPULATE   0x8000  /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x1 /* 

Blackfin arch: extract the entry point from the linked kernel

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5cf77a5fd03c65b9dd33c283ce308a3abc4cb375
Commit: 5cf77a5fd03c65b9dd33c283ce308a3abc4cb375
Parent: c04d66bbbdbbc7b5d55c42795f29e494190f8fb3
Author: Mike Frysinger [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:26:26 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:26:26 2007 +0800

Blackfin arch: extract the entry point from the linked kernel

extract the entry point from the linked kernel rather than
assuming entry point == load address

Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/boot/Makefile |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/boot/Makefile b/arch/blackfin/boot/Makefile
index 49e8098..8cd3356 100644
--- a/arch/blackfin/boot/Makefile
+++ b/arch/blackfin/boot/Makefile
@@ -13,7 +13,8 @@ extra-y += vmlinux.bin vmlinux.gz
 
 quiet_cmd_uimage = UIMAGE  $@
   cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \
-   -C gzip -a $(CONFIG_BOOT_LOAD) -e $(CONFIG_BOOT_LOAD) -n 
'Linux-$(KERNELRELEASE)' \
+   -C gzip -n 'Linux-$(KERNELRELEASE)' -a $(CONFIG_BOOT_LOAD) \
+   -e $(shell $(NM) vmlinux | awk '$$NF == __start {print 
$$1}') \
-d $ $@
 
 $(obj)/vmlinux.bin: vmlinux FORCE
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: as pointed out by Robert P. J. Day, update the CPU_FREQ name to match current Kconfig

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=798b77095dea2f89e42f5aaa0e5b18833fea5358
Commit: 798b77095dea2f89e42f5aaa0e5b18833fea5358
Parent: 5cf77a5fd03c65b9dd33c283ce308a3abc4cb375
Author: Mike Frysinger [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:35:15 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:35:15 2007 +0800

Blackfin arch: as pointed out by Robert P. J. Day, update the CPU_FREQ name 
to match current Kconfig

Cc: Robert P. J. Day [EMAIL PROTECTED]
Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/mach-bf533/Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/mach-bf533/Makefile 
b/arch/blackfin/mach-bf533/Makefile
index 0322546..8cce173 100644
--- a/arch/blackfin/mach-bf533/Makefile
+++ b/arch/blackfin/mach-bf533/Makefile
@@ -6,4 +6,4 @@ extra-y := head.o
 
 obj-y := ints-priority.o dma.o
 
-obj-$(CONFIG_CPU_FREQ_BF533) += cpu.o
+obj-$(CONFIG_CPU_FREQ)   += cpu.o
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: add missing CONFIG_LARGE_ALLOCS when upstream merging

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=db0fa2064585a099e0c652983bd38d71ee7830f3
Commit: db0fa2064585a099e0c652983bd38d71ee7830f3
Parent: 798b77095dea2f89e42f5aaa0e5b18833fea5358
Author: Bryan Wu [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:55:05 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 14:55:05 2007 +0800

Blackfin arch: add missing CONFIG_LARGE_ALLOCS when upstream merging

Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/Kconfig |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 2372b03..017defa 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -585,6 +585,14 @@ endchoice
 
 source mm/Kconfig
 
+config LARGE_ALLOCS
+   bool Allow allocating large blocks ( 1MB) of memory
+   help
+ Allow the slab memory allocator to keep chains for very large
+ memory sizes - upto 32MB. You may need this if your system has
+ a lot of RAM, and you need to able to allocate very large
+ contiguous chunks. If unsure, say N.
+
 config BFIN_DMA_5XX
bool Enable DMA Support
depends on (BF533 || BF532 || BF531 || BF537 || BF536 || BF534 || BF561 
|| BF54x)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: set up gpio interrupt IRQ_PJ9 for BF54x ATAPI PATA driver

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e745106ce34553171a5d8d2450be07c0cffe39d5
Commit: e745106ce34553171a5d8d2450be07c0cffe39d5
Parent: db0fa2064585a099e0c652983bd38d71ee7830f3
Author: Sonic Zhang [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 15:20:25 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 15:20:25 2007 +0800

Blackfin arch: set up gpio interrupt IRQ_PJ9 for BF54x ATAPI PATA driver

Signed-off-by: Sonic Zhang [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 include/asm-blackfin/mach-bf548/irq.h |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/include/asm-blackfin/mach-bf548/irq.h 
b/include/asm-blackfin/mach-bf548/irq.h
index 58c87f0..0b3325b 100644
--- a/include/asm-blackfin/mach-bf548/irq.h
+++ b/include/asm-blackfin/mach-bf548/irq.h
@@ -318,7 +318,6 @@ Events (highest priority)  EMU 0
 #define IRQ_PI14   BFIN_PI_IRQ(14)
 #define IRQ_PI15   BFIN_PI_IRQ(15)
 
-#if 0
 #define BFIN_PJ_IRQ(x) ((x) + IRQ_PI15 + 1)
 #define IRQ_PJ0BFIN_PJ_IRQ(0)
 #define IRQ_PJ1BFIN_PJ_IRQ(1)
@@ -336,10 +335,9 @@ Events (highest priority)  EMU 0
 #define IRQ_PJ13   BFIN_PJ_IRQ(13)
 #define IRQ_PJ14   BFIN_PJ_IRQ(14) /* N/A */
 #define IRQ_PJ15   BFIN_PJ_IRQ(15) /* N/A */
-#endif
 
 #ifdef CONFIG_IRQCHIP_DEMUX_GPIO
-#define NR_IRQS (IRQ_PI15+1)
+#define NR_IRQS (IRQ_PJ15+1)
 #else
 #define NR_IRQS (SYS_IRQS+1)
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin arch: Add peripheral io API to gpio header file

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=61b59563266aa6bedaf5d45b9b25bc48bb4d3ed3
Commit: 61b59563266aa6bedaf5d45b9b25bc48bb4d3ed3
Parent: e745106ce34553171a5d8d2450be07c0cffe39d5
Author: Sonic Zhang [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 17:06:45 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:06:45 2007 +0800

Blackfin arch: Add peripheral io API to gpio header file

Signed-off-by: Sonic Zhang [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 include/asm-blackfin/mach-bf548/gpio.h |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-blackfin/mach-bf548/gpio.h 
b/include/asm-blackfin/mach-bf548/gpio.h
index 8c5847a..dbf66bc 100644
--- a/include/asm-blackfin/mach-bf548/gpio.h
+++ b/include/asm-blackfin/mach-bf548/gpio.h
@@ -210,3 +210,7 @@ struct gpio_port_t {
unsigned int port_mux;
 };
 
+int gpio_request(unsigned short gpio, const char *label);
+void peripheral_free(unsigned short per);
+int peripheral_request_list(unsigned short per[], const char *label);
+void peripheral_free_list(unsigned short per[]);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Video Console: Blackfin doesnt support VGA console

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=db83b991bce1b4792125d4b23bb108e8cfd5d366
Commit: db83b991bce1b4792125d4b23bb108e8cfd5d366
Parent: 61b59563266aa6bedaf5d45b9b25bc48bb4d3ed3
Author: Michael Hennerich [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 12:07:40 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 12:07:40 2007 +0800

Video Console: Blackfin doesnt support VGA console

Signed-off-by: Michael Hennerich [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 drivers/video/console/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 63b85bf..d3b8a6b 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -6,7 +6,7 @@ menu Console display driver support
 
 config VGA_CONSOLE
bool VGA text console if EMBEDDED || !X86
-   depends on !ARCH_ACORN  !ARCH_EBSA110  !4xx  !8xx  !SPARC  
!M68K  !PARISC  !FRV  !ARCH_VERSATILE  !SUPERH
+   depends on !ARCH_ACORN  !ARCH_EBSA110  !4xx  !8xx  !SPARC  
!M68K  !PARISC  !FRV  !ARCH_VERSATILE  !SUPERH  !BFIN
default y
help
  Saying Y here will allow you to use Linux in text mode through a
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Blackfin serial driver: supporting BF548-EZKIT serial port

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f4d640c9be1979a603ed017e1e03a16ba3a4d7a1
Commit: f4d640c9be1979a603ed017e1e03a16ba3a4d7a1
Parent: db83b991bce1b4792125d4b23bb108e8cfd5d366
Author: Roy Huang [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 16:43:46 2007 +0800
Committer:  Bryan Wu [EMAIL PROTECTED]
CommitDate: Thu Jul 12 16:43:46 2007 +0800

Blackfin serial driver: supporting BF548-EZKIT serial port

Signed-off-by: Roy Huang [EMAIL PROTECTED]
Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 drivers/serial/Kconfig|   46 +--
 drivers/serial/bfin_5xx.c |   77 +++--
 2 files changed, 117 insertions(+), 6 deletions(-)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 71a4ac5..2adbed4 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -599,7 +599,7 @@ config UART0_RTS_PIN
 
 config SERIAL_BFIN_UART1
bool Enable UART1
-   depends on SERIAL_BFIN  (BF534 || BF536 || BF537)
+   depends on SERIAL_BFIN  (BF534 || BF536 || BF537 || BF54x)
help
  Enable UART1
 
@@ -612,18 +612,58 @@ config BFIN_UART1_CTSRTS
 
 config UART1_CTS_PIN
int UART1 CTS pin
-   depends on BFIN_UART1_CTSRTS
+   depends on BFIN_UART1_CTSRTS  (BF53x || BF561)
default -1
help
  Refer to ./include/asm-blackfin/gpio.h to see the GPIO map.
 
 config UART1_RTS_PIN
int UART1 RTS pin
-   depends on BFIN_UART1_CTSRTS
+   depends on BFIN_UART1_CTSRTS  (BF53x || BF561)
default -1
help
  Refer to ./include/asm-blackfin/gpio.h to see the GPIO map.
 
+config SERIAL_BFIN_UART2
+   bool Enable UART2
+   depends on SERIAL_BFIN  (BF54x)
+   help
+ Enable UART2
+
+config BFIN_UART2_CTSRTS
+   bool Enable UART2 hardware flow control
+   depends on SERIAL_BFIN_UART2
+   help
+ Enable hardware flow control in the driver. Using GPIO emulate the 
CTS/RTS
+ signal.
+
+config UART2_CTS_PIN
+   int UART2 CTS pin
+   depends on BFIN_UART2_CTSRTS
+   default -1
+   help
+ Refer to ./include/asm-blackfin/gpio.h to see the GPIO map.
+
+config UART2_RTS_PIN
+   int UART2 RTS pin
+   depends on BFIN_UART2_CTSRTS
+   default -1
+   help
+ Refer to ./include/asm-blackfin/gpio.h to see the GPIO map.
+
+config SERIAL_BFIN_UART3
+   bool Enable UART3
+   depends on SERIAL_BFIN  (BF54x)
+   help
+ Enable UART3
+
+config BFIN_UART3_CTSRTS
+   bool Enable UART3 hardware flow control
+   depends on SERIAL_BFIN_UART3
+   help
+ Enable hardware flow control in the driver. Using GPIO emulate the 
CTS/RTS
+ signal.
+
 config SERIAL_IMX
bool IMX serial port support
depends on ARM  ARCH_IMX
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index f7926dc..66c92bc 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -86,15 +86,29 @@ static void bfin_serial_stop_tx(struct uart_port *port)
 {
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
 
+#ifdef CONFIG_BF54x
+   while (!(UART_GET_LSR(uart)  TEMT))
+   continue;
+#endif
+
 #ifdef CONFIG_SERIAL_BFIN_DMA
disable_dma(uart-tx_dma_channel);
 #else
+#ifdef CONFIG_BF54x
+   /* Waiting for Transmission Finished */
+   while (!(UART_GET_LSR(uart)  TFI))
+   continue;
+   /* Clear TFI bit */
+   UART_PUT_LSR(uart, TFI);
+   UART_CLEAR_IER(uart, ETBEI);
+#else
unsigned short ier;
 
ier = UART_GET_IER(uart);
ier = ~ETBEI;
UART_PUT_IER(uart, ier);
 #endif
+#endif
 }
 
 /*
@@ -107,12 +121,16 @@ static void bfin_serial_start_tx(struct uart_port *port)
 #ifdef CONFIG_SERIAL_BFIN_DMA
bfin_serial_dma_tx_chars(uart);
 #else
+#ifdef CONFIG_BF54x
+   UART_SET_IER(uart, ETBEI);
+#else
unsigned short ier;
ier = UART_GET_IER(uart);
ier |= ETBEI;
UART_PUT_IER(uart, ier);
bfin_serial_tx_chars(uart);
 #endif
+#endif
 }
 
 /*
@@ -121,6 +139,9 @@ static void bfin_serial_start_tx(struct uart_port *port)
 static void bfin_serial_stop_rx(struct uart_port *port)
 {
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
+#ifdef CONFIG_BF54x
+   UART_CLEAR_IER(uart, ERBFI);
+#else
unsigned short ier;
 
ier = UART_GET_IER(uart);
@@ -129,6 +150,7 @@ static void bfin_serial_stop_rx(struct uart_port *port)
 #endif
ier = ~ERBFI;
UART_PUT_IER(uart, ier);
+#endif
 }
 
 /*
@@ -325,10 +347,21 @@ static irqreturn_t bfin_serial_rx_int(int irq, void 
*dev_id)
 {
struct bfin_serial_port *uart = dev_id;
 
+#ifdef CONFIG_BF54x
+   unsigned short status;
+   spin_lock(uart-port.lock);
+   status = UART_GET_LSR(uart);
+   

[MIPS] Fix resume for 64K page size on R4000 class processors.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3bd39664481fc51d82e58a3bec6ba77febc7dfae
Commit: 3bd39664481fc51d82e58a3bec6ba77febc7dfae
Parent: 4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 08:32:21 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:05 2007 +0100

[MIPS] Fix resume for 64K page size on R4000 class processors.

Problem reported by Peter Watkins [EMAIL PROTECTED] but this is
a different fix.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/r4k_switch.S |7 +--
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 0672959..d9bfae5 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -85,12 +85,7 @@
move$28, a2
cpu_restore_nonscratch a1
 
-#if (_THREAD_SIZE - 32)  0x1
-   PTR_ADDIU   t0, $28, _THREAD_SIZE - 32
-#else
-   PTR_LI  t0, _THREAD_SIZE - 32
-   PTR_ADDUt0, $28
-#endif
+   PTR_ADDUt0, $28, _THREAD_SIZE - 32
set_saved_spt0, t1, t2
 #ifdef CONFIG_MIPS_MT_SMTC
/* Read-modify-writes of Status must be atomic on a VPE */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Revert [MIPS] DEC: Fix modpost warning.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=96532151ff3567154cac92983b9edc3138fa097c
Commit: 96532151ff3567154cac92983b9edc3138fa097c
Parent: 3bd39664481fc51d82e58a3bec6ba77febc7dfae
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 00:07:34 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:06 2007 +0100

Revert [MIPS] DEC: Fix modpost warning.

This reverts commit 8713762acf341edea9d25d6a4817f235c67bc004.
---
 drivers/tc/zs.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c
index 4fff61b..61de78a 100644
--- a/drivers/tc/zs.c
+++ b/drivers/tc/zs.c
@@ -143,7 +143,7 @@ static struct console sercons;
 static unsigned long break_pressed; /* break, really ... */
 #endif
 
-static unsigned char zs_init_regs[16] = {
+static unsigned char zs_init_regs[16] __initdata = {
0,  /* write 0 */
0,  /* write 1 */
0,  /* write 2 */
@@ -1581,7 +1581,7 @@ static void __init show_serial_version(void)
 /*  Initialize Z8530s zs_channels
  */
 
-static void probe_sccs(void)
+static void __init probe_sccs(void)
 {
struct dec_serial **pp;
int i, n, n_chips = 0, n_channels, chip, channel;
@@ -1923,7 +1923,7 @@ static struct tty_driver *serial_console_device(struct 
console *c, int *index)
  * - initialize the serial port
  * Return non-zero if we didn't find a serial port.
  */
-static int serial_console_setup(struct console *co, char *options)
+static int __init serial_console_setup(struct console *co, char *options)
 {
struct dec_serial *info;
int baud = 9600;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] DEC: Fix modpost warning.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ddfada5ac00647ed0e6091322acff9d615bf7497
Commit: ddfada5ac00647ed0e6091322acff9d615bf7497
Parent: 96532151ff3567154cac92983b9edc3138fa097c
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 00:20:01 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:07 2007 +0100

[MIPS] DEC: Fix modpost warning.

  LD  vmlinux
  SYSMAP  System.map
  SYSMAP  .tmp_System.map
  MODPOST vmlinux
WARNING: drivers/built-in.o(.data+0x2480): Section mismatch: reference to 
.init.text: (between 'sercons' and 'ds_parms')

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 drivers/tc/zs.c |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c
index 61de78a..ed979f1 100644
--- a/drivers/tc/zs.c
+++ b/drivers/tc/zs.c
@@ -136,7 +136,7 @@ struct dec_serial *zs_chain;/* list of all channels 
*/
 struct tty_struct zs_ttys[NUM_CHANNELS];
 
 #ifdef CONFIG_SERIAL_DEC_CONSOLE
-static struct console sercons;
+static struct console zs_console;
 #endif
 #if defined(CONFIG_SERIAL_DEC_CONSOLE)  defined(CONFIG_MAGIC_SYSRQ)  \
!defined(MODULE)
@@ -383,7 +383,7 @@ static void receive_chars(struct dec_serial *info)
 
 #if defined(CONFIG_SERIAL_DEC_CONSOLE)  defined(CONFIG_MAGIC_SYSRQ)  \
!defined(MODULE)
-   if (break_pressed  info-line == sercons.index) {
+   if (break_pressed  info-line == zs_console.index) {
/* Ignore the null char got when BREAK is removed.  */
if (ch == 0)
continue;
@@ -446,7 +446,7 @@ static void status_handle(struct dec_serial *info)
if ((stat  BRK_ABRT)  !(info-read_reg_zero  BRK_ABRT)) {
 #if defined(CONFIG_SERIAL_DEC_CONSOLE)  defined(CONFIG_MAGIC_SYSRQ)  \
!defined(MODULE)
-   if (info-line == sercons.index) {
+   if (info-line == zs_console.index) {
if (!break_pressed)
break_pressed = jiffies;
} else
@@ -1557,9 +1557,9 @@ static int rs_open(struct tty_struct *tty, struct file * 
filp)
}
 
 #ifdef CONFIG_SERIAL_DEC_CONSOLE
-   if (sercons.cflag  sercons.index == line) {
-   tty-termios-c_cflag = sercons.cflag;
-   sercons.cflag = 0;
+   if (zs_console.cflag  zs_console.index == line) {
+   tty-termios-c_cflag = zs_console.cflag;
+   zs_console.cflag = 0;
change_speed(info);
}
 #endif
@@ -2069,7 +2069,7 @@ static int __init serial_console_setup(struct console 
*co, char *options)
return 0;
 }
 
-static struct console sercons = {
+static struct console zs_console = {
.name   = ttyS,
.write  = serial_console_write,
.device = serial_console_device,
@@ -2083,7 +2083,7 @@ static struct console sercons = {
  */
 void __init zs_serial_console_init(void)
 {
-   register_console(sercons);
+   register_console(zs_console);
 }
 #endif /* ifdef CONFIG_SERIAL_DEC_CONSOLE */
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Hydrogen3: Remove remaining bits of code.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0adc327bda829f6f7302ca2abdbe776828db7a97
Commit: 0adc327bda829f6f7302ca2abdbe776828db7a97
Parent: ddfada5ac00647ed0e6091322acff9d615bf7497
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 14:01:06 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:08 2007 +0100

[MIPS] Hydrogen3: Remove remaining bits of code.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/au1000/common/setup.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index 13fe187..fdf2b85 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -100,9 +100,6 @@ void __init plat_mem_setup(void)
 argptr = prom_getcmdline();
 /* default panel */
 /*strcat(argptr,  video=au1100fb:panel:Sharp_320x240_16);*/
-#ifdef CONFIG_MIPS_HYDROGEN3
- strcat(argptr,  
video=au1100fb:panel:Hydrogen_3_NEC_panel_320x240,nohwcursor);
-#endif
 }
 #endif
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] RM: Use only phyiscal address for 82596 and 53c710

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9815778ae016004c33ce267a00b7d567192ef6e7
Commit: 9815778ae016004c33ce267a00b7d567192ef6e7
Parent: 0adc327bda829f6f7302ca2abdbe776828db7a97
Author: Thomas Bogendoerfer [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 19:10:39 2007 +0200
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:08 2007 +0100

[MIPS] RM: Use only phyiscal address for 82596 and 53c710

Use physical address for 82596 and 53c710 base address

Signed-off-by: Thomas Bogendoerfer [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/sni/a20r.c  |8 
 arch/mips/sni/rm200.c |4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/mips/sni/a20r.c b/arch/mips/sni/a20r.c
index 6850a29..acc9ba7 100644
--- a/arch/mips/sni/a20r.c
+++ b/arch/mips/sni/a20r.c
@@ -87,8 +87,8 @@ static struct platform_device snirm_82596_pdev = {
 
 static struct resource snirm_53c710_rsrc[] = {
{
-   .start = 0xb900,
-   .end   = 0xb90f,
+   .start = 0x1900,
+   .end   = 0x190f,
.flags = IORESOURCE_MEM
},
{
@@ -106,8 +106,8 @@ static struct platform_device snirm_53c710_pdev = {
 
 static struct resource sc26xx_rsrc[] = {
{
-   .start = 0xbc07,
-   .end   = 0xbc0700ff,
+   .start = 0x1c07,
+   .end   = 0x1c0700ff,
.flags = IORESOURCE_MEM
},
{
diff --git a/arch/mips/sni/rm200.c b/arch/mips/sni/rm200.c
index 4bfda02..28a11d8 100644
--- a/arch/mips/sni/rm200.c
+++ b/arch/mips/sni/rm200.c
@@ -88,8 +88,8 @@ static struct platform_device snirm_82596_rm200_pdev = {
 
 static struct resource snirm_53c710_rm200_rsrc[] = {
{
-   .start = 0xb900,
-   .end   = 0xb90f,
+   .start = 0x1900,
+   .end   = 0x190f,
.flags = IORESOURCE_MEM
},
{
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Workaround for a sparse warning in include/asm-mips/io.h

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c0cf500145b4154adcbc55afc1a63db24cee84a2
Commit: c0cf500145b4154adcbc55afc1a63db24cee84a2
Parent: 9815778ae016004c33ce267a00b7d567192ef6e7
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 23:12:00 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:10 2007 +0100

[MIPS] Workaround for a sparse warning in include/asm-mips/io.h

CKSEG1ADDR() returns unsigned int value on 32bit kernel.  Cast it to
unsigned long to get rid of this warning:

include2/asm/io.h:215:12: warning: cast adds address space to expression 
(asn:2)

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 include/asm-mips/io.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index 12bcc1f..7ba9289 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -212,7 +212,8 @@ static inline void __iomem * __ioremap_mode(phys_t offset, 
unsigned long size,
 */
if (__IS_LOW512(phys_addr)  __IS_LOW512(last_addr) 
flags == _CACHE_UNCACHED)
-   return (void __iomem *)CKSEG1ADDR(phys_addr);
+   return (void __iomem *)
+   (unsigned long)CKSEG1ADDR(phys_addr);
}
 
return __ioremap(offset, size, flags);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Change names of local variables to silence sparse (part 2)

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=87d43dd48d6e68095be85c4e5f991fd7c89c052e
Commit: 87d43dd48d6e68095be85c4e5f991fd7c89c052e
Parent: c0cf500145b4154adcbc55afc1a63db24cee84a2
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 23:30:40 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:10 2007 +0100

[MIPS] Change names of local variables to silence sparse (part 2)

This patch is an workaround for these sparse warnings:

include2/asm/mmu_context.h:172:2: warning: symbol 'flags' shadows an 
earlier one
include2/asm/mmu_context.h:133:16: originally declared here
include2/asm/mmu_context.h:232:2: warning: symbol 'flags' shadows an 
earlier one
include2/asm/mmu_context.h:203:16: originally declared here
include2/asm/mmu_context.h:277:3: warning: symbol 'flags' shadows an 
earlier one
include2/asm/mmu_context.h:250:16: originally declared here

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 include/asm-mips/mipsregs.h |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 706b369..18f47f1 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -707,10 +707,10 @@ do {  
\
  */
 #define __read_64bit_c0_split(source, sel) \
 ({ \
-   unsigned long long val; \
-   unsigned long flags;\
+   unsigned long long __val;   \
+   unsigned long __flags;  \
\
-   local_irq_save(flags);  \
+   local_irq_save(__flags);\
if (sel == 0)   \
__asm__ __volatile__(   \
.set\tmips64\n\t  \
@@ -719,7 +719,7 @@ do {
\
dsrl\t%M0, %M0, 32\n\t\
dsrl\t%L0, %L0, 32\n\t\
.set\tmips0   \
-   : =r (val));  \
+   : =r (__val));\
else\
__asm__ __volatile__(   \
.set\tmips64\n\t  \
@@ -728,17 +728,17 @@ do {  
\
dsrl\t%M0, %M0, 32\n\t\
dsrl\t%L0, %L0, 32\n\t\
.set\tmips0   \
-   : =r (val));  \
-   local_irq_restore(flags);   \
+   : =r (__val));\
+   local_irq_restore(__flags); \
\
-   val;\
+   __val;  \
 })
 
 #define __write_64bit_c0_split(source, sel, val)   \
 do {   \
-   unsigned long flags;\
+   unsigned long __flags;  \
\
-   local_irq_save(flags);  \
+   local_irq_save(__flags);\
if (sel == 0)   \
__asm__ __volatile__(   \
.set\tmips64\n\t  \
@@ -759,7 +759,7 @@ do {
\
dmtc0\t%L0,  #source ,  #sel \n\t \
.set\tmips0   \
: : r (val)); \
-   local_irq_restore(flags);   

[MIPS] Cleanup tlbdebug.h

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=40df3831f9b2fa386f55b580f294ea4f686704be
Commit: 40df3831f9b2fa386f55b580f294ea4f686704be
Parent: 87d43dd48d6e68095be85c4e5f991fd7c89c052e
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 00:51:00 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:11 2007 +0100

[MIPS] Cleanup tlbdebug.h

Also include tlbdebug.h in dump_tlb.c and r3k_dump_tlb.c.

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/lib/dump_tlb.c |1 +
 arch/mips/lib/r3k_dump_tlb.c |1 +
 include/asm-mips/tlbdebug.h  |4 
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/mips/lib/dump_tlb.c b/arch/mips/lib/dump_tlb.c
index 1a4db7d..465ff0e 100644
--- a/arch/mips/lib/dump_tlb.c
+++ b/arch/mips/lib/dump_tlb.c
@@ -10,6 +10,7 @@
 #include asm/mipsregs.h
 #include asm/page.h
 #include asm/pgtable.h
+#include asm/tlbdebug.h
 
 static inline const char *msk2str(unsigned int mask)
 {
diff --git a/arch/mips/lib/r3k_dump_tlb.c b/arch/mips/lib/r3k_dump_tlb.c
index 52f8779..9cee907 100644
--- a/arch/mips/lib/r3k_dump_tlb.c
+++ b/arch/mips/lib/r3k_dump_tlb.c
@@ -11,6 +11,7 @@
 #include asm/mipsregs.h
 #include asm/page.h
 #include asm/pgtable.h
+#include asm/tlbdebug.h
 
 extern int r3k_have_wired_reg; /* defined in tlb-r3k.c */
 
diff --git a/include/asm-mips/tlbdebug.h b/include/asm-mips/tlbdebug.h
index fff7a73..bb8f5c2 100644
--- a/include/asm-mips/tlbdebug.h
+++ b/include/asm-mips/tlbdebug.h
@@ -11,10 +11,6 @@
 /*
  * TLB debugging functions:
  */
-extern void dump_tlb(int first, int last);
 extern void dump_tlb_all(void);
-extern void dump_tlb_wired(void);
-extern void dump_tlb_addr(unsigned long addr);
-extern void dump_tlb_nonwired(void);
 
 #endif /* __ASM_TLBDEBUG_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Include cacheflush.h in uncache.c

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8c41286edffef0d6e7fb770b178275c8beb24055
Commit: 8c41286edffef0d6e7fb770b178275c8beb24055
Parent: 40df3831f9b2fa386f55b580f294ea4f686704be
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 00:55:40 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:13 2007 +0100

[MIPS] Include cacheflush.h in uncache.c

This fixes this sparse warning:

arch/mips/lib/uncached.c:38:22: warning: symbol 'run_uncached' was not 
declared. Should it be static?

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/lib/uncached.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/mips/lib/uncached.c b/arch/mips/lib/uncached.c
index 2388f7f..58d14f4 100644
--- a/arch/mips/lib/uncached.c
+++ b/arch/mips/lib/uncached.c
@@ -12,6 +12,7 @@
 
 #include asm/addrspace.h
 #include asm/bug.h
+#include asm/cacheflush.h
 
 #ifndef CKSEG2
 #define CKSEG2 CKSSEG
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] separate platform_device registration for VR41xx serial interface

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=891649409edbed528728b4a104d29e43e9d7473a
Commit: 891649409edbed528728b4a104d29e43e9d7473a
Parent: 8c41286edffef0d6e7fb770b178275c8beb24055
Author: Yoichi Yuasa [EMAIL PROTECTED]
AuthorDate: Wed May 9 00:03:02 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:13 2007 +0100

[MIPS] separate platform_device registration for VR41xx serial interface

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/vr41xx/common/Makefile |2 +-
 arch/mips/vr41xx/common/siu.c|  120 
 drivers/serial/vr41xx_siu.c  |  143 --
 include/asm-mips/vr41xx/siu.h|2 +
 4 files changed, 153 insertions(+), 114 deletions(-)

diff --git a/arch/mips/vr41xx/common/Makefile b/arch/mips/vr41xx/common/Makefile
index f842783..fcf94d7 100644
--- a/arch/mips/vr41xx/common/Makefile
+++ b/arch/mips/vr41xx/common/Makefile
@@ -2,4 +2,4 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o icu.o init.o irq.o pmu.o type.o
+obj-y  += bcu.o cmu.o icu.o init.o irq.o pmu.o siu.o type.o
diff --git a/arch/mips/vr41xx/common/siu.c b/arch/mips/vr41xx/common/siu.c
new file mode 100644
index 000..a1e7741
--- /dev/null
+++ b/arch/mips/vr41xx/common/siu.c
@@ -0,0 +1,120 @@
+/*
+ *  NEC VR4100 series SIU platform device.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa [EMAIL PROTECTED]
+ *
+ *  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.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include linux/errno.h
+#include linux/init.h
+#include linux/ioport.h
+#include linux/platform_device.h
+#include linux/serial_core.h
+
+#include asm/cpu.h
+#include asm/vr41xx/siu.h
+
+static unsigned int siu_type1_ports[SIU_PORTS_MAX] __initdata = {
+   PORT_VR41XX_SIU,
+   PORT_UNKNOWN,
+};
+
+static struct resource siu_type1_resource[] __initdata = {
+   {
+   .start  = 0x0c00,
+   .end= 0x0c0a,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = SIU_IRQ,
+   .end= SIU_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static unsigned int siu_type2_ports[SIU_PORTS_MAX] __initdata = {
+   PORT_VR41XX_SIU,
+   PORT_VR41XX_DSIU,
+};
+
+static struct resource siu_type2_resource[] __initdata = {
+   {
+   .start  = 0x0f000800,
+   .end= 0x0f00080a,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = 0x0f000820,
+   .end= 0x0f000829,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = SIU_IRQ,
+   .end= SIU_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = DSIU_IRQ,
+   .end= DSIU_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static int __init vr41xx_siu_add(void)
+{
+   struct platform_device *pdev;
+   struct resource *res;
+   unsigned int num;
+   int retval;
+
+   pdev = platform_device_alloc(SIU, -1);
+   if (!pdev)
+   return -ENOMEM;
+
+   switch (current_cpu_data.cputype) {
+   case CPU_VR4111:
+   case CPU_VR4121:
+   pdev-dev.platform_data = siu_type1_ports;
+   res = siu_type1_resource;
+   num = ARRAY_SIZE(siu_type1_resource);
+   break;
+   case CPU_VR4122:
+   case CPU_VR4131:
+   case CPU_VR4133:
+   pdev-dev.platform_data = siu_type2_ports;
+   res = siu_type2_resource;
+   num = ARRAY_SIZE(siu_type2_resource);
+   break;
+   default:
+   retval = -ENODEV;
+   goto err_free_device;
+   }
+
+   retval = platform_device_add_resources(pdev, res, num);
+   if (retval)
+   goto err_free_device;
+
+   retval = platform_device_add(pdev);
+   if (retval)
+   goto err_free_device;
+
+   return 0;
+
+err_free_device:
+   platform_device_put(pdev);
+
+   return retval;
+}
+device_initcall(vr41xx_siu_add);
diff --git a/drivers/serial/vr41xx_siu.c 

[MIPS] MIPSsim: Fix build.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a74b4605181595c633ff4cfd44949886b0918172
Commit: a74b4605181595c633ff4cfd44949886b0918172
Parent: 891649409edbed528728b4a104d29e43e9d7473a
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 17:41:14 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:14 2007 +0100

[MIPS] MIPSsim: Fix build.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/mipssim/sim_int.c   |2 +-
 arch/mips/mipssim/sim_setup.c |2 +-
 arch/mips/mipssim/sim_time.c  |1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/mips/mipssim/sim_int.c b/arch/mips/mipssim/sim_int.c
index d86b372..5cbc350 100644
--- a/arch/mips/mipssim/sim_int.c
+++ b/arch/mips/mipssim/sim_int.c
@@ -77,7 +77,7 @@ asmlinkage void plat_irq_dispatch(void)
irq = irq_ffs(pending);
 
if (irq  0)
-   do_IRQ(MIPSCPU_INT_BASE + irq);
+   do_IRQ(MIPS_CPU_IRQ_BASE + irq);
else
spurious_interrupt();
 }
diff --git a/arch/mips/mipssim/sim_setup.c b/arch/mips/mipssim/sim_setup.c
index 3643582..60e6690 100644
--- a/arch/mips/mipssim/sim_setup.c
+++ b/arch/mips/mipssim/sim_setup.c
@@ -84,7 +84,7 @@ static void __init serial_init(void)
/* hardware int 4 - the serial int, is CPU int 6
 but poll for now */
s.irq =  0;
-   s.uartclk = BASE_BAUD * 16;
+   s.uartclk = 1843200;
s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
s.iotype = UPIO_PORT;
s.regshift = 0;
diff --git a/arch/mips/mipssim/sim_time.c b/arch/mips/mipssim/sim_time.c
index 874a18e..a0f5a5d 100644
--- a/arch/mips/mipssim/sim_time.c
+++ b/arch/mips/mipssim/sim_time.c
@@ -5,7 +5,6 @@
 #include linux/spinlock.h
 #include linux/interrupt.h
 #include linux/mc146818rtc.h
-#include linux/mipsregs.h
 #include linux/smp.h
 #include linux/timex.h
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Separate platform_device registration for VR41xx GPIO

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=44173fb2e83183b585e137e6fee8ba32460f5645
Commit: 44173fb2e83183b585e137e6fee8ba32460f5645
Parent: a74b4605181595c633ff4cfd44949886b0918172
Author: Yoichi Yuasa [EMAIL PROTECTED]
AuthorDate: Thu May 10 22:21:35 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:15 2007 +0100

[MIPS] Separate platform_device registration for VR41xx GPIO

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/vr41xx/common/Makefile |2 +-
 arch/mips/vr41xx/common/giu.c|  122 +++
 drivers/char/vr41xx_giu.c|  132 ++
 include/asm-mips/vr41xx/giu.h|9 +++
 4 files changed, 166 insertions(+), 99 deletions(-)

diff --git a/arch/mips/vr41xx/common/Makefile b/arch/mips/vr41xx/common/Makefile
index fcf94d7..22b074e 100644
--- a/arch/mips/vr41xx/common/Makefile
+++ b/arch/mips/vr41xx/common/Makefile
@@ -2,4 +2,4 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o icu.o init.o irq.o pmu.o siu.o type.o
+obj-y  += bcu.o cmu.o giu.o icu.o init.o irq.o pmu.o siu.o type.o
diff --git a/arch/mips/vr41xx/common/giu.c b/arch/mips/vr41xx/common/giu.c
new file mode 100644
index 000..d21f6f2
--- /dev/null
+++ b/arch/mips/vr41xx/common/giu.c
@@ -0,0 +1,122 @@
+/*
+ *  NEC VR4100 series GIU platform device.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa [EMAIL PROTECTED]
+ *
+ *  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.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include linux/errno.h
+#include linux/init.h
+#include linux/ioport.h
+#include linux/platform_device.h
+
+#include asm/cpu.h
+#include asm/vr41xx/giu.h
+#include asm/vr41xx/irq.h
+
+static struct resource giu_50pins_pullupdown_resource[] __initdata = {
+   {
+   .start  = 0x0b000100,
+   .end= 0x0b00011f,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = 0x0b0002e0,
+   .end= 0x0b0002e3,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = GIUINT_IRQ,
+   .end= GIUINT_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct resource giu_36pins_resource[] __initdata = {
+   {
+   .start  = 0x0f000140,
+   .end= 0x0f00015f,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = GIUINT_IRQ,
+   .end= GIUINT_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct resource giu_48pins_resource[] __initdata = {
+   {
+   .start  = 0x0f000140,
+   .end= 0x0f000167,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = GIUINT_IRQ,
+   .end= GIUINT_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static int __init vr41xx_giu_add(void)
+{
+   struct platform_device *pdev;
+   struct resource *res;
+   unsigned int num;
+   int retval;
+
+   pdev = platform_device_alloc(GIU, -1);
+   if (!pdev)
+   return -ENOMEM;
+
+   switch (current_cpu_data.cputype) {
+   case CPU_VR4111:
+   case CPU_VR4121:
+   pdev-id = GPIO_50PINS_PULLUPDOWN;
+   res = giu_50pins_pullupdown_resource;
+   num = ARRAY_SIZE(giu_50pins_pullupdown_resource);
+   break;
+   case CPU_VR4122:
+   case CPU_VR4131:
+   pdev-id = GPIO_36PINS;
+   res = giu_36pins_resource;
+   num = ARRAY_SIZE(giu_36pins_resource);
+   break;
+   case CPU_VR4133:
+   pdev-id = GPIO_48PINS_EDGE_SELECT;
+   res = giu_48pins_resource;
+   num = ARRAY_SIZE(giu_48pins_resource);
+   break;
+   default:
+   retval = -ENODEV;
+   goto err_free_device;
+   }
+
+   retval = platform_device_add_resources(pdev, res, num);
+   if (retval)
+   goto err_free_device;
+
+   retval = platform_device_add(pdev);
+   if (retval)
+   goto err_free_device;
+
+   return 0;
+

[MIPS] separate platform_device registration for VR41xx RTC

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bd0765098bf22eb8b1319f649a4c3301b40ec04c
Commit: bd0765098bf22eb8b1319f649a4c3301b40ec04c
Parent: 44173fb2e83183b585e137e6fee8ba32460f5645
Author: Yoichi Yuasa [EMAIL PROTECTED]
AuthorDate: Fri May 11 21:18:48 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:15 2007 +0100

[MIPS] separate platform_device registration for VR41xx RTC

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/vr41xx/common/Makefile |2 +-
 arch/mips/vr41xx/common/rtc.c|  117 
 drivers/rtc/rtc-vr41xx.c |  186 +++---
 3 files changed, 190 insertions(+), 115 deletions(-)

diff --git a/arch/mips/vr41xx/common/Makefile b/arch/mips/vr41xx/common/Makefile
index 22b074e..d0d84ec 100644
--- a/arch/mips/vr41xx/common/Makefile
+++ b/arch/mips/vr41xx/common/Makefile
@@ -2,4 +2,4 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o giu.o icu.o init.o irq.o pmu.o siu.o type.o
+obj-y  += bcu.o cmu.o giu.o icu.o init.o irq.o pmu.o rtc.o siu.o type.o
diff --git a/arch/mips/vr41xx/common/rtc.c b/arch/mips/vr41xx/common/rtc.c
new file mode 100644
index 000..cce605b
--- /dev/null
+++ b/arch/mips/vr41xx/common/rtc.c
@@ -0,0 +1,117 @@
+/*
+ *  NEC VR4100 series RTC platform device.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa [EMAIL PROTECTED]
+ *
+ *  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.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include linux/errno.h
+#include linux/init.h
+#include linux/ioport.h
+#include linux/platform_device.h
+
+#include asm/cpu.h
+#include asm/vr41xx/irq.h
+
+static struct resource rtc_type1_resource[] __initdata = {
+   {
+   .start  = 0x0bc0,
+   .end= 0x0bdf,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = 0x0b0001c0,
+   .end= 0x0b0001df,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = ELAPSEDTIME_IRQ,
+   .end= ELAPSEDTIME_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = RTCLONG1_IRQ,
+   .end= RTCLONG1_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct resource rtc_type2_resource[] __initdata = {
+   {
+   .start  = 0x0f000100,
+   .end= 0x0f00011f,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = 0x0f000120,
+   .end= 0x0f00013f,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = ELAPSEDTIME_IRQ,
+   .end= ELAPSEDTIME_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = RTCLONG1_IRQ,
+   .end= RTCLONG1_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static int __init vr41xx_rtc_add(void)
+{
+   struct platform_device *pdev;
+   struct resource *res;
+   unsigned int num;
+   int retval;
+
+   pdev = platform_device_alloc(RTC, -1);
+   if (!pdev)
+   return -ENOMEM;
+
+   switch (current_cpu_data.cputype) {
+   case CPU_VR4111:
+   case CPU_VR4121:
+   res = rtc_type1_resource;
+   num = ARRAY_SIZE(rtc_type1_resource);
+   break;
+   case CPU_VR4122:
+   case CPU_VR4131:
+   case CPU_VR4133:
+   res = rtc_type2_resource;
+   num = ARRAY_SIZE(rtc_type2_resource);
+   break;
+   default:
+   retval = -ENODEV;
+   goto err_free_device;
+   }
+
+   retval = platform_device_add_resources(pdev, res, num);
+   if (retval)
+   goto err_free_device;
+
+   retval = platform_device_add(pdev);
+   if (retval)
+   goto err_free_device;
+
+   return 0;
+
+err_free_device:
+   platform_device_put(pdev);
+
+   return retval;
+}
+device_initcall(vr41xx_rtc_add);
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index af7596e..ce2f78d 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c

[MIPS] SMTC: Interrupt mask backstop hack

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0db34215c7e0ef618e7b29fbf271194ca5434f8e
Commit: 0db34215c7e0ef618e7b29fbf271194ca5434f8e
Parent: bd0765098bf22eb8b1319f649a4c3301b40ec04c
Author: Kevin D. Kissell [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 16:21:08 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:17 2007 +0100

[MIPS] SMTC: Interrupt mask backstop hack

To support multiple TC microthreads acting as CPUs within a VPE,
VPE-wide interrupt mask bits must be specially manipulated during
interrupt handling. To support legacy drivers and interrupt controller
management code, SMTC has a backstop to track and if necessary restore
the interrupt mask. This has some performance impact on interrupt service
overhead. Disable it only if you know what you are doing.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/Kconfig|   13 +
 arch/mips/kernel/entry.S |2 ++
 arch/mips/kernel/genex.S |2 ++
 include/asm-mips/irq.h   |2 +-
 4 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index a00fabe..49f02e3 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1404,6 +1404,19 @@ config MIPS_MT_SMTC_INSTANT_REPLAY
  it off), but ensures that IPIs are handled promptly even under
  heavy I/O interrupt load.
 
+config MIPS_MT_SMTC_IM_BACKSTOP
+   bool Use per-TC register bits as backstop for inhibited IM bits
+   depends on MIPS_MT_SMTC
+   default y
+   help
+ To support multiple TC microthreads acting as CPUs within
+ a VPE, VPE-wide interrupt mask bits must be specially manipulated
+ during interrupt handling. To support legacy drivers and interrupt
+ controller management code, SMTC has a backstop to track and
+ if necessary restore the interrupt mask. This has some performance
+ impact on interrupt service overhead. Disable it only if you know
+ what you are doing.
+
 config MIPS_VPE_LOADER_TOM
bool Load VPE program into memory hidden from linux
depends on MIPS_VPE_LOADER
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index 686249c..e29598a 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -84,6 +84,7 @@ FEXPORT(restore_all)  # restore full frame
LONG_S  sp, TI_REGS($28)
jal deferred_smtc_ipi
LONG_S  s0, TI_REGS($28)
+#ifdef CONFIG_MIPS_MT_SMTC_IM_BACKSTOP
 /* Re-arm any temporarily masked interrupts not explicitly acked */
mfc0v0, CP0_TCSTATUS
ori v1, v0, TCSTATUS_IXMT
@@ -110,6 +111,7 @@ FEXPORT(restore_all)# restore full 
frame
_ehb
xor t0, t0, t3
mtc0t0, CP0_TCCONTEXT
+#endif /* CONFIG_MIPS_MT_SMTC_IM_BACKSTOP */
 #endif /* CONFIG_MIPS_MT_SMTC */
.setnoat
RESTORE_TEMP
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 297bd56..c0f19d6 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -243,9 +243,11 @@ NESTED(except_vec_vi_handler, 0, sp)
 */
mfc0t1, CP0_STATUS
and t0, a0, t1
+#ifdef CONFIG_MIPS_MT_SMTC_IM_BACKSTOP
mfc0t2, CP0_TCCONTEXT
or  t0, t0, t2
mtc0t0, CP0_TCCONTEXT
+#endif /* CONFIG_MIPS_MT_SMTC_IM_BACKSTOP */
xor t1, t1, t0
mtc0t1, CP0_STATUS
_ehb
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index 3ca6a07..97102eb 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -24,7 +24,7 @@ static inline int irq_canonicalize(int irq)
 #define irq_canonicalize(irq) (irq)/* Sane hardware, sane code ... */
 #endif
 
-#ifdef CONFIG_MIPS_MT_SMTC
+#ifdef CONFIG_MIPS_MT_SMTC_IM_BACKSTOP
 /*
  * Clear interrupt mask handling backstop if irq_hwmask
  * entry so indicates. This implies that the ack() or end()
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Fix a sparse warning in arch/mips/pci/pci.c

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8ed07a1cce1530d2fd42e23c867a7c0c1170515a
Commit: 8ed07a1cce1530d2fd42e23c867a7c0c1170515a
Parent: 0db34215c7e0ef618e7b29fbf271194ca5434f8e
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Fri Jul 13 01:26:52 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:17 2007 +0100

[MIPS] Fix a sparse warning in arch/mips/pci/pci.c

Fixes this warning:

arch/mips/pci/pci.c:284:18: warning: symbol 'dev' shadows an earlier one
arch/mips/pci/pci.c:272:17: originally declared here

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/pci/pci.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 8108231..99d8f4f 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -269,7 +269,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
}
 
for (ln = bus-devices.next; ln != bus-devices; ln = ln-next) {
-   struct pci_dev *dev = pci_dev_b(ln);
+   dev = pci_dev_b(ln);
 
if ((dev-class  8) != PCI_CLASS_BRIDGE_PCI)
pcibios_fixup_device_resources(dev, bus);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Sparse: Use NULL for pointer

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=28fc582cc9b7fc6ed6a9fbf9565a2b1e56eee880
Commit: 28fc582cc9b7fc6ed6a9fbf9565a2b1e56eee880
Parent: 8ed07a1cce1530d2fd42e23c867a7c0c1170515a
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Fri Jul 13 01:49:49 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:20 2007 +0100

[MIPS] Sparse: Use NULL for pointer

This fixes a sparse warning:

arch/mips/kernel/traps.c:376:44: warning: Using plain integer as NULL 
pointer

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/traps.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 80ea4fa..5e9fa83 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -373,7 +373,7 @@ asmlinkage void do_be(struct pt_regs *regs)
action = MIPS_BE_FIXUP;
 
if (board_be_handler)
-   action = board_be_handler(regs, fixup != 0);
+   action = board_be_handler(regs, fixup != NULL);
 
switch (action) {
case MIPS_BE_DISCARD:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Don't use genrtc.

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fdc1f93847ea618e51f001805e022794d8b3
Commit: fdc1f93847ea618e51f001805e022794d8b3
Parent: 1f2c6d6b0c553e44273aaee24820c67ebfbbfebe
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 17:41:21 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:21 2007 +0100

[MIPS] Don't use genrtc.

The only pseudo-legitimate MIPS user of genrtc was a systems that doesn't
have an RTC in hardware at all.  At this point faking one is a little
pointless ...
---
 arch/mips/configs/yosemite_defconfig |2 -
 drivers/char/Kconfig |2 +-
 include/asm-mips/rtc.h   |   73 --
 3 files changed, 1 insertions(+), 76 deletions(-)

diff --git a/arch/mips/configs/yosemite_defconfig 
b/arch/mips/configs/yosemite_defconfig
index f1cdb12..f342d8c 100644
--- a/arch/mips/configs/yosemite_defconfig
+++ b/arch/mips/configs/yosemite_defconfig
@@ -592,8 +592,6 @@ CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_RTC is not set
-CONFIG_GEN_RTC=y
-CONFIG_GEN_RTC_X=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index ef683eb..a31c6d2 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -815,7 +815,7 @@ config SGI_IP27_RTC
 
 config GEN_RTC
tristate Generic /dev/rtc emulation
-   depends on RTC!=y  !IA64  !ARM  !M32R  !SPARC  !FRV  !S390 
 !SUPERH
+   depends on RTC!=y  !IA64  !ARM  !M32R  !MIPS  !SPARC  !FRV 
 !S390  !SUPERH
---help---
  If you say Y here and create a character special file /dev/rtc with
  major number 10 and minor number 135 using mknod (man mknod), you
diff --git a/include/asm-mips/rtc.h b/include/asm-mips/rtc.h
deleted file mode 100644
index 82ad401..000
--- a/include/asm-mips/rtc.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * include/asm-mips/rtc.h
- *
- * (Really an interface for drivers/char/genrtc.c)
- *
- * Copyright (C) 2004 MontaVista Software Inc.
- * Author: Jun Sun, [EMAIL PROTECTED] or [EMAIL PROTECTED]
- *
- * Please read the COPYING file for all license details.
- */
-
-#ifndef _MIPS_RTC_H
-#define _MIPS_RTC_H
-
-#ifdef __KERNEL__
-
-#include linux/rtc.h
-#include asm/time.h
-
-#define RTC_PIE 0x40/* periodic interrupt enable */
-#define RTC_AIE 0x20/* alarm interrupt enable */
-#define RTC_UIE 0x10/* update-finished interrupt enable */
-
-/* some dummy definitions */
-#define RTC_BATT_BAD 0x100  /* battery bad */
-#define RTC_SQWE 0x08   /* enable square-wave output */
-#define RTC_DM_BINARY 0x04  /* all time/date values are BCD if clear */
-#define RTC_24H 0x02/* 24 hour mode - else hours bit 7 means pm */
-#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */
-
-static inline unsigned int get_rtc_time(struct rtc_time *time)
-{
-   unsigned long nowtime;
-
-   nowtime = rtc_mips_get_time();
-   to_tm(nowtime, time);
-   time-tm_year -= 1900;
-
-   return RTC_24H;
-}
-
-static inline int set_rtc_time(struct rtc_time *time)
-{
-   unsigned long nowtime;
-   int ret;
-
-   nowtime = mktime(time-tm_year+1900, time-tm_mon+1,
-   time-tm_mday, time-tm_hour, time-tm_min,
-   time-tm_sec);
-   ret = rtc_mips_set_time(nowtime);
-
-   return ret;
-}
-
-static inline unsigned int get_rtc_ss(void)
-{
-   struct rtc_time h;
-
-   get_rtc_time(h);
-   return h.tm_sec;
-}
-
-static inline int get_rtc_pll(struct rtc_pll_info *pll)
-{
-   return -EINVAL;
-}
-
-static inline int set_rtc_pll(struct rtc_pll_info *pll)
-{
-   return -EINVAL;
-}
-#endif
-#endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Rename PC speaker code

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de61b542b822746d1498718c40f5dd740da49629
Commit: de61b542b822746d1498718c40f5dd740da49629
Parent: fdc1f93847ea618e51f001805e022794d8b3
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 17:41:23 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:23 2007 +0100

[MIPS] Rename PC speaker code

While the PC speaker is wired up to the i8254 there is more to the i8254
than just the PC speaker so this code was getting in the way under its
current name.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/Kconfig |8 
 arch/mips/configs/jazz_defconfig  |2 +-
 arch/mips/configs/qemu_defconfig  |2 +-
 arch/mips/configs/rm200_defconfig |2 +-
 arch/mips/kernel/Makefile |2 +-
 arch/mips/kernel/i8253.c  |   28 
 arch/mips/kernel/pcspeaker.c  |   28 
 7 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 49f02e3..5c863bc 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -117,9 +117,9 @@ config MACH_JAZZ
select ARC32
select ARCH_MAY_HAVE_PC_FDC
select GENERIC_ISA_DMA
-   select I8253
select I8259
select ISA
+   select PCSPEAKER
select SYS_HAS_CPU_R4X00
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
@@ -347,9 +347,9 @@ config QEMU
select DMA_COHERENT
select GENERIC_ISA_DMA
select HAVE_STD_PC_SERIAL_PORT
-   select I8253
select I8259
select ISA
+   select PCSPEAKER
select SWAP_IO_SPACE
select SYS_HAS_CPU_MIPS32_R1
select SYS_SUPPORTS_32BIT_KERNEL
@@ -562,9 +562,9 @@ config SNI_RM
select HW_HAS_EISA
select HW_HAS_PCI
select IRQ_CPU
-   select I8253
select I8259
select ISA
+   select PCSPEAKER
select SWAP_IO_SPACE if CPU_BIG_ENDIAN
select SYS_HAS_CPU_R4X00
select SYS_HAS_CPU_R5000
@@ -1864,7 +1864,7 @@ config MMU
bool
default y
 
-config I8253
+config PCSPEAKER
bool
 
 source drivers/pcmcia/Kconfig
diff --git a/arch/mips/configs/jazz_defconfig b/arch/mips/configs/jazz_defconfig
index dd04eec..8a0b4ac 100644
--- a/arch/mips/configs/jazz_defconfig
+++ b/arch/mips/configs/jazz_defconfig
@@ -241,7 +241,7 @@ CONFIG_DEFAULT_IOSCHED=anticipatory
 #
 CONFIG_ISA=y
 CONFIG_MMU=y
-CONFIG_I8253=y
+CONFIG_PCSPEAKER=y
 
 #
 # PCCARD (PCMCIA/CardBus) support
diff --git a/arch/mips/configs/qemu_defconfig b/arch/mips/configs/qemu_defconfig
index 6cca105..703de00 100644
--- a/arch/mips/configs/qemu_defconfig
+++ b/arch/mips/configs/qemu_defconfig
@@ -221,7 +221,7 @@ CONFIG_DEFAULT_IOSCHED=noop
 #
 CONFIG_ISA=y
 CONFIG_MMU=y
-CONFIG_I8253=y
+CONFIG_PCSPEAKER=y
 
 #
 # PCCARD (PCMCIA/CardBus) support
diff --git a/arch/mips/configs/rm200_defconfig 
b/arch/mips/configs/rm200_defconfig
index 1a67a85..a5dc5cb 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -251,7 +251,7 @@ CONFIG_PCI=y
 CONFIG_ISA=y
 # CONFIG_EISA is not set
 CONFIG_MMU=y
-CONFIG_I8253=y
+CONFIG_PCSPEAKER=y
 
 #
 # PCCARD (PCMCIA/CardBus) support
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 961594c..5c8085b 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -63,7 +63,7 @@ obj-$(CONFIG_PROC_FS) += proc.o
 
 obj-$(CONFIG_64BIT)+= cpu-bugs64.o
 
-obj-$(CONFIG_I8253)+= i8253.o
+obj-$(CONFIG_PCSPEAKER)+= pcspeaker.o
 
 obj-$(CONFIG_KEXEC)+= machine_kexec.o relocate_kernel.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
deleted file mode 100644
index 475df69..000
--- a/arch/mips/kernel/i8253.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2006 IBM Corporation
- *
- * Implements device information for i8253 timer chip
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version
- * 2 as published by the Free Software Foundation
- */
-
-#include linux/platform_device.h
-
-static __init int add_pcspkr(void)
-{
-   struct platform_device *pd;
-   int ret;
-
-   pd = platform_device_alloc(pcspkr, -1);
-   if (!pd)
-   return -ENOMEM;
-
-   ret = platform_device_add(pd);
-   if (ret)
-   platform_device_put(pd);
-
-   return ret;
-}
-device_initcall(add_pcspkr);
diff --git a/arch/mips/kernel/pcspeaker.c b/arch/mips/kernel/pcspeaker.c
new file mode 100644
index 000..475df69
--- /dev/null
+++ b/arch/mips/kernel/pcspeaker.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2006 IBM Corporation
+ *
+ * 

[TIPC]: Improved support for Ethernet traffic filtering

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f3ec75f627c746cfe460482d38a33b06a84d038f
Commit: f3ec75f627c746cfe460482d38a33b06a84d038f
Parent: e06e7c615877026544ad7f8b309d1a3706410383
Author: Allan Stephens [EMAIL PROTECTED]
AuthorDate: Sun Jun 10 17:24:20 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Tue Jul 10 22:06:02 2007 -0700

[TIPC]: Improved support for Ethernet traffic filtering

This patch simplifies TIPC's Ethernet receive routine to take
advantage of information already present in each incoming sk_buff
indicating whether the packet was explicitly sent to the interface,
has been broadcast to all interfaces, or was picked up because the
interface is in promiscous mode.

This new approach also fixes the problem of TIPC accepting unwanted
traffic through UML's multicast-based Ethernet interfaces (which
deliver traffic in a promiscuous manner even if the interface is
not configured to be promiscuous).

Signed-off-by: Allan Stephens [EMAIL PROTECTED]
Signed-off-by: Jon Paul Maloy [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/tipc/eth_media.c |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 77d2d9c..711ca4b 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -1,8 +1,8 @@
 /*
  * net/tipc/eth_media.c: Ethernet bearer support for TIPC
  *
- * Copyright (c) 2001-2006, Ericsson AB
- * Copyright (c) 2005-2006, Wind River Systems
+ * Copyright (c) 2001-2007, Ericsson AB
+ * Copyright (c) 2005-2007, Wind River Systems
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -87,6 +87,9 @@ static int send_msg(struct sk_buff *buf, struct tipc_bearer 
*tb_ptr,
 /**
  * recv_msg - handle incoming TIPC message from an Ethernet interface
  *
+ * Accept only packets explicitly sent to this node, or broadcast packets;
+ * ignores packets sent using Ethernet multicast, and traffic sent to other
+ * nodes (which can happen if interface is running in promiscuous mode).
  * Routine truncates any Ethernet padding/CRC appended to the message,
  * and ensures message size matches actual length
  */
@@ -98,9 +101,7 @@ static int recv_msg(struct sk_buff *buf, struct net_device 
*dev,
u32 size;
 
if (likely(eb_ptr-bearer)) {
-  if (likely(!dev-promiscuity) ||
-  !memcmp(skb_mac_header(buf), dev-dev_addr, ETH_ALEN) ||
-  !memcmp(skb_mac_header(buf), dev-broadcast, ETH_ALEN)) {
+   if (likely(buf-pkt_type = PACKET_BROADCAST)) {
size = msg_size((struct tipc_msg *)buf-data);
skb_trim(buf, size);
if (likely(buf-len == size)) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TIPC]: Use standard socket not implemented routines

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5eee6a6dc945acc5bf4da12956b2f698bbb102b9
Commit: 5eee6a6dc945acc5bf4da12956b2f698bbb102b9
Parent: f3ec75f627c746cfe460482d38a33b06a84d038f
Author: Allan Stephens [EMAIL PROTECTED]
AuthorDate: Sun Jun 10 17:24:55 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Tue Jul 10 22:06:09 2007 -0700

[TIPC]: Use standard socket not implemented routines

This patch modifies TIPC's socket API to utilize existing
generic routines to indicate unsupported operations, rather
than adding similar TIPC-specific routines.

Signed-off-by: Allan Stephens [EMAIL PROTECTED]
Signed-off-by: Jon Paul Maloy [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/tipc/socket.c |   55 +---
 1 files changed, 14 insertions(+), 41 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 45832fb..ac7f2aa 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1,8 +1,8 @@
 /*
  * net/tipc/socket.c: TIPC socket API
  *
- * Copyright (c) 2001-2006, Ericsson AB
- * Copyright (c) 2004-2006, Wind River Systems
+ * Copyright (c) 2001-2007, Ericsson AB
+ * Copyright (c) 2004-2007, Wind River Systems
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -1600,33 +1600,6 @@ static int getsockopt(struct socket *sock,
 }
 
 /**
- * Placeholders for non-implemented functionality
- *
- * Returns error code (POSIX-compliant where defined)
- */
-
-static int ioctl(struct socket *s, u32 cmd, unsigned long arg)
-{
-   return -EINVAL;
-}
-
-static int no_mmap(struct file *file, struct socket *sock,
-  struct vm_area_struct *vma)
-{
-   return -EINVAL;
-}
-static ssize_t no_sendpage(struct socket *sock, struct page *page,
-  int offset, size_t size, int flags)
-{
-   return -EINVAL;
-}
-
-static int no_skpair(struct socket *s1, struct socket *s2)
-{
-   return -EOPNOTSUPP;
-}
-
-/**
  * Protocol switches for the various types of TIPC sockets
  */
 
@@ -1636,19 +1609,19 @@ static struct proto_ops msg_ops = {
.release= release,
.bind   = bind,
.connect= connect,
-   .socketpair = no_skpair,
+   .socketpair = sock_no_socketpair,
.accept = accept,
.getname= get_name,
.poll   = poll,
-   .ioctl  = ioctl,
+   .ioctl  = sock_no_ioctl,
.listen = listen,
.shutdown   = shutdown,
.setsockopt = setsockopt,
.getsockopt = getsockopt,
.sendmsg= send_msg,
.recvmsg= recv_msg,
-   .mmap   = no_mmap,
-   .sendpage   = no_sendpage
+.mmap  = sock_no_mmap,
+.sendpage  = sock_no_sendpage
 };
 
 static struct proto_ops packet_ops = {
@@ -1657,19 +1630,19 @@ static struct proto_ops packet_ops = {
.release= release,
.bind   = bind,
.connect= connect,
-   .socketpair = no_skpair,
+   .socketpair = sock_no_socketpair,
.accept = accept,
.getname= get_name,
.poll   = poll,
-   .ioctl  = ioctl,
+   .ioctl  = sock_no_ioctl,
.listen = listen,
.shutdown   = shutdown,
.setsockopt = setsockopt,
.getsockopt = getsockopt,
.sendmsg= send_packet,
.recvmsg= recv_msg,
-   .mmap   = no_mmap,
-   .sendpage   = no_sendpage
+.mmap  = sock_no_mmap,
+.sendpage  = sock_no_sendpage
 };
 
 static struct proto_ops stream_ops = {
@@ -1678,19 +1651,19 @@ static struct proto_ops stream_ops = {
.release= release,
.bind   = bind,
.connect= connect,
-   .socketpair = no_skpair,
+   .socketpair = sock_no_socketpair,
.accept = accept,
.getname= get_name,
.poll   = poll,
-   .ioctl  = ioctl,
+   .ioctl  = sock_no_ioctl,
.listen = listen,
.shutdown   = shutdown,
.setsockopt = setsockopt,
.getsockopt = getsockopt,
.sendmsg= send_stream,
.recvmsg= recv_stream,
-   .mmap   = no_mmap,
-   .sendpage   = no_sendpage
+.mmap  = sock_no_mmap,
+.sendpage  = sock_no_sendpage
 };
 
 static struct net_proto_family tipc_family_ops = {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Remove unused time.c for swarm

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1f2c6d6b0c553e44273aaee24820c67ebfbbfebe
Commit: 1f2c6d6b0c553e44273aaee24820c67ebfbbfebe
Parent: 28fc582cc9b7fc6ed6a9fbf9565a2b1e56eee880
Author: Yoichi Yuasa [EMAIL PROTECTED]
AuthorDate: Thu Jun 7 22:27:50 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Thu Jul 12 17:41:21 2007 +0100

[MIPS] Remove unused time.c for swarm

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/sibyte/swarm/time.c |  244 -
 1 files changed, 0 insertions(+), 244 deletions(-)

diff --git a/arch/mips/sibyte/swarm/time.c b/arch/mips/sibyte/swarm/time.c
deleted file mode 100644
index 97c73c7..000
--- a/arch/mips/sibyte/swarm/time.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright (C) 2000, 2001 Broadcom 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-/*
- * Time routines for the swarm board.  We pass all the hard stuff
- * through to the sb1250 handling code.  Only thing we really keep
- * track of here is what time of day we think it is.  And we don't
- * really even do a good job of that...
- */
-
-
-#include linux/bcd.h
-#include linux/init.h
-#include linux/time.h
-#include linux/sched.h
-#include linux/spinlock.h
-#include asm/system.h
-#include asm/addrspace.h
-#include asm/io.h
-
-#include asm/sibyte/sb1250.h
-#include asm/sibyte/sb1250_regs.h
-#include asm/sibyte/sb1250_smbus.h
-
-static unsigned long long sec_bias = 0;
-static unsigned int usec_bias = 0;
-
-/* Xicor 1241 definitions */
-
-/*
- * Register bits
- */
-
-#define X1241REG_SR_BAT0x80/* currently on battery power */
-#define X1241REG_SR_RWEL 0x04  /* r/w latch is enabled, can write RTC 
*/
-#define X1241REG_SR_WEL 0x02   /* r/w latch is unlocked, can enable 
r/w now */
-#define X1241REG_SR_RTCF 0x01  /* clock failed */
-#define X1241REG_BL_BP2 0x80   /* block protect 2 */
-#define X1241REG_BL_BP1 0x40   /* block protect 1 */
-#define X1241REG_BL_BP0 0x20   /* block protect 0 */
-#define X1241REG_BL_WD10x10
-#define X1241REG_BL_WD00x08
-#define X1241REG_HR_MIL 0x80   /* military time format */
-
-/*
- * Register numbers
- */
-
-#define X1241REG_BL0x10/* block protect bits */
-#define X1241REG_INT   0x11/*  */
-#define X1241REG_SC0x30/* Seconds */
-#define X1241REG_MN0x31/* Minutes */
-#define X1241REG_HR0x32/* Hours */
-#define X1241REG_DT0x33/* Day of month */
-#define X1241REG_MO0x34/* Month */
-#define X1241REG_YR0x35/* Year */
-#define X1241REG_DW0x36/* Day of Week */
-#define X1241REG_Y2K   0x37/* Year 2K */
-#define X1241REG_SR0x3F/* Status register */
-
-#define X1241_CCR_ADDRESS  0x6F
-
-#define SMB_CSR(reg) (IOADDR(A_SMB_REGISTER(1, reg)))
-
-static int xicor_read(uint8_t addr)
-{
-while (__raw_readq(SMB_CSR(R_SMB_STATUS))  M_SMB_BUSY)
-;
-
-   __raw_writeq((addr  8)  0x7, SMB_CSR(R_SMB_CMD));
-   __raw_writeq(addr  0xff, SMB_CSR(R_SMB_DATA));
-   __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE,
-SMB_CSR(R_SMB_START));
-
-while (__raw_readq(SMB_CSR(R_SMB_STATUS))  M_SMB_BUSY)
-;
-
-   __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE,
-SMB_CSR(R_SMB_START));
-
-while (__raw_readq(SMB_CSR(R_SMB_STATUS))  M_SMB_BUSY)
-;
-
-if (__raw_readq(SMB_CSR(R_SMB_STATUS))  M_SMB_ERROR) {
-/* Clear error bit by writing a 1 */
-__raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
-return -1;
-}
-
-   return (__raw_readq(SMB_CSR(R_SMB_DATA))  0xff);
-}
-
-static int xicor_write(uint8_t addr, int b)
-{
-while (__raw_readq(SMB_CSR(R_SMB_STATUS))  M_SMB_BUSY)
-;
-
-   __raw_writeq(addr, SMB_CSR(R_SMB_CMD));
-   __raw_writeq((addr  0xff) | ((b  0xff)  8), SMB_CSR(R_SMB_DATA));
-   __raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | 

[TIPC]: Optimize stream send routine to avoid fragmentation

2007-07-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=05646c91109bfd129361d57dc5d98464ab6f6578
Commit: 05646c91109bfd129361d57dc5d98464ab6f6578
Parent: 5eee6a6dc945acc5bf4da12956b2f698bbb102b9
Author: Allan Stephens [EMAIL PROTECTED]
AuthorDate: Sun Jun 10 17:25:24 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Tue Jul 10 22:06:12 2007 -0700

[TIPC]: Optimize stream send routine to avoid fragmentation

This patch enhances TIPC's stream socket send routine so that
it avoids transmitting data in chunks that require fragmentation
and reassembly, thereby improving performance at both the
sending and receiving ends of the connection.

The maximum packet size hint that records MTU info allows
the socket to decide how big a chunk it should send; in the
event that the hint has become stale, fragmentation may still
occur, but the data will be passed correctly and the hint will
be updated in time for the following send.  Note: The 66060 byte
pseudo-MTU used for intra-node connections requires the send
routine to perform an additional check to ensure it does not
exceed TIPCs limit of 66000 bytes of user data per chunk.

Signed-off-by: Allan Stephens [EMAIL PROTECTED]
Signed-off-by: Jon Paul Maloy [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/net/tipc/tipc_port.h |6 --
 net/tipc/link.c  |   16 
 net/tipc/port.c  |   10 +-
 net/tipc/port.h  |6 ++
 net/tipc/socket.c|   25 +
 5 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index 333bba6..cfc4ba4 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -1,8 +1,8 @@
 /*
  * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC 
ports
  * 
- * Copyright (c) 1994-2006, Ericsson AB
- * Copyright (c) 2005, Wind River Systems
+ * Copyright (c) 1994-2007, Ericsson AB
+ * Copyright (c) 2005-2007, Wind River Systems
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,6 +55,7 @@
  * @conn_unacked: number of unacknowledged messages received from peer port
  * @published: non-zero if port has one or more associated names
  * @congested: non-zero if cannot send because of link or port congestion
+ * @max_pkt: maximum packet size hint used when building messages sent by 
port
  * @ref: unique reference to port in TIPC object registry
  * @phdr: preformatted message header used when sending messages
  */
@@ -68,6 +69,7 @@ struct tipc_port {
u32 conn_unacked;
int published;
u32 congested;
+   u32 max_pkt;
u32 ref;
struct tipc_msg phdr;
 };
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 2124f32..5adfdfd 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1,8 +1,8 @@
 /*
  * net/tipc/link.c: TIPC link code
  *
- * Copyright (c) 1996-2006, Ericsson AB
- * Copyright (c) 2004-2006, Wind River Systems
+ * Copyright (c) 1996-2007, Ericsson AB
+ * Copyright (c) 2004-2007, Wind River Systems
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -1260,7 +1260,7 @@ again:
 * (Must not hold any locks while building message.)
 */
 
-   res = msg_build(hdr, msg_sect, num_sect, sender-max_pkt,
+   res = msg_build(hdr, msg_sect, num_sect, sender-publ.max_pkt,
!sender-user_port, buf);
 
read_lock_bh(tipc_net_lock);
@@ -1271,7 +1271,7 @@ again:
if (likely(l_ptr)) {
if (likely(buf)) {
res = link_send_buf_fast(l_ptr, buf,
-sender-max_pkt);
+sender-publ.max_pkt);
if (unlikely(res  0))
buf_discard(buf);
 exit:
@@ -1299,12 +1299,12 @@ exit:
 * then re-try fast path or fragment the message
 */
 
-   sender-max_pkt = link_max_pkt(l_ptr);
+   sender-publ.max_pkt = link_max_pkt(l_ptr);
tipc_node_unlock(node);
read_unlock_bh(tipc_net_lock);
 
 
-   if ((msg_hdr_sz(hdr) + res) = sender-max_pkt)
+   if ((msg_hdr_sz(hdr) + res) = sender-publ.max_pkt)
goto again;
 
return link_send_sections_long(sender, msg_sect,
@@ -1357,7 +1357,7 @@ static int link_send_sections_long(struct port *sender,
 
 again:
fragm_no = 1;
-   max_pkt = sender-max_pkt - INT_H_SIZE;
+   max_pkt = sender-publ.max_pkt - INT_H_SIZE;
   

  1   2   3   4   5   6   7   >