Re: [OpenWrt-Devel] [PATCH]support for cs5536 IDE

2009-02-09 Thread Markus Wigge
Hi,

 it is a good idea to switch to the new SATA/ATA SFF code.  CS5536 is
 included on the 2.6.28.4.  you just need to select scsi disk to be
 compiled in the kernel not as a module and switch on the menuconfig from
 /dev/hsa2 to /dev/sda2 on the CONFIG_X86_GRUB_ROOTPART

I already did so at 25C3 for my Alix board, but you also have to change
the dependancy for kmod-usb-storage which depends on kmod-scsi-core.

When you change to SATA/ATA SFF code the package kmod-scsi-core cannot
be build.

Felix is thinking about a solution to automatically remove dependencies
when the module is not compiled as module but linked to the kernel.

bye,
Markus

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH]support for cs5536 IDE

2009-02-08 Thread Alexandros C. Couloumbis
it is a good idea to switch to the new SATA/ATA SFF code.  CS5536 is
included on the 2.6.28.4.  you just need to select scsi disk to be
compiled in the kernel not as a module and switch on the menuconfig from
/dev/hsa2 to /dev/sda2 on the CONFIG_X86_GRUB_ROOTPART


--alex
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH]support for cs5536 IDE

2009-02-07 Thread Dennis Bartsch

hello list,

with recent releases alix boards won't boot from CF card anymore.

attached is a patch for special support of the cs5536 IDE controller to fix the 
broken support for alix and probably other geode LX boards with kernel 2.6.28.2 
.
it is tested to apply against 14426 and 14430.

king regards
Dennis Bartsch

_
http://redirect.gimas.net/?n=M0902xSearchVideo
Videosuche - Ganz einfach mit der Live Searchdiff -Nur unpatched/target/linux/x86/config-2.6.28 trunk/target/linux/x86/config-2.6.28
--- unpatched/target/linux/x86/config-2.6.28	2009-02-07 16:39:23.0 +0100
+++ trunk/target/linux/x86/config-2.6.28	2009-02-07 16:05:04.0 +0100
@@ -39,6 +39,7 @@
 CONFIG_BITREVERSE=y
 # CONFIG_BLK_DEV_4DRIVES is not set
 # CONFIG_BLK_DEV_ALI14XX is not set
+CONFIG_BLK_DEV_CS5536=y
 # CONFIG_BLK_DEV_DTC2278 is not set
 CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_HT6560B is not set

diff -Nur unpatched/target/linux/generic-2.6/patches-2.6.28/925-cs5536_ide_driver.patch trunk/target/linux/generic-2.6/patches-2.6.28/925-cs5536_ide_driver.patch
--- unpatched/target/linux/generic-2.6/patches-2.6.28/925-cs5536_ide_driver.patch	1970-01-01 01:00:00.0 +0100
+++ trunk/target/linux/generic-2.6/patches-2.6.28/925-cs5536_ide_driver.patch	2009-02-07 14:48:18.0 +0100
@@ -0,0 +1,347 @@
+diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
+index b1c6f68..3dad229 100644
+--- a/drivers/ide/Kconfig
 b/drivers/ide/Kconfig
+@@ -465,6 +465,16 @@ config BLK_DEV_CS5535
+ 
+ 	  It is safe to say Y to this question.
+ 
++config BLK_DEV_CS5536
++	tristate CS5536 chipset support
++	depends on X86_32
++	select BLK_DEV_IDEDMA_PCI
++	help
++	  This option enables support for the AMD CS5536
++	  companion chip used with the Geode LX processor family.
++
++	  If unsure, say N.
++
+ config BLK_DEV_HPT366
+ 	tristate HPT36X/37X chipset support
+ 	select BLK_DEV_IDEDMA_PCI
+diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile
+index c2b9c93..d0e3d7d 100644
+--- a/drivers/ide/Makefile
 b/drivers/ide/Makefile
+@@ -43,6 +43,7 @@ obj-$(CONFIG_BLK_DEV_CMD64X)		+= cmd64x.o
+ obj-$(CONFIG_BLK_DEV_CS5520)		+= cs5520.o
+ obj-$(CONFIG_BLK_DEV_CS5530)		+= cs5530.o
+ obj-$(CONFIG_BLK_DEV_CS5535)		+= cs5535.o
++obj-$(CONFIG_BLK_DEV_CS5536)		+= cs5536.o
+ obj-$(CONFIG_BLK_DEV_SC1200)		+= sc1200.o
+ obj-$(CONFIG_BLK_DEV_CY82C693)		+= cy82c693.o
+ obj-$(CONFIG_BLK_DEV_DELKIN)		+= delkin_cb.o
+diff --git a/drivers/ide/cs5536.c b/drivers/ide/cs5536.c
+new file mode 100644
+index 000..7a62db7
+--- /dev/null
 b/drivers/ide/cs5536.c
+@@ -0,0 +1,308 @@
++/*
++ * CS5536 PATA support
++ * (C) 2007 Martin K. Petersen m...@mkp.net
++ * (C) 2009 Bartlomiej Zolnierkiewicz
++ *
++ * 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.
++ *
++ * 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
++ *
++ * Documentation:
++ *	Available from AMD web site.
++ *
++ * The IDE timing registers for the CS5536 live in the Geode Machine
++ * Specific Register file and not PCI config space.  Most BIOSes
++ * virtualize the PCI registers so the chip looks like a standard IDE
++ * controller.  Unfortunately not all implementations get this right.
++ * In particular some have problems with unaligned accesses to the
++ * virtualized PCI registers.  This driver always does full dword
++ * writes to work around the issue.  Also, in case of a bad BIOS this
++ * driver can be loaded with the msr=1 parameter which forces using
++ * the Machine Specific Registers to configure the device.
++ */
++
++#include linux/kernel.h
++#include linux/module.h
++#include linux/pci.h
++#include linux/init.h
++#include linux/ide.h
++#include asm/msr.h
++
++#define DRV_NAME	cs5536
++
++enum {
++	MSR_IDE_CFG		= 0x51300010,
++	PCI_IDE_CFG		= 0x40,
++
++	CFG			= 0,
++	DTC			= 2,
++	CAST			= 3,
++	ETC			= 4,
++
++	IDE_CFG_CHANEN		= (1  1),
++	IDE_CFG_CABLE		= (1  17) | (1  16),
++
++	IDE_D0_SHIFT		= 24,
++	IDE_D1_SHIFT		= 16,
++	IDE_DRV_MASK		= 0xff,
++
++	IDE_CAST_D0_SHIFT	= 6,
++	IDE_CAST_D1_SHIFT	= 4,
++	IDE_CAST_DRV_MASK	= 0x3,
++
++	IDE_CAST_CMD_SHIFT	= 24,
++	IDE_CAST_CMD_MASK	= 0xff,
++
++	IDE_ETC_UDMA_MASK	= 0xc0,
++};
++
++static int use_msr;
++
++static int cs5536_read(struct pci_dev *pdev, int reg, u32 *val)
++{
++	if (unlikely(use_msr)) {
++		u32 dummy;
++
++		rdmsr(MSR_IDE_CFG + reg, *val, dummy);
++		return 0;
++	}
++
++	return