Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 2016 10:13:37 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Norbert Koch <nkoch@demig.de>, freebsd-hackers@FreeBSD.org
Subject:   Re: impossible to set pata dma mode?
Message-ID:  <1454001217.1275.19.camel@freebsd.org>
In-Reply-To: <56AA42CF.10408@demig.de>
References:  <56A9D502.7010809@demig.de> <1453995911.1275.14.camel@freebsd.org> <56AA42CF.10408@demig.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2016-01-28 at 17:33 +0100, Norbert Koch wrote:
> Am 28.01.2016 um 16:45 schrieb Ian Lepore:
> 
> 
> Thanks Ian, I know that I can configure this using
> boot hints.
> 
> I am having a rather special situation where I need to
> change these settings after boot. It has to do with
> pxe booting different FreeBSD versions using an
> outdated grub which only allows to directly load
> a kernel without specifying boot parameters.
> 
> Obviously I can help myself with a modified
> camcontrol. But I am still curious what the
> reason for the limitation might be.
> 
> 

I'll have to leave the cam-related questions for the cam gurus.

Do you have a custom kernel for these systems?  If so, you can
configure tunables by compiling a static environment into the kernel
using the 'env' argument described in config(5).  I recently committed
changes that fix the env directive so that it works on all
architectures now.  Still maybe not what you need, but worth
mentioning.

-- Ian

> > On Thu, 2016-01-28 at 09:44 +0100, Norbert Koch wrote:
> > > Hello.
> > > 
> > > I have to reduce dma mode from udma to wdma2
> > > for a flash device.
> > > 
> > > In the past this was easy using atacontrol
> > > but, afaiks it seems to be impossible using camcontrol.
> > > 
> > >  camcontrol negotiate ada0 -M wdma
> > > ...You can only modify user parameters
> > > 
> > >  camcontrol negotiate ada0 -NM wdma
> > > Works, but I see no way how those user
> > > parameters become active parameters as the
> > > driver only reads then in attach as far as
> > > I can see.
> > > 
> > > It seems like the ata driver's interface
> > > allows to change the current settings
> > > (XPT_SET_TRAN_SETTINGS/CTS_TYPE_CURRENT_SETTINGS)
> > > so, why is camcontrol so restrictive?
> > > 
> > > Thank you,
> > > Norbert Koch
> > I don't know about changing it on the fly with camcontrol (I've
> > never
> > done that), but you can configure it at boot time with a tunable in
> > loader.conf of the form
> > 
> >   dev.ada.0.mode="modestr"
> > 
> > Where modestr is one of these (from dev/ata/ata-all.c):
> > 
> > 	if (!strcasecmp(str, "PIO0")) return (ATA_PIO0);
> > 	if (!strcasecmp(str, "PIO1")) return (ATA_PIO1);
> > 	if (!strcasecmp(str, "PIO2")) return (ATA_PIO2);
> > 	if (!strcasecmp(str, "PIO3")) return (ATA_PIO3);
> > 	if (!strcasecmp(str, "PIO4")) return (ATA_PIO4);
> > 	if (!strcasecmp(str, "WDMA0")) return (ATA_WDMA0);
> > 	if (!strcasecmp(str, "WDMA1")) return (ATA_WDMA1);
> > 	if (!strcasecmp(str, "WDMA2")) return (ATA_WDMA2);
> > 	if (!strcasecmp(str, "UDMA0")) return (ATA_UDMA0);
> > 	if (!strcasecmp(str, "UDMA16")) return (ATA_UDMA0);
> > 	if (!strcasecmp(str, "UDMA1")) return (ATA_UDMA1);
> > 	if (!strcasecmp(str, "UDMA25")) return (ATA_UDMA1);
> > 	if (!strcasecmp(str, "UDMA2")) return (ATA_UDMA2);
> > 	if (!strcasecmp(str, "UDMA33")) return (ATA_UDMA2);
> > 	if (!strcasecmp(str, "UDMA3")) return (ATA_UDMA3);
> > 	if (!strcasecmp(str, "UDMA44")) return (ATA_UDMA3);
> > 	if (!strcasecmp(str, "UDMA4")) return (ATA_UDMA4);
> > 	if (!strcasecmp(str, "UDMA66")) return (ATA_UDMA4);
> > 	if (!strcasecmp(str, "UDMA5")) return (ATA_UDMA5);
> > 	if (!strcasecmp(str, "UDMA100")) return (ATA_UDMA5);
> > 	if (!strcasecmp(str, "UDMA6")) return (ATA_UDMA6);
> > 	if (!strcasecmp(str, "UDMA133")) return (ATA_UDMA6);
> > 
> > -- Ian
> 
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1454001217.1275.19.camel>