* NFS4 BAD_STATEID loop (kernel 3.0)
From: David Flynn @ 2011-10-24 10:40 UTC (permalink / raw)
To: linux-nfs
Dear All,
On a system running kernel 3.0, mounting a Solaris NFS4 export, we
observe a continuous 20Mbit/sec exchange between client and server that had
been occurring for 10 days.
>From /proc/mounts:
home:/home/ /home nfs4 rw,relatime,vers=4,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=172.29.190.21,minorversion=0,local_lock=none,addr=172.29.120.140 0 0
Reconciling logs, we find that around the time the exchange started,
the kernel reports a process having blocked:
[787321.680029] INFO: task bash:17799 blocked for more than 120 seconds.
[787321.680067] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[787321.680104] bash D 0000000000000002 0 17799 1 0x00000000
[787321.680131] ffff880173ad9ca8 0000000000000086 ffff88017216b008 0000000000012a40
[787321.680171] ffff880173ad9fd8 0000000000012a40 ffff880173ad8000 0000000000012a40
[787321.680211] 0000000000012a40 0000000000012a40 ffff880173ad9fd8 0000000000012a40
[787321.680251] Call Trace:
[787321.680275] [<ffffffff8110e900>] ? __lock_page+0x70/0x70
[787321.680299] [<ffffffff815fea2c>] io_schedule+0x8c/0xd0
[787321.680321] [<ffffffff8110e90e>] sleep_on_page+0xe/0x20
[787321.680344] [<ffffffff815ff2af>] __wait_on_bit+0x5f/0x90
[787321.680366] [<ffffffff8110ead3>] wait_on_page_bit+0x73/0x80
[787321.680390] [<ffffffff81085980>] ? autoremove_wake_function+0x40/0x40
[787321.680416] [<ffffffff8111aeb5>] ? pagevec_lookup_tag+0x25/0x40
[787321.680439] [<ffffffff8110ed06>] filemap_fdatawait_range+0xf6/0x1a0
[787321.680483] [<ffffffffa022e740>] ? nfs_destroy_directcache+0x20/0x20 [nfs]
[787321.680507] [<ffffffff8111a3b1>] ? do_writepages+0x21/0x40
[787321.680530] [<ffffffff8110ff8b>] ? __filemap_fdatawrite_range+0x5b/0x60
[787321.680555] [<ffffffff81110000>] filemap_write_and_wait_range+0x70/0x80
[787321.680580] [<ffffffff8119b45a>] vfs_fsync_range+0x5a/0x90
[787321.680602] [<ffffffff8119b4fc>] vfs_fsync+0x1c/0x20
[787321.680628] [<ffffffffa0222be4>] nfs_file_flush+0x54/0x80 [nfs]
[787321.680653] [<ffffffff8116d66f>] filp_close+0x3f/0x90
[787321.680675] [<ffffffff8116e097>] sys_close+0xb7/0x120
[787321.680698] [<ffffffff816090c2>] system_call_fastpath+0x16/0x1b
A network trace showed the following exchange below being continually
repeated. Unfortunately this system too has since been rebooted.
Any thoughts on the matter would be most welcome,
Kind regards,
..david
No. Time Source Destination Protocol Size Info
9880 11:40:12.833617 172.29.190.21 172.29.120.140 NFS 1122 V4 COMPOUND Call (Reply In 9881) <EMPTY> PUTFH;WRITE;GETATTR
Frame 9880: 1122 bytes on wire (8976 bits), 1122 bytes captured (8976 bits)
Arrival Time: Oct 17, 2011 11:40:12.833617000 BST
Frame Length: 1122 bytes (8976 bits)
Capture Length: 1122 bytes (8976 bits)
Ethernet II, Src: ChelsioC_06:68:f9 (00:07:43:06:68:f9), Dst: All-HSRP-routers_be (00:00:0c:07:ac:be)
Internet Protocol, Src: 172.29.190.21 (172.29.190.21), Dst: 172.29.120.140 (172.29.120.140)
Transmission Control Protocol, Src Port: 816 (816), Dst Port: nfs (2049), Seq: 5199745, Ack: 275801, Len: 1056
Remote Procedure Call, Type:Call XID:0x5daa6e93
Network File System
[Program Version: 4]
[V4 Procedure: COMPOUND (1)]
Tag: <EMPTY>
length: 0
contents: <EMPTY>
minorversion: 0
Operations (count: 3)
Opcode: PUTFH (22)
filehandle
length: 36
[hash (CRC-32): 0x6e4b15f3]
decode type as: unknown
filehandle: 7df3a75d5e1cd908000ab44c5b000000efc80200000a0300...
Opcode: WRITE (38)
stateid
seqid: 0x00000000
Data: 4e06f15b800f82e300000000
offset: 11392
stable: FILE_SYNC4 (2)
Write length: 814
Data: <DATA>
length: 814
contents: <DATA>
fill bytes: opaque data
Opcode: GETATTR (9)
GETATTR4args
attr_request
bitmap[0] = 0x00000018
[2 attributes requested]
mand_attr: FATTR4_CHANGE (3)
mand_attr: FATTR4_SIZE (4)
bitmap[1] = 0x00300000
[2 attributes requested]
recc_attr: FATTR4_TIME_METADATA (52)
recc_attr: FATTR4_TIME_MODIFY (53)
No. Time Source Destination Protocol Size Info
9881 11:40:12.833956 172.29.120.140 172.29.190.21 NFS 122 V4 COMPOUND Reply (Call In 9880) <EMPTY> PUTFH;WRITE
Frame 9881: 122 bytes on wire (976 bits), 122 bytes captured (976 bits)
Arrival Time: Oct 17, 2011 11:40:12.833956000 BST
[Time delta from previous captured frame: 0.000339000 seconds]
Frame Length: 122 bytes (976 bits)
Capture Length: 122 bytes (976 bits)
Ethernet II, Src: Cisco_1e:f7:80 (00:13:5f:1e:f7:80), Dst: ChelsioC_06:68:f9 (00:07:43:06:68:f9)
Internet Protocol, Src: 172.29.120.140 (172.29.120.140), Dst: 172.29.190.21 (172.29.190.21)
Transmission Control Protocol, Src Port: nfs (2049), Dst Port: 816 (816), Seq: 275801, Ack: 5200801, Len: 56
Remote Procedure Call, Type:Reply XID:0x5daa6e93
Network File System
[Program Version: 4]
[V4 Procedure: COMPOUND (1)]
Status: NFS4ERR_BAD_STATEID (10025)
Tag: <EMPTY>
length: 0
contents: <EMPTY>
Operations (count: 2)
Opcode: PUTFH (22)
Status: NFS4_OK (0)
Opcode: WRITE (38)
Status: NFS4ERR_BAD_STATEID (10025)
^ permalink raw reply
* Re: NFS4 client blocked (kernel 3.0.4)
From: David Flynn @ 2011-10-24 10:16 UTC (permalink / raw)
To: Trond Myklebust; +Cc: David Flynn, linux-nfs
In-Reply-To: <1319449185.2785.6.camel@lade.trondhjem.org>
* Trond Myklebust (Trond.Myklebust@netapp.com) wrote:
> > [105121.204200] INFO: task bash:4457 blocked for more than 120 seconds.
> > [105121.247424] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> Does 'echo 0 >/proc/sys/sunrpc/rpc_debug' show anything being stuck in
> the RPC layer?
Unfortunately that system had to be rebooted. If it occurs again, i
shall perform the check.
Kind regards,
..david
^ permalink raw reply
* BUG at fs/inode.c
From: Amon Ott @ 2011-10-24 10:39 UTC (permalink / raw)
To: ceph-devel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]
Hi folks,
we have hit a kernel bug with current ceph-client master (commit
a2742a09568f81315e0f30021f29f14e7cd3924b), which I assume to be a Ceph bug.
Kernel is x86-32, Ceph is running on a two node cluster over ext4. The kernel
traces are attached, the system dies shortly after these messages. The bug is
reproducable. I have not found anything useful in ceph bug tracker when
searching for "fs/inode.c".
Around fs/inode.c line 1375 mentioned in the trace is the iput() function:
void iput(struct inode *inode)
{
if (inode) {
BUG_ON(inode->i_state & I_CLEAR);
if (atomic_dec_and_lock(&inode->i_count, &inode->i_lock))
iput_final(inode);
}
}
So inode->i_state seems to be incorrect when iput() is called, maybe a double
call to iput() or a missing iget() somewhere. Is this really a Ceph bug or
have I messed up our kernel code when merging patches?
Amon Ott
--
Dr. Amon Ott
m-privacy GmbH Tel: +49 30 24342334
Am Köllnischen Park 1 Fax: +49 30 24342336
10179 Berlin http://www.m-privacy.de
Amtsgericht Charlottenburg, HRB 84946
Geschäftsführer:
Dipl.-Kfm. Holger Maczkowsky,
Roman Maczkowsky
GnuPG-Key-ID: 0x2DD3A649
[-- Attachment #2: Console.log --]
[-- Type: text/x-log, Size: 2825 bytes --]
------------[ cut here ]------------
kernel BUG at fs/inode.c:1375!
invalid opcode: 0000 [#1] PREEMPT SMP
Modules linked in: lp ceph libceph crc32c libcrc32c fuse parport_pc parport floppy evdev i2c_piix4 button 8139too 8139cp mii i2c_core
Pid: 14455, comm: find Tainted: G W 3.0.7-rsbac #1 Bochs Bochs
EIP: 0060:[<000e91bf>] EFLAGS: 00010202 CPU: 0
EIP is at iput+0x16/0x126
EAX: ea114950 EBX: ea114950 ECX: 00000282 EDX: ea1147a4
ESI: 005a1bc9 EDI: ea114950 EBP: e7bb9e34 ESP: e7bb9e28
DS: 0068 ES: 0068 FS: 00d8 GS: 0033 SS: 0068
Process find (pid: 14455, ti=ee3f6dc0 task=ee3f6b20 task.ti=ee3f6dc0)
Stack:
e7a6e200 005a1bc9 ea114950 e7bb9e40 005a1c4c e7a6e398 e7bb9e50 00196860
e7a6e200 00000000 e7bb9e6c 0058ffde ee247200 00000155 e7bb9f5c 0058ffeb
ea114950 e7bb9e84 00590005 e7bb9f34 ea114950 0058ffeb e7bb9ec4 e7bb9f34
Call Trace:
[<005a1bc9>] ? ceph_mdsc_create_request+0xf5/0xf5 [ceph]
[<005a1c4c>] ceph_mdsc_release_request+0x83/0xfb [ceph]
[<00196860>] kref_put+0x3f/0x48
[<0058ffde>] ceph_do_getattr+0xb6/0xc3 [ceph]
[<0058ffeb>] ? ceph_do_getattr+0xc3/0xc3 [ceph]
[<00590005>] ceph_getattr+0x1a/0xb6 [ceph]
[<0058ffeb>] ? ceph_do_getattr+0xc3/0xc3 [ceph]
[<000d68a2>] vfs_getattr+0x125/0x13e
[<000d6914>] vfs_fstatat+0x59/0x6c
[<000d6941>] sys_fstatat64+0x1a/0x2e
[<000081a4>] ? hw_breakpoint_exceptions_notify+0x2f/0x117
[<00003e34>] ? math_state_restore+0x2d/0x2d
[<00003e32>] ? math_state_restore+0x2b/0x2d
[<00003e3f>] ? do_device_not_available+0xb/0x15
[<004dea0a>] syscall_call+0x7/0xb
Code: 4b 3f 00 b8 e4 34 44 c2 e8 04 39 f9 ff 83 c4 10 5b 5e 5f 5d c3 55 85 c0 89 e5 57 56 53 89 c3 0f 84 11 01 00 00 f6 40 1c 40 74 04 <0f> 0b eb fe 8d 50 14 8d 40 64 e8 86 b5 0a 00 85 c0 0f 84 f4 00
EIP: [<000e91bf>] iput+0x16/0x126 SS:ESP 0068:e7bb9e28
---[ end trace fbba93cb09482261 ]---
------------[ cut here ]------------
WARNING: at fs/inode.c:334 ihold+0x27/0x29()
Hardware name: Bochs
Modules linked in: lp ceph libceph crc32c libcrc32c fuse parport_pc parport floppy evdev i2c_piix4 button 8139too 8139cp mii i2c_core
Pid: 14432, comm: genstatus Tainted: G D W 3.0.7-rsbac #1
Call Trace:
[<00061e40>] warn_slowpath_common+0x65/0x7a
[<000e85e1>] ? ihold+0x27/0x29
[<00061e64>] warn_slowpath_null+0xf/0x13
[<000e85e1>] ihold+0x27/0x29
[<0058ffb0>] ceph_do_getattr+0x88/0xc3 [ceph]
[<0058ffeb>] ? ceph_do_getattr+0xc3/0xc3 [ceph]
[<00590005>] ceph_getattr+0x1a/0xb6 [ceph]
[<0058ffeb>] ? ceph_do_getattr+0xc3/0xc3 [ceph]
[<000d68a2>] vfs_getattr+0x125/0x13e
[<000d6914>] vfs_fstatat+0x59/0x6c
[<000d69f8>] vfs_stat+0x13/0x15
[<000d6a0e>] sys_stat64+0x14/0x28
[<0006de3b>] ? set_current_blocked+0x37/0x3b
[<0006e006>] ? sigprocmask+0x7e/0x89
[<0006e134>] ? sys_rt_sigprocmask+0x123/0x138
[<004dea0a>] syscall_call+0x7/0xb
---[ end trace fbba93cb09482262 ]---
^ permalink raw reply
* Re: [PATCH] x86/hpet: fix cpumask allocation after 23990:1c8789852eaf
From: Christoph Egger @ 2011-10-24 10:39 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel@lists.xensource.com
In-Reply-To: <4EA19733020000780005CC83@nat28.tlf.novell.com>
On 10/21/11 16:00, Jan Beulich wrote:
> hpet_fsb_cap_lookup(), if it doesn't find any FSB capable timer, leaves
> hpet_events allocated, while hpet_events->cpumask may not have been, As
> we're pretty generous with these one-time allocations already (in that
> hpet_events doesn't get freed when no usable counters were found, even
> if in that case only the first array entry [or none at all] may get
> used), simply make the cpumask allocation in the legacy case
> independent of whether hpet_events was NULL before.
>
> Signed-off-by: Jan Beulich<jbeulich@suse.com>
Tested-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
>
> --- a/xen/arch/x86/hpet.c
> +++ b/xen/arch/x86/hpet.c
> @@ -512,15 +512,8 @@ void __init hpet_broadcast_init(void)
> return;
>
> if ( !hpet_events )
> - {
> hpet_events = xzalloc(struct hpet_event_channel);
> - if ( hpet_events&& !zalloc_cpumask_var(&hpet_events->cpumask) )
> - {
> - xfree(hpet_events);
> - hpet_events = NULL;
> - }
> - }
> - if ( !hpet_events )
> + if ( !hpet_events || !zalloc_cpumask_var(&hpet_events->cpumask) )
> return;
> hpet_events->irq = -1;
>
>
>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
^ permalink raw reply
* Re: [Qemu-devel] qemu-kvm guest which won't 'cont' (emulation failure?)
From: Kevin Wolf @ 2011-10-24 10:42 UTC (permalink / raw)
To: Chris Webb; +Cc: qemu-devel, kvm
In-Reply-To: <20111024100037.GS9917@arachsys.com>
Am 24.10.2011 12:00, schrieb Chris Webb:
> I have a qemu-kvm guest (apparently a Ubuntu 11.04 x86-64 install) which has
> stopped and refuses to continue:
>
> (qemu) info status
> VM status: paused
> (qemu) cont
> (qemu) info status
> VM status: paused
>
> The host is running linux 2.6.39.2 with qemu-kvm 0.14.1 on 24-core Opteron
> 6176 box, and has nine other 2GB production guests on it running absolutely
> fine.
>
> It's been a while since I've seen one of these. When I last saw a cluster of
> them, they were emulation failures (big real mode instructions, maybe?). I
> also remember a message about abnormal exit in the dmesg previously, but I
> don't have that here. This time, there is no host kernel output at all, just
> the paused guest.
>
> I have qemu monitor access and can even strace the relevant qemu process if
> necessary: is it possible to use this to diagnose what's caused this guest
> to stop, e.g. the unsupported instruction if it's an emulation failure?
Another common cause for stopped VMs are I/O errors, for example writes
to a sparse image when the disk is full.
Kevin
^ permalink raw reply
* How to avoid volatiles
From: Srivatsa Bhat @ 2011-10-24 10:39 UTC (permalink / raw)
To: kernelnewbies
In-Reply-To: <CA+V-a8uur0uv50+LVLBtcsYr0Yk7UPhNenFSa7aCq0ri5REU7w@mail.gmail.com>
On Fri, Oct 14, 2011 at 2:51 PM, Prabhakar Lad
<prabhakar.csengg@gmail.com>wrote:
> Hi everyone,
>
> I had question in want eradicate volatile from here: for example:
>
>
> #define 0x01c40800
>
>
> if ((volatile void *)pllbase == (volatile void
> *)DAVINCI_PLL_CNTRL0_BASE) /**HERE**/
> return 8;
> else
> return pll_div(pllbase, PLLC_PREDIV);
>
>
>
Hi,
Take a look at this:
http://www.netrino.com/Embedded-Systems/How-To/C-Volatile-Keyword
Regards,
Srivatsa S. Bhat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111024/c5368a7a/attachment.html
^ permalink raw reply
* Re: [Xenomai-help] installing xenomai on pandaboard
From: Gilles Chanteperdrix @ 2011-10-24 10:37 UTC (permalink / raw)
To: Robert; +Cc: xenomai
In-Reply-To: <9a6b34f.290ebc9d.4ea53837.4438c@domain.hid>
On 10/24/2011 12:04 PM, Robert wrote:
>
>
>
> Dnia 24 października 2011 11:47 Gilles Chanteperdrix <gilles.chanteperdrix@domain.hid> napisał(a):
>
>> On 10/24/2011 11:16 AM, Robert wrote:
>>>
>>>
>>> Dnia 24 października 2011 10:33 Gilles Chanteperdrix <gilles.chanteperdrix@domain.hid> napisał(a):
>>>
>>>> On 10/24/2011 09:53 AM, Robert wrote:
>>>>>
>>>>>
>>>>>
>>>>> Dnia 20 września 2011 20:13 Gilles Chanteperdrix <gilles.chanteperdrix@domain.hid> napisał(a):
>>>>>
>>>>>> On 09/20/2011 07:26 PM, Robert wrote:
>>>>>>> Can someone help me installing xenomai on panda?
>>>>>>>
>>>>>>> What should I do, to install xenomai on ubuntu host?
>>>>>>> Download kernel from kernel.org and patch it with xenomai and adeos-patch, or download kernel from git repository, or download ubuntu image-omap4 via apt-get source?
>>>>>>>
>>>>>>> The last one would download 2.6.38 kernel, but there is no adeos patch for this version yet.
>>>>>>> It is also possible to download 2.6.37-9, but the same problem.
>>>>>>
>>>>>> The upcoming xenomai 2.6.0 supports panda. It should be released real
>>>>>> soon now, in the mean-time, you can try xenomai 2.6.0-rc3.
>>>>>>
>>>>>>
>>>>>
>>>>> Hi again,
>>>>> I have downloaded xenomai 2.6.0-rc5, and kernel 2.6.38.8 from kernel.org to ubuntu 11.04 on pandaboard.
>>>>> Patched it with adeos included in xeno package.
>>>>>
>>>>> Compiled the kernel, modules and copied uImage to boot partition.
>>>>> After reboot i got the following dmesg | grep -i xeno:
>>>>> user@domain.hid$ dmesg | grep -i xeno
>>>>> [ 1.195556] I-pipe: Domain Xenomai registered.
>>>>> [ 1.195587] Xenomai: hal/arm started.
>>>>> [ 1.195861] Xenomai: scheduling class idle registered.
>>>>> [ 1.195861] Xenomai: scheduling class rt registered.
>>>>> [ 1.199798] Xenomai: real-time nucleus v2.6.0-rc5 (head) loaded.
>>>>> [ 1.199798] Xenomai: debug mode enabled.
>>>>> [ 1.590240] Xenomai: native skin init failed, code -19.
>>>>> [ 1.590270] Xenomai: starting POSIX services.
>>>>> [ 1.980804] Xenomai: POSIX skin init failed, code -19.
>>>>> [ 2.371429] Xenomai: RTDM skin init failed, code -19.
>>>>>
>>>>> user@domain.hid$ modprobe -l | grep -i xeno
>>>>> user@domain.hid$ modprobe xeno_native
>>>>> user@domain.hid$ modprobe -l | grep -i xeno
>>>>>
>>>>> user@domain.hid$ sudo ./xeno-test
>>>>> /usr/xenomai/bin/xeno-test-run-wrapper: 19: source: not found
>>>>> ./xeno-test failed: dead child 1238 not found!
>>>>
>>>> That is surprising, what shell do you use? Have you copied all files
>>>> installed by xenomai on the board root filesystem?
>>>
>>> I'm using bash.
>>> What do you mean, by all files? I just ran make and make install.
>>
>> I take it you are not cross-compiling then? Anyway, to understand the
>> bug in xeno-test, you should try adding "set -x" in
>> xeno-test-run-wrapper, on the second line.
>
> + script=./xeno-test
> + shift
> + source ./xeno-test
> /usr/xenomai/bin/xeno-test-run-wrapper: 1: source: not found
> ./xeno-test failed: dead child 10486 not found!
Ok. Try calling /usr/xenomai/bin/xeno-test instead of cding to the
directory and runing ./xeno-test.
>>>>> user@domain.hid$ ./cond-torture-native
>>>>> Xenomai: incompatible feature set
>>>>> (userland requires "kuser_tsc fastsynch nosmp", kernel provides "sa1100 v6 eabi
>>>>> kuser_tsc fastsynch smp", missing="nosmp").
>>>>>
>>>>> Should I disable smp in kernel config?
>>>>
>>>> That, or more likely enable smp in user-space configuration.
>>>>
>>> Now I try to compile without smp.
>>
>> I would recommend not to do that. SMP is better tested than !SMP. And
>> anyway, it is a bit stupid to only use one core on the dual-core OMAP4.
>>
>>
>
> I thought it may cause a problems. So, what to do now?
> config file looks good?
I have not received the config file.
--
Gilles.
^ permalink raw reply
* Re: [PATCH V2 2/4] MIPS: Add board support for Loongson1B
From: Kelvin Cheung @ 2011-10-24 10:36 UTC (permalink / raw)
To: Giuseppe CAVALLARO
Cc: Wu Zhangjin, linux-mips, linux-kernel, ralf, r0bertz, netdev
In-Reply-To: <4EA5117C.3000402@st.com>
Hi Giuseppe,
2011/10/24, Giuseppe CAVALLARO <peppe.cavallaro@st.com>:
> On 10/21/2011 7:33 PM, Wu Zhangjin wrote:
>> On Fri, Oct 21, 2011 at 6:28 PM, <keguang.zhang@gmail.com> wrote:
>>> From: Kelvin Cheung <keguang.zhang@gmail.com>
>>>
>>> This patch adds basic platform support for Loongson1B
>>> including serial port, ethernet, and interrupt handler.
>>>
>>> Loongson1B UART is compatible with NS16550A.
>>> Loongson1B GMAC is built around Synopsys IP Core.
>>>
>>
>> Perhaps you'd better split out the GMAC support to its own patch and
>> send it to the net/ maintainer and the authors of the original files.
>
> Also suggest you to provide the stmmac patches for net-next.
> The stmmac driver has been recently updated and I've also several
> patches to commit (for example for PCI etc) on it.
>
> I'm happy that the support for big endianess arrived.
> I supported a guy some time ago but he didn't provided me the patches
> tested on his side :-(. So welcome yours and many thanks Kelvin!
>
> Please send the stmmac patches and add me on CC. I'm happy to help you
> on reviewing them.
Thanks for your review.
>>> diff --git a/drivers/net/stmmac/descs.h b/drivers/net/stmmac/descs.h
>>> index 63a03e2..4db27d0 100644
>>> --- a/drivers/net/stmmac/descs.h
>>> +++ b/drivers/net/stmmac/descs.h
>>> @@ -53,6 +53,38 @@ struct dma_desc {
>>> u32 reserved3:5;
>>> u32 disable_ic:1;
>>> } rx;
>>> +#ifdef CONFIG_MACH_LOONGSON1
>>> + struct {
>>> + /* RDES0 */
>>> + u32 payload_csum_error:1;
>>> + u32 crc_error:1;
>>> + u32 dribbling:1;
>>> + u32 error_gmii:1;
>>> + u32 receive_watchdog:1;
>>> + u32 frame_type:1;
>>> + u32 late_collision:1;
>>> + u32 ipc_csum_error:1;
>>> + u32 last_descriptor:1;
>>> + u32 first_descriptor:1;
>>> + u32 vlan_tag:1;
>>> + u32 overflow_error:1;
>>> + u32 length_error:1;
>>> + u32 sa_filter_fail:1;
>>> + u32 descriptor_error:1;
>>> + u32 error_summary:1;
>>> + u32 frame_length:14;
>>> + u32 da_filter_fail:1;
>>> + u32 own:1;
>>> + /* RDES1 */
>>> + u32 buffer1_size:11;
>>> + u32 buffer2_size:11;
>>> + u32 reserved1:2;
>>> + u32 second_address_chained:1;
>>> + u32 end_ring:1;
>>> + u32 reserved2:5;
>>> + u32 disable_ic:1;
>>> + } erx; /* -- enhanced -- */
>>> +#else
>>> struct {
>>> /* RDES0 */
>>> u32 payload_csum_error:1;
>>> @@ -83,6 +115,7 @@ struct dma_desc {
>>> u32 reserved2:2;
>>> u32 disable_ic:1;
>>> } erx; /* -- enhanced -- */
>>> +#endif
>>>
>>> /* Transmit descriptor */
>>> struct {
>>> @@ -113,6 +146,40 @@ struct dma_desc {
>>> u32 last_segment:1;
>>> u32 interrupt:1;
>>> } tx;
>>> +#ifdef CONFIG_MACH_LOONGSON1
>>> + struct {
>>> + /* TDES0 */
>>> + u32 deferred:1;
>>> + u32 underflow_error:1;
>>> + u32 excessive_deferral:1;
>>> + u32 collision_count:4;
>>> + u32 vlan_frame:1;
>>> + u32 excessive_collisions:1;
>>> + u32 late_collision:1;
>>> + u32 no_carrier:1;
>>> + u32 loss_carrier:1;
>>> + u32 payload_error:1;
>>> + u32 frame_flushed:1;
>>> + u32 jabber_timeout:1;
>>> + u32 error_summary:1;
>>> + u32 ip_header_error:1;
>>> + u32 time_stamp_status:1;
>>> + u32 reserved1:13;
>>> + u32 own:1;
>>> + /* TDES1 */
>>> + u32 buffer1_size:11;
>>> + u32 buffer2_size:11;
>>> + u32 time_stamp_enable:1;
>>> + u32 disable_padding:1;
>>> + u32 second_address_chained:1;
>>> + u32 end_ring:1;
>>> + u32 crc_disable:1;
>>> + u32 checksum_insertion:2;
>>> + u32 first_segment:1;
>>> + u32 last_segment:1;
>>> + u32 interrupt:1;
>>> + } etx; /* -- enhanced -- */
>>> +#else
>>> struct {
>>> /* TDES0 */
>>> u32 deferred:1;
>>> @@ -148,6 +215,7 @@ struct dma_desc {
>>> u32 buffer2_size:13;
>>> u32 reserved4:3;
>>> } etx; /* -- enhanced -- */
>>> +#endif
>>> } des01;
>>> unsigned int des2;
>>> unsigned int des3;
>>
>>
>> If the difference is very much, perhaps a new dma_desc struct can be
>> defined instead.
>>
>
> Concerning the descriptors, we could have two different files:
>
> descs_le.h
> descs_be.h
>
> and select their inclusion inside the common.h.
>
> Please use instead of the macro CONFIG_MACH_LOONGSON1 another one more
> generic e.g. CONFIG_STMMAC_BE (and add it in the driver's Kconfig).
>
> On your platform you will have to enable it by default.
> Or it could be the default on MIPS: LE will be on ARM and SuperH.
Loongson1B(MIPS32 R2 compatible) is little endian.
And as you can see, the bitfield of RX/TX descriptor is different from
the enhanced descriptor.
>>> diff --git a/drivers/net/stmmac/enh_desc.c
>>> b/drivers/net/stmmac/enh_desc.c
>>> index e5dfb6a..3b5e4f1 100644
>>> --- a/drivers/net/stmmac/enh_desc.c
>>> +++ b/drivers/net/stmmac/enh_desc.c
>>> @@ -108,6 +108,7 @@ static int enh_desc_get_tx_len(struct dma_desc *p)
>>> static int enh_desc_coe_rdes0(int ipc_err, int type, int payload_err)
>>> {
>>> int ret = good_frame;
>>> +#ifndef CONFIG_MACH_LOONGSON1
>>> u32 status = (type << 2 | ipc_err << 1 | payload_err) & 0x7;
>>>
>>> /* bits 5 7 0 | Frame status
>>> @@ -145,6 +146,7 @@ static int enh_desc_coe_rdes0(int ipc_err, int type,
>>> int payload_err)
>>> CHIP_DBG(KERN_ERR "RX Des0 status: No IPv4, IPv6
>>> frame.\n");
>>> ret = discard_frame;
>>> }
>>> +#endif
>>> return ret;
>>> }
>
>>>
>>> @@ -232,9 +234,17 @@ static void enh_desc_init_rx_desc(struct dma_desc
>>> *p, unsigned int ring_size,
>>> int i;
>>> for (i = 0; i < ring_size; i++) {
>>> p->des01.erx.own = 1;
>>> +#ifdef CONFIG_MACH_LOONGSON1
>>> + p->des01.erx.buffer1_size = BUF_SIZE_2KiB - 1;
>>> +#else
>>> p->des01.erx.buffer1_size = BUF_SIZE_8KiB - 1;
>>> +#endif
>>> /* To support jumbo frames */
>>> +#ifdef CONFIG_MACH_LOONGSON1
>>> + p->des01.erx.buffer2_size = BUF_SIZE_2KiB - 1;
>>> +#else
>>> p->des01.erx.buffer2_size = BUF_SIZE_8KiB - 1;
>>> +#endif
>>> if (i == ring_size - 1)
>>> p->des01.erx.end_ring = 1;
>>> if (disable_rx_ic)
>>> @@ -292,9 +302,15 @@ static void enh_desc_prepare_tx_desc(struct dma_desc
>>> *p, int is_fs, int len,
>>> int csum_flag)
>>> {
>>> p->des01.etx.first_segment = is_fs;
>>> +#ifdef CONFIG_MACH_LOONGSON1
>>> + if (unlikely(len > BUF_SIZE_2KiB)) {
>>> + p->des01.etx.buffer1_size = BUF_SIZE_2KiB - 1;
>>> + p->des01.etx.buffer2_size = len - BUF_SIZE_2KiB + 1;
>>> +#else
>>> if (unlikely(len > BUF_SIZE_4KiB)) {
>>> p->des01.etx.buffer1_size = BUF_SIZE_4KiB;
>>> p->des01.etx.buffer2_size = len - BUF_SIZE_4KiB;
>>> +#endif
>>> } else {
>>> p->des01.etx.buffer1_size = len;
>>> }
>
> No. I do not want to see all these ifdef inside the code.
> I had to rework some driver's part just last week to avoid this kind of
> code. I suggest you to re-base the work against the net-next kernel and
> look at how the ring/chained modes have been managed.
>
> I added a new file called descs_com.h that you can re-use adding small
> inline functions where define the changes for be mode.
According to datasheet of Loongson 1B, the buffer size in RX/TX
descriptor is only 2KB.
So the Loongson1B's GMAC could not handle jumbo frames.
And the second buffer is useless in this case.
Am I right?
Is there a better way than ifdef CONFIG_MACH_LOONGSON1 to avoid duplicate code?
>> Is it possible to add two new macros RX_BUF_SIZE and TX_BUF_SIZE to .h
>> instead? which may reduce code duplication.
>
> This code exists because we have to properly handle the jumbo frames.
>
> Note that this code has been reworked to use the ring/chained modes.
> Take a look at descs_com.h.
>
> I expect to see the driver on your platform that uses jumbo and
> chained/ring modes.
>
> Best Regards
> Giuseppe
>
>>
>> Regards,
>> Wu Zhangjin
>>
>>> --
>>> 1.7.1
>>>
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
>
--
Best Regards!
Kelvin
^ permalink raw reply
* Re: [PATCH 0/3] ARM 4Kstacks: introduction
From: Ming Lei @ 2011-10-24 10:36 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Arnd Bergmann, linux-arm-kernel, Tim Bird, Joe Perches,
linux kernel, Andi Kleen, Thomas Gleixner
In-Reply-To: <20111022133648.GA21374@n2100.arm.linux.org.uk>
Hi,
On Sat, Oct 22, 2011 at 9:36 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Sat, Oct 22, 2011 at 04:50:15PM +0800, Ming Lei wrote:
>> On Wed, Oct 19, 2011 at 6:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Tuesday 18 October 2011 17:26:44 Tim Bird wrote:
>> >> Even inside Sony, usage of 4K stacks is limited
>> >> to some very special cases, where memory is exceedingly
>> >> tight (we have one system with 4M of RAM). And we
>> >> don't mind lopping off features or coding around
>> >> problem areas to support our special case.
>> >
>> > I would imagine that in those cases, you can gain more by reducing the
>> > number of threads in the system. What is the highest number of
>> > concurrent threads that you expect in a limited use case with no
>> > networking or block devices?
>>
>> If system run for some time, sometimes it may be difficult for
>> memory allocator to allocate 2 continuous page frames even there are
>> many spare page frames in system because of
>> fragment issue, so the patch does make sense.
>
> If memory fragmentation is an issue for this, it probably means that we
> need to switch to a software page size of 8K (or maybe 16K) rather than
> stick with the hardware 4K size. That would be a much more reliable
> solution, especially as the L1 page table is 16K (if you're suffering
> from memory fragmentation, the first thing which'd get you is the L1
> page table allocation, not the kernel stack allocation.)
If large page size is taken, memory utilization will be decreased a lot, so
may cause some low memory system not workable at all.
>> Anyway, it provides one option for user to apply 4k stack to avoid
>> such kind of process creation failure.
>
> I refer you to the comments made by people who've tried running with 4K
> stacks on x86, and their _vast_ experience of doing this. If they say
> that it causes stack overflows, then it's a problem.
Stack overflow depends on code running path. For some low memory
and simple application, the code path is not deep as x86, so providing
a option of enabling 4K stack still makes sense for this kind of case or
application.
thanks,
--
Ming Lei
^ permalink raw reply
* [PATCH 0/3] ARM 4Kstacks: introduction
From: Ming Lei @ 2011-10-24 10:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20111022133648.GA21374@n2100.arm.linux.org.uk>
Hi,
On Sat, Oct 22, 2011 at 9:36 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Sat, Oct 22, 2011 at 04:50:15PM +0800, Ming Lei wrote:
>> On Wed, Oct 19, 2011 at 6:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Tuesday 18 October 2011 17:26:44 Tim Bird wrote:
>> >> Even inside Sony, usage of 4K stacks is limited
>> >> to some very special cases, where memory is exceedingly
>> >> tight (we have one system with 4M of RAM). ?And we
>> >> don't mind lopping off features or coding around
>> >> problem areas to support our special case.
>> >
>> > I would imagine that in those cases, you can gain more by reducing the
>> > number of threads in the system. What is the highest number of
>> > concurrent threads that you expect in a limited use case with no
>> > networking or block devices?
>>
>> If system run for some time, sometimes it may be difficult for
>> memory allocator to allocate 2 continuous page frames even ?there are
>> many spare page frames in system because of
>> fragment issue, so the patch does make sense.
>
> If memory fragmentation is an issue for this, it probably means that we
> need to switch to a software page size of 8K (or maybe 16K) rather than
> stick with the hardware 4K size. ?That would be a much more reliable
> solution, especially as the L1 page table is 16K (if you're suffering
> from memory fragmentation, the first thing which'd get you is the L1
> page table allocation, not the kernel stack allocation.)
If large page size is taken, memory utilization will be decreased a lot, so
may cause some low memory system not workable at all.
>> Anyway, it provides one option for user to apply 4k stack to avoid
>> such kind of process creation failure.
>
> I refer you to the comments made by people who've tried running with 4K
> stacks on x86, and their _vast_ experience of doing this. ?If they say
> that it causes stack overflows, then it's a problem.
Stack overflow depends on code running path. For some low memory
and simple application, the code path is not deep as x86, so providing
a option of enabling 4K stack still makes sense for this kind of case or
application.
thanks,
--
Ming Lei
^ permalink raw reply
* ***Xmas On-line Promo***
From: Benz Xmas Alart @ 2011-10-24 10:32 UTC (permalink / raw)
Your Email-id was Awarded £950.000.00 In Benz Xmas On-line Promo, For Claims Send Details
Name:
Tel:
Sex:
Country:
Contact Email: Benz-claim.board@hotmail.co.uk
^ permalink raw reply
* Re: omap3isp: BT.656 support
From: Boris Todorov @ 2011-10-24 10:33 UTC (permalink / raw)
To: Gary Thomas; +Cc: Stefan Herbrechtsmeier, linux-media
In-Reply-To: <4EA53416.9080501@mlbassoc.com>
On Mon, Oct 24, 2011 at 12:47 PM, Gary Thomas <gary@mlbassoc.com> wrote:
> On 2011-10-23 13:15, Boris Todorov wrote:
>>
>> On Thu, Oct 20, 2011 at 5:36 PM, Stefan Herbrechtsmeier
>> <sherbrec@cit-ec.uni-bielefeld.de> wrote:
>>>
>>> Am 20.10.2011 14:14, schrieb Boris Todorov:
>>>>
>>>> On Thu, Oct 20, 2011 at 12:03 PM, Stefan Herbrechtsmeier
>>>> <sherbrec@cit-ec.uni-bielefeld.de> wrote:
>>>>>
>>>>> Am 20.10.2011 08:56, schrieb Boris Todorov:
>>>>>>
>>>>>> On Wed, Oct 19, 2011 at 7:26 PM, Stefan Herbrechtsmeier
>>>>>> <sherbrec@cit-ec.uni-bielefeld.de> wrote:
>>>>>>>
>>>>>>> Am 18.10.2011 15:33, schrieb Boris Todorov:
>>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> I'm trying to run OMAP + TVP5151 in BT656 mode.
>>>>>>>>
>>>>>>>> I'm using omap3isp-omap3isp-yuv
>>>>>>>> (git.linuxtv.org/pinchartl/media.git).
>>>>>>>> Plus the following patches:
>>>>>>>>
>>>>>>>> TVP5151:
>>>>>>>>
>>>>>>>> https://github.com/ebutera/meta-igep/tree/testing-v2/recipes-kernel/linux/linux-3.0+3.1rc/tvp5150
>>>>>>>>
>>>>>>>> The latest RFC patches for BT656 support:
>>>>>>>>
>>>>>>>> Enrico Butera (2):
>>>>>>>> omap3isp: ispvideo: export isp_video_mbus_to_pix
>>>>>>>> omap3isp: ispccdc: configure CCDC registers and add BT656 support
>>>>>>>>
>>>>>>>> Javier Martinez Canillas (1):
>>>>>>>> omap3isp: ccdc: Add interlaced field mode to platform data
>>>>>>>>
>>>>>>>>
>>>>>>>> I'm able to configure with media-ctl:
>>>>>>>>
>>>>>>>> media-ctl -v -r -l '"tvp5150 3-005c":0->"OMAP3 ISP CCDC":0[1],
>>>>>>>> "OMAP3
>>>>>>>> ISP CCDC":1->"OMAP3 ISP CCDC output":0[1]'
>>>>>>>> media-ctl -v --set-format '"tvp5150 3-005c":0 [UYVY2X8 720x525]'
>>>>>>>> media-ctl -v --set-format '"OMAP3 ISP CCDC":0 [UYVY2X8 720x525]'
>>>>>>>> media-ctl -v --set-format '"OMAP3 ISP CCDC":1 [UYVY2X8 720x525]'
>>>>>>>>
>>>>>>>> But
>>>>>>>> ./yavta -f UYVY -s 720x525 -n 4 --capture=4 -F /dev/video4
>>>>>>>>
>>>>>>>> sleeps after
>>>>>>>> ...
>>>>>>>> Buffer 1 mapped at address 0x4021d000.
>>>>>>>> length: 756000 offset: 1515520
>>>>>>>> Buffer 2 mapped at address 0x402d6000.
>>>>>>>> length: 756000 offset: 2273280
>>>>>>>> Buffer 3 mapped at address 0x4038f000.
>>>>>>>>
>>>>>>>> Anyone with the same issue??? This happens with every other v4l test
>>>>>>>> app I used.
>>>>>>>
>>>>>>> I had the same issue.
>>>>>>>
>>>>>>> Make sure that you disable the xclk when you remove your sensor
>>>>>>> driver.
>>>>>>>
>>>>>>> isp->platform_cb.set_xclk(isp, 0, ISP_XCLK_A)
>>>>>>
>>>>>> How exactly did you solved your problem? I don't see how XCLK in
>>>>>> _remove will help. Pls explain.
>>>>>
>>>>> Sorry, I mean deactive / power off your sensor.
>>>>>>
>>>>>> Btw I'm feeding TVP with external clock (not from xtal pins) -
>>>>>> omap.cam_xclk -> tvp.clk_in
>>>>>
>>>>> I mean the cam_xclk.
>>>>>>
>>>>>> And I'm using kind of hack to get it:
>>>>>> isp_probe()
>>>>>> + isp_set_xclk(isp, 27000000, 1);
>>>>>
>>>>> This is your problem.
>>>>>
>>>>> You should control the clock via board / platform callback from your
>>>>> driver.
>>>>> Example:
>>>>> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg56627.html
>>>>>
>>>>> It is important that you set the clock to zero when your driver is not
>>>>> in use.
>>>>>
>>>>> The problem is connected to the use count of the ISP and some
>>>>> initialisation which only happen when the counter change between zero
>>>>> and one.
>>>>>
>>>> tvp_probe() needs clock for i2c detected/config. tvp5150_s_power call
>>>> happens when video starts streaming and if tvp is not configured ->
>>>> kernel panic.
>>>
>>> I use an other sensor and driver and this config the sensor during start
>>> stream.
>>>>
>>>> And what about the case when TVP is used with OSC on XTAL pins and
>>>> CLK_IN is not used at all?
>>>
>>> Then your system will work, as you never call isp_set_xclk.
>>>
>>> The problem is not the clock, but how the isp driver works.
>>> It expects, that the sensor driver disable the cam_xclk, if the sensor
>>> is not used.
>>>>
>>>> Maybe I don't fully understand what is happening...
>>>> or isp_set_xclk() use is messing up with ISP
>>>
>>> On my system I have the same issues as you if I don't set the cam_xclk
>>> to zero
>>> during stop streaming.
>>>
>>> I haven't investigate in the real cause for the issue. I only released,
>>> that this
>>> issue stick together with an always enabled cam_xclk.
>>>
>>> Regards,
>>> Stefan
>>
>> Thanks Stefan. Now I have IRQs and I'm able to get some image from TVP.
>
> How did you end up fixing this? I ask only to enlighten the list, not to
> embarrass
> you, as others and I have had no troubles making this go from the start.
I just followed Stefan's example - added .s_power callback to control xclk.
^ permalink raw reply
* Re: [PATCH V2] i2c-designware: Change readl to readw and writel to writew
From: Baruch Siach @ 2011-10-24 10:33 UTC (permalink / raw)
To: Rajeev Kumar
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, shiraz.hashim-qxv4g6HH51o,
viresh.kumar-qxv4g6HH51o, bhupesh.sharma-qxv4g6HH51o,
pratyush.anand-qxv4g6HH51o, vipin.kumar-qxv4g6HH51o,
deepak.sikri-qxv4g6HH51o, amit.virdi-qxv4g6HH51o,
vipulkumar.samar-qxv4g6HH51o, armando.visconti-qxv4g6HH51o
In-Reply-To: <1319450282-914-1-git-send-email-rajeev-dlh.kumar-qxv4g6HH51o@public.gmane.org>
Hi Rajeev,
On Mon, Oct 24, 2011 at 03:28:02PM +0530, Rajeev Kumar wrote:
> Since I2C designware registers are 16 bit wide and so we should use
> readw/writew.
>
> Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar-qxv4g6HH51o@public.gmane.org>
> ---
> drivers/i2c/busses/i2c-designware.c | 104 +++++++++++++++++-----------------
> 1 files changed, 52 insertions(+), 52 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware.c b/drivers/i2c/busses/i2c-designware.c
> index 6eaa681..5149a10 100644
> --- a/drivers/i2c/busses/i2c-designware.c
> +++ b/drivers/i2c/busses/i2c-designware.c
> @@ -216,11 +216,11 @@ struct dw_i2c_dev {
> u32 abort_source;
> int irq;
> struct i2c_adapter adapter;
> - unsigned int tx_fifo_depth;
> - unsigned int rx_fifo_depth;
> + u16 tx_fifo_depth;
> + u16 rx_fifo_depth;
> };
This looks wrong. The {tx,rx}_fifo_depth fields do not represent bit fields,
but numbers. So unsigned int should be better here.
baruch
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply
* [U-Boot] [PATCH V3] Ethernut 5 board support
From: Tim Schendekehl @ 2011-10-24 10:33 UTC (permalink / raw)
To: u-boot
Add support for the Ethernut 5 open hardware design, based
on Atmel's AT91SAM9XE512 SoC.
V3
- Fix issues with latest git.
Signed-off-by: Tim Schendekehl <tim.schendekehl@egnite.de>
---
MAINTAINERS | 4 +
board/egnite/ethernut5/Makefile | 54 +++++
board/egnite/ethernut5/ethernut5.c | 281 ++++++++++++++++++++++++
board/egnite/ethernut5/ethernut5_pwrman.c | 338 +++++++++++++++++++++++++++++
board/egnite/ethernut5/ethernut5_pwrman.h | 68 ++++++
boards.cfg | 1 +
include/configs/ethernut5.h | 290 +++++++++++++++++++++++++
7 files changed, 1036 insertions(+), 0 deletions(-)
create mode 100644 board/egnite/ethernut5/Makefile
create mode 100644 board/egnite/ethernut5/ethernut5.c
create mode 100644 board/egnite/ethernut5/ethernut5_pwrman.c
create mode 100644 board/egnite/ethernut5/ethernut5_pwrman.h
create mode 100644 include/configs/ethernut5.h
diff --git a/MAINTAINERS b/MAINTAINERS
index bb95e6d..a4695a1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -142,6 +142,10 @@ Phil Edworthy <phil.edworthy@renesas.com>
rsk7264 SH7264
+egnite GmbH <info@egnite.de>
+
+ ethernut5 ARM926EJS (AT91SAM9XE SoC)
+
Dirk Eibach <eibach@gdsys.de>
devconcenter PPC460EX
diff --git a/board/egnite/ethernut5/Makefile b/board/egnite/ethernut5/Makefile
new file mode 100644
index 0000000..d8e485f
--- /dev/null
+++ b/board/egnite/ethernut5/Makefile
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2010
+# egnite GmbH
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(BOARD).o
+
+COBJS-y += $(BOARD).o
+COBJS-y += $(BOARD)_pwrman.o
+
+SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS-y))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
+ $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+ rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+ rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/egnite/ethernut5/ethernut5.c b/board/egnite/ethernut5/ethernut5.c
new file mode 100644
index 0000000..50c4cb3
--- /dev/null
+++ b/board/egnite/ethernut5/ethernut5.c
@@ -0,0 +1,281 @@
+/*
+ * (C) Copyright 2011
+ * egnite GmbH <info@egnite.de>
+ *
+ * (C) Copyright 2010
+ * Ole Reinhardt <ole.reinhardt@thermotemp.de>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/*
+ * Ethernut 5 general board support
+ *
+ * Ethernut is an open source hardware and software project for
+ * embedded Ethernet devices. Hardware layouts and CAD files are
+ * freely available under BSD-like license.
+ *
+ * Ethernut 5 is the first member of the Ethernut board family
+ * with U-Boot and Linux support. This implementation is based
+ * on the original work done by Ole Reinhardt, but heavily modified
+ * to support additional features and the latest board revision 5.0F.
+ *
+ * Main board components are by default:
+ *
+ * Atmel AT91SAM9XE512 CPU with 512 kBytes NOR Flash
+ * 2 x 64 MBytes Micron MT48LC32M16A2P SDRAM
+ * 512 MBytes Micron MT29F4G08ABADA NAND Flash
+ * 4 MBytes Atmel AT45DB321D DataFlash
+ * SMSC LAN8710 Ethernet PHY
+ * Atmel ATmega168 MCU used for power management
+ * Linear Technology LTC4411 PoE controller
+ *
+ * U-Boot relevant board interfaces are:
+ *
+ * 100 Mbit Ethernet with IEEE 802.3af PoE
+ * RS-232 serial port
+ * USB host and device
+ * MMC/SD-Card slot
+ * Expansion port with I2C, SPI and more...
+ *
+ * Typically the U-Boot image is loaded from serial DataFlash into
+ * SDRAM by the samboot boot loader, which is located in internal
+ * NOR Flash and provides all essential initializations like CPU
+ * and peripheral clocks and, of course, the SDRAM configuration.
+ *
+ * For testing purposes it is also possibly to directly transfer
+ * the image into SDRAM via JTAG. A tested configuration exists
+ * for the Turtelizer 2 hardware dongle and the OpenOCD software.
+ * In this case the latter will do the basic hardware configuration
+ * via its reset-init script.
+ *
+ * For additional information visit the project home page at
+ * http://www.ethernut.de/
+ */
+
+#include <common.h>
+#include <net.h>
+#include <netdev.h>
+#include <miiphy.h>
+#include <i2c.h>
+#include <spi.h>
+#include <dataflash.h>
+#include <mmc.h>
+
+#include <asm/arch/at91sam9260.h>
+#include <asm/arch/at91sam9260_matrix.h>
+#include <asm/arch/at91sam9_smc.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_spi.h>
+#include <asm/arch/gpio.h>
+#include <asm/io.h>
+
+#include "ethernut5_pwrman.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+AT91S_DATAFLASH_INFO dataflash_info[CONFIG_SYS_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CONFIG_SYS_MAX_DATAFLASH_BANKS] = {
+ {CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0, 0}
+};
+
+/*
+ * In fact we have 7 partitions, but u-boot supports 5 only. This is
+ * no big deal, because the first partition is reserved for applications
+ * and the last one is used by Nut/OS. Both need not to be visible here.
+ */
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+ { 0x00021000, 0x00041FFF, FLAG_PROTECT_SET, 0, "setup" },
+ { 0x00042000, 0x000C5FFF, FLAG_PROTECT_SET, 0, "uboot" },
+ { 0x000C6000, 0x00359FFF, FLAG_PROTECT_SET, 0, "kernel" },
+ { 0x0035A000, 0x003DDFFF, FLAG_PROTECT_SET, 0, "nutos" },
+ { 0x003DE000, 0x003FEFFF, FLAG_PROTECT_CLEAR, 0, "env" }
+};
+
+/*
+ * This is called last during early initialization. Most of the basic
+ * hardware interfaces are up and running.
+ *
+ * The SDRAM hardware has been configured by the first stage boot loader.
+ * We only need to announce its size, using u-boot's memory check.
+ */
+int dram_init(void)
+{
+ gd->ram_size = get_ram_size(
+ (void *)CONFIG_SYS_SDRAM_BASE,
+ CONFIG_SYS_SDRAM_SIZE);
+ return 0;
+}
+
+#ifdef CONFIG_CMD_NAND
+static void ethernut5_nand_hw_init(void)
+{
+ struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
+ struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
+ unsigned long csa;
+
+ /* Assign CS3 to NAND/SmartMedia Interface */
+ csa = readl(&matrix->ebicsa);
+ csa |= AT91_MATRIX_CS3A_SMC_SMARTMEDIA;
+ writel(csa, &matrix->ebicsa);
+
+ /* Configure SMC CS3 for NAND/SmartMedia */
+ writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+ AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+ &smc->cs[3].setup);
+ writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
+ AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
+ &smc->cs[3].pulse);
+ writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+ &smc->cs[3].cycle);
+ writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+ AT91_SMC_MODE_EXNW_DISABLE |
+ AT91_SMC_MODE_DBW_8 |
+ AT91_SMC_MODE_TDF_CYCLE(2),
+ &smc->cs[3].mode);
+
+#ifdef CONFIG_SYS_NAND_READY_PIN
+ /* Ready pin is optional. */
+ at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+#endif
+ at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+
+
+}
+#endif
+
+/*
+ * This is called first during late initialization.
+ */
+int board_init(void)
+{
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+ /* Enable clocks for all PIOs */
+ writel((1 << ATMEL_ID_PIOA) | (1 << ATMEL_ID_PIOB) |
+ (1 << ATMEL_ID_PIOC),
+ &pmc->pcer);
+
+ /* Enable ctrl+c. */
+ console_init_f();
+ /* Set our official architecture number. */
+ gd->bd->bi_arch_number = 1971; /*MACH_TYPE_ETHERNUT5*/
+ /* Set adress of boot parameters. */
+ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+ /* Initialize UARTs and power management. */
+ at91_seriald_hw_init();
+ ethernut5_power_init();
+
+ ethernut5_nand_hw_init();
+
+#ifdef CONFIG_HAS_DATAFLASH
+ at91_spi0_hw_init(1 << 0);
+#endif
+ return 0;
+}
+
+#ifdef CONFIG_MACB
+/*
+ * This is optionally called last during late initialization.
+ */
+int board_eth_init(bd_t *bis)
+{
+ const char *devname;
+ unsigned short mode;
+
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+ /* Enable on-chip EMAC clock. */
+ writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
+
+ /* Need to reset PHY via power management. */
+ ethernut5_phy_reset();
+ /* Set peripheral pins. */
+ at91_macb_hw_init();
+ /* Basic EMAC initialization. */
+ if (macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC0, CONFIG_PHY_ID))
+ return -1;
+ /*
+ * Early board revisions have a pull-down at the PHY's MODE0
+ * strap pin, which forces the PHY into power down. Here we
+ * switch to all-capable mode.
+ */
+ devname = miiphy_get_current_dev();
+ if (miiphy_read(devname, 0, 18, &mode) == 0) {
+ /* Set mode[2:0] to 0b111. */
+ mode |= 0x00E0;
+ miiphy_write(devname, 0, 18, mode);
+ /* Soft reset overrides strap pins. */
+ miiphy_write(devname, 0, MII_BMCR, BMCR_RESET);
+ }
+ /* Sync environment with network devices, needed for nfsroot. */
+ return eth_init(gd->bd);
+}
+#endif
+
+#ifdef CONFIG_GENERIC_ATMEL_MCI
+int board_mmc_init(bd_t *bd)
+{
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+ /* Enable MCI clock. */
+ writel(1 << ATMEL_ID_MCI,
+ &pmc->pcer);
+
+ /* Initialize MCI hardware. */
+ at91_mci_hw_init();
+ /* Register the device. */
+ return atmel_mci_init((void *)ATMEL_BASE_MCI);
+}
+
+int board_mmc_getcd(u8 *cd, struct mmc *mmc)
+{
+ *cd = at91_get_gpio_value(CONFIG_SYS_MMC_CD_PIN) ? 1 : 0;
+ return 0;
+}
+#endif
+
+#ifdef CONFIG_ATMEL_SPI
+/*
+ * Note, that u-boot uses different code for SPI bus access. While
+ * memory routines use automatic chip select control, the serial
+ * flash support requires 'manual' GPIO control. Thus, we switch
+ * modes.
+ */
+void spi_cs_activate(struct spi_slave *slave)
+{
+ /* Enable NPCS0 in GPIO mode. This disables peripheral control. */
+ at91_set_pio_output(AT91_PIO_PORTA, 3, 0);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+ /* Disable NPCS0 in GPIO mode. */
+ at91_set_pio_output(AT91_PIO_PORTA, 3, 1);
+ /* Switch back to peripheral chip select control. */
+ at91_set_a_periph(AT91_PIO_PORTA, 3, 1);
+}
+
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+ return bus == 0 && cs == 0;
+}
+#endif
diff --git a/board/egnite/ethernut5/ethernut5_pwrman.c b/board/egnite/ethernut5/ethernut5_pwrman.c
new file mode 100644
index 0000000..4b00038
--- /dev/null
+++ b/board/egnite/ethernut5/ethernut5_pwrman.c
@@ -0,0 +1,338 @@
+/*
+ * (C) Copyright 2011
+ * egnite GmbH <info@egnite.de>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/*
+ * Ethernut 5 power management support
+ *
+ * This board may be supplied via USB, IEEE 802.3af PoE or an
+ * auxiliary DC input. An on-board ATmega168 microcontroller,
+ * the so called power management controller or PMC, is used
+ * to select the supply source and to switch on and off certain
+ * energy consuming board components. This allows to reduce the
+ * total stand-by consumption to less than 70mW.
+ *
+ * The main CPU communicates with the PMC via I2C. When
+ * CONFIG_CMD_BSP is defined in the board configuration file,
+ * then the board specific command 'pwrman' becomes available,
+ * which allows to manually deal with the PMC.
+ *
+ * Two distinct registers are provided by the PMC for enabling
+ * and disabling specific features. This avoids the often seen
+ * read-modify-write cycle or shadow register requirement.
+ * Additional registers are available to query the board
+ * status and temperature, the auxiliary voltage and to control
+ * the green user LED that is integrated in the reset switch.
+ *
+ * Note, that the AVR firmware of the PMC is released under BSDL.
+ *
+ * For additional information visit the project home page at
+ * http://www.ethernut.de/
+ */
+#include <common.h>
+#include <asm/arch/at91sam9260.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/gpio.h>
+#include <asm/io.h>
+#include <i2c.h>
+
+#include "ethernut5_pwrman.h"
+
+/* PMC firmware version */
+static int pwrman_major;
+static int pwrman_minor;
+
+/*
+ * Enable Ethernut 5 power management.
+ *
+ * This function must be called during board initialization.
+ * While we are using u-boot's I2C subsystem, it may be required
+ * to enable the serial port before calling this function,
+ * in particular when debugging is enabled.
+ *
+ * If board specific commands are not available, we will activate
+ * all board components.
+ */
+void ethernut5_power_init(void)
+{
+ pwrman_minor = i2c_reg_read(PWRMAN_I2C_ADDR, PWRMAN_REG_VERS);
+ pwrman_major = pwrman_minor >> 4;
+ pwrman_minor &= 15;
+
+#ifndef CONFIG_CMD_BSP
+ /* Do not modify anything, if we do not have a known version. */
+ if (pwrman_major == 2) {
+ /* Without board specific commands we enable all features. */
+ i2c_reg_write(PWRMAN_I2C_ADDR, PWRMAN_REG_ENA, ~PWRMAN_ETHRST);
+ i2c_reg_write(PWRMAN_I2C_ADDR, PWRMAN_REG_DIS, PWRMAN_ETHRST);
+ }
+#endif
+}
+
+/*
+ * Reset Ethernet PHY.
+ *
+ * This function allows the re-configure the PHY after
+ * changing its strap pins.
+ */
+void ethernut5_phy_reset(void)
+{
+ /* Do not modify anything, if we do not have a known version. */
+ if (pwrman_major != 2)
+ return;
+
+ /*
+ * Make sure that the Ethernet clock is enabled and the PHY reset
+ * is disabled for at least 100 us.
+ */
+ i2c_reg_write(PWRMAN_I2C_ADDR, PWRMAN_REG_ENA, PWRMAN_ETHCLK);
+ i2c_reg_write(PWRMAN_I2C_ADDR, PWRMAN_REG_DIS, PWRMAN_ETHRST);
+ udelay(100);
+
+ /*
+ * LAN8710 strap pins are
+ * PA14 => PHY MODE0
+ * PA15 => PHY MODE1
+ * PA17 => PHY MODE2 => 111b all capable
+ * PA18 => PHY ADDR0 => 0b
+ */
+ at91_set_pio_input(AT91_PIO_PORTA, 14, 1);
+ at91_set_pio_input(AT91_PIO_PORTA, 15, 1);
+ at91_set_pio_input(AT91_PIO_PORTA, 17, 1);
+ at91_set_pio_input(AT91_PIO_PORTA, 18, 0);
+
+ /* Activate PHY reset for 100 us. */
+ i2c_reg_write(PWRMAN_I2C_ADDR, PWRMAN_REG_ENA, PWRMAN_ETHRST);
+ udelay(100);
+ i2c_reg_write(PWRMAN_I2C_ADDR, PWRMAN_REG_DIS, PWRMAN_ETHRST);
+
+ at91_set_pio_input(AT91_PIO_PORTA, 14, 1);
+}
+
+/*
+ * Output the firmware version we got during initialization.
+ */
+void ethernut5_print_version(void)
+{
+ printf("%u.%u\n", pwrman_major, pwrman_minor);
+}
+
+/*
+ * All code below this point is optional and implements
+ * the 'pwrman' command.
+ */
+#ifdef CONFIG_CMD_BSP
+
+/* Human readable names of PMC features */
+char *pwrman_feat[8] = {
+ "board", "vbin", "vbout", "mmc",
+ "rs232", "ethclk", "ethrst", "wakeup"
+};
+
+/*
+ * Print all feature names, that have its related flags enabled.
+ */
+static void print_flagged_features(u8 flags)
+{
+ int i;
+
+ for (i = 0; i < 8; i++) {
+ if (flags & (1 << i))
+ printf("%s ", pwrman_feat[i]);
+ }
+}
+
+/*
+ * Return flags of a given list of feature names.
+ *
+ * The function stops@the first unknown list entry and
+ * returns the number of detected names as a function result.
+ */
+static int feature_flags(char * const names[], int num, u8 *flags)
+{
+ int i, j;
+
+ *flags = 0;
+ for (i = 0; i < num; i++) {
+ for (j = 0; j < 8; j++) {
+ if (strcmp(pwrman_feat[j], names[i]) == 0) {
+ *flags |= 1 << j;
+ break;
+ }
+ }
+ if (j > 7)
+ break;
+ }
+ return i;
+}
+
+void ethernut5_print_power(void)
+{
+ u8 flags;
+ int i;
+
+ flags = i2c_reg_read(PWRMAN_I2C_ADDR, PWRMAN_REG_ENA);
+ for (i = 0; i < 2; i++) {
+ if (flags) {
+ print_flagged_features(flags);
+ printf("%s\n", i ? "off" : "on");
+ }
+ flags = ~flags;
+ }
+}
+
+void ethernut5_print_celsius(void)
+{
+ int val;
+
+ /* Read ADC value from LM50 and return Celsius degrees. */
+ val = i2c_reg_read(PWRMAN_I2C_ADDR, PWRMAN_REG_TEMP);
+ val *= 5000; /* 100mV/degree with 5V reference */
+ val += 128; /* 8 bit resolution */
+ val /= 256;
+ val -= 450; /* Celsius offset, still x10 */
+ /* Output full degrees. */
+ printf("%d\n", (val + 5) / 10);
+}
+
+void ethernut5_print_voltage(void)
+{
+ int val;
+
+ /* Read ADC value from divider and return voltage. */
+ val = i2c_reg_read(PWRMAN_I2C_ADDR, PWRMAN_REG_VAUX);
+ /* Resistors are 100k and 12.1k */
+ val += 5;
+ val *= 180948;
+ val /= 100000;
+ val++;
+ /* Calculation was done in 0.1V units. */
+ printf("%d\n", (val + 5) / 10);
+}
+
+/*
+ * Process the board specific 'pwrman' command.
+ */
+int do_pwrman(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ u8 val;
+ int i;
+
+ if (argc == 1) {
+ ethernut5_print_power();
+ } else if (argc == 2 && strcmp(argv[1], "reset") == 0) {
+ at91_set_pio_output(AT91_PIO_PORTB, 8, 1);
+ udelay(100);
+ at91_set_pio_output(AT91_PIO_PORTB, 8, 0);
+ udelay(100000);
+ } else if (argc == 2 && strcmp(argv[1], "temp") == 0) {
+ ethernut5_print_celsius();
+ } else if (argc == 2 && strcmp(argv[1], "vaux") == 0) {
+ ethernut5_print_voltage();
+ } else if (argc == 2 && strcmp(argv[1], "version") == 0) {
+ ethernut5_print_version();
+ } else if (strcmp(argv[1], "led") == 0) {
+ /* Control the green status LED. Blink frequency unit
+ ** is 0.1s, very roughly. */
+ if (argc == 2) {
+ /* No more arguments, output current settings. */
+ val = i2c_reg_read(PWRMAN_I2C_ADDR, PWRMAN_REG_LEDCTL);
+ printf("led %u %u\n", val >> 4, val & 15);
+ } else {
+ /* First argument specifies the on-time. */
+ val = (u8) simple_strtoul(argv[2], NULL, 0);
+ val <<= 4;
+ if (argc > 3) {
+ /* Second argument specifies the off-time. */
+ val |= (u8) (simple_strtoul(argv[3], NULL, 0)
+ & 15);
+ }
+ /* Update the LED control register. */
+ i2c_reg_write(PWRMAN_I2C_ADDR, PWRMAN_REG_LEDCTL, val);
+ }
+ } else {
+ /* We expect a list of features followed an optional status. */
+ argc--;
+ i = feature_flags(&argv[1], argc, &val);
+ if (argc == i) {
+ /* We got a list only, print status. */
+ val &= i2c_reg_read(PWRMAN_I2C_ADDR, PWRMAN_REG_STA);
+ if (val) {
+ if (i > 1)
+ print_flagged_features(val);
+ printf("active\n");
+ } else {
+ printf("inactive\n");
+ }
+ } else {
+ /* More arguments. */
+ if (i == 0) {
+ /* No given feature, use despensibles. */
+ val = PWRMAN_DISPENSIBLE;
+ }
+ if (strcmp(argv[i + 1], "on") == 0) {
+ /* Enable features. */
+ i2c_reg_write(PWRMAN_I2C_ADDR, PWRMAN_REG_ENA,
+ val);
+ } else if (strcmp(argv[i + 1], "off") == 0) {
+ /* Disable features. */
+ i2c_reg_write(PWRMAN_I2C_ADDR, PWRMAN_REG_DIS,
+ val);
+ } else {
+ printf("Bad parameter %s\n", argv[i + 1]);
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+U_BOOT_CMD(
+ pwrman, CONFIG_SYS_MAXARGS, 1, do_pwrman,
+ "power management",
+ "- print settings\n"
+ "pwrman feature ...\n"
+ " - print status\n"
+ "pwrman [feature ...] on|off\n"
+ " - enable/disable specified or all dispensible features\n"
+ "pwrman led [on-time [off-time]]\n"
+ " - print or set led blink timer\n"
+ "pwrman temp\n"
+ " - print board temperature (Celsius)\n"
+ "pwrman vaux\n"
+ " - print auxiliary input voltage\n"
+ "pwrman reset\n"
+ " - reset power management controller\n"
+ "pwrman version\n"
+ " - print firmware version\n"
+ "\n"
+ " features, (*)=dispensible:\n"
+ " board - 1.8V and 3.3V supply\n"
+ " vbin - supply via USB device connector\n"
+ " vbout - USB host connector supply(*)\n"
+ " mmc - MMC slot supply(*)\n"
+ " rs232 - RS232 driver\n"
+ " ethclk - Ethernet PHY clock(*)\n"
+ " ethrst - Ethernet PHY reset\n"
+ " wakeup - RTC alarm"
+);
+#endif /* CONFIG_CMD_BSP */
diff --git a/board/egnite/ethernut5/ethernut5_pwrman.h b/board/egnite/ethernut5/ethernut5_pwrman.h
new file mode 100644
index 0000000..0541884
--- /dev/null
+++ b/board/egnite/ethernut5/ethernut5_pwrman.h
@@ -0,0 +1,68 @@
+/*
+ * (C) Copyright 2011
+ * egnite GmbH <info@egnite.de>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/*
+ * Ethernut 5 power management support
+ *
+ * For additional information visit the project home page at
+ * http://www.ethernut.de/
+ */
+
+/* I2C address of the PMC */
+#define PWRMAN_I2C_ADDR 0x22
+
+/* PMC registers */
+#define PWRMAN_REG_VERS 0 /* Version register */
+#define PWRMAN_REG_STA 1 /* Feature status register */
+#define PWRMAN_REG_ENA 2 /* Feature enable register */
+#define PWRMAN_REG_DIS 3 /* Feature disable register */
+#define PWRMAN_REG_TEMP 4 /* Board temperature */
+#define PWRMAN_REG_VAUX 6 /* Auxiliary input voltage */
+#define PWRMAN_REG_LEDCTL 8 /* LED blinking timer. */
+
+/* Feature flags used in status, enable and disable registers */
+#define PWRMAN_BOARD 0x01 /* 1.8V and 3.3V supply */
+#define PWRMAN_VBIN 0x02 /* VBUS input at device connector */
+#define PWRMAN_VBOUT 0x04 /* VBUS output at host connector */
+#define PWRMAN_MMC 0x08 /* Memory card supply */
+#define PWRMAN_RS232 0x10 /* RS-232 driver shutdown */
+#define PWRMAN_ETHCLK 0x20 /* Ethernet clock enable */
+#define PWRMAN_ETHRST 0x40 /* Ethernet PHY reset */
+#define PWRMAN_WAKEUP 0x80 /* RTC wake-up */
+
+/* Features, which are not essential to keep u-boot alive */
+#define PWRMAN_DISPENSIBLE (PWRMAN_VBOUT | PWRMAN_MMC | PWRMAN_ETHCLK)
+
+/* Enable Ethernut 5 power management. */
+extern void ethernut5_power_init(void);
+
+/* Reset Ethernet PHY. */
+extern void ethernut5_phy_reset(void);
+
+extern void ethernut5_print_version(void);
+
+#ifdef CONFIG_CMD_BSP
+extern void ethernut5_print_power(void);
+extern void ethernut5_print_celsius(void);
+extern void ethernut5_print_voltage(void);
+#endif
diff --git a/boards.cfg b/boards.cfg
index 1e3bfdc..e3b2947 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -109,6 +109,7 @@ cpu9G20 arm arm926ejs cpu9260 eukrea
cpu9G20_nand arm arm926ejs cpu9260 eukrea at91 cpu9260:CPU9G20,NANDBOOT
cpu9G20_128M arm arm926ejs cpu9260 eukrea at91 cpu9260:CPU9G20,CPU9G20_128M
cpu9G20_nand_128M arm arm926ejs cpu9260 eukrea at91 cpu9260:CPU9G20,CPU9G20_128M,NANDBOOT
+ethernut5 arm arm926ejs ethernut5 egnite at91 ethernut5:AT91SAM9XE
top9000eval_xe arm arm926ejs top9000 emk at91 top9000:EVAL9000
top9000su_xe arm arm926ejs top9000 emk at91 top9000:SU9000
meesc arm arm926ejs meesc esd at91 meesc:AT91SAM9263,SYS_USE_NANDFLASH
diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h
new file mode 100644
index 0000000..7e965cf
--- /dev/null
+++ b/include/configs/ethernut5.h
@@ -0,0 +1,290 @@
+/*
+ * (C) Copyright 2011
+ * egnite GmbH <info@egnite.de>
+ *
+ * Configuation settings for Ethernut 5 with AT91SAM9XE.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <asm/hardware.h>
+
+
+/* The first stage boot loader expects u-boot running at this address. */
+#define CONFIG_SYS_TEXT_BASE 0x27000000 /* 16MB available */
+
+/* The first stage boot loader takes care of low level initialization. */
+#define CONFIG_SKIP_LOWLEVEL_INIT
+
+/* CPU information */
+#define CONFIG_ARM926EJS
+#define CONFIG_AT91FAMILY
+#define CONFIG_AT91SAM9260EK
+#define CONFIG_DISPLAY_CPUINFO /* Display at console. */
+#define CONFIG_ARCH_CPU_INIT
+
+/* ARM asynchronous clock */
+#define CONFIG_SYS_AT91_SLOW_CLOCK 32768 /* slow clock xtal */
+#define CONFIG_SYS_AT91_MAIN_CLOCK 18432000 /* 18.432 MHz crystal */
+#define CONFIG_SYS_HZ 1000
+#undef CONFIG_USE_IRQ /* Running w/o interrupts */
+
+/* 32kB internal SRAM */
+#define CONFIG_SRAM_BASE 0x00300000 /*AT91SAM9XE_SRAM_BASE */
+#define CONFIG_SRAM_SIZE (32 << 10)
+#define CONFIG_STACKSIZE (CONFIG_SRAM_SIZE - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SRAM_BASE + CONFIG_STACKSIZE)
+
+/* 128MB SDRAM in 1 bank */
+#define CONFIG_NR_DRAM_BANKS 1
+#define CONFIG_SYS_SDRAM_BASE 0x20000000
+#define CONFIG_SYS_SDRAM_SIZE (128 << 20)
+#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE
+#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
+#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (1 << 20))
+#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_TEXT_BASE \
+ - CONFIG_SYS_MALLOC_LEN)
+
+/* 512kB on-chip NOR flash */
+# define CONFIG_SYS_MAX_FLASH_BANKS 1
+# define CONFIG_SYS_FLASH_BASE 0x00200000 /* AT91SAM9XE_FLASH_BASE */
+# define CONFIG_AT91_EFLASH
+# define CONFIG_SYS_MAX_FLASH_SECT 32
+# define CONFIG_SYS_FLASH_PROTECTION /* First stage loader in sector 0 */
+# define CONFIG_EFLASH_PROTSECTORS 1
+
+/* 512kB DataFlash@NPCS0 */
+#define CONFIG_SYS_MAX_DATAFLASH_BANKS 1
+#define CONFIG_HAS_DATAFLASH
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_ATMEL
+#define CONFIG_ATMEL_DATAFLASH_SPI
+#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 0xC0000000
+#define DATAFLASH_TCSS (0x1a << 16)
+#define DATAFLASH_TCHS (0x1 << 24)
+
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_OFFSET 0x3DE000
+#define CONFIG_ENV_SECT_SIZE (132 << 10)
+#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
+#define CONFIG_ENV_ADDR (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 \
+ + CONFIG_ENV_OFFSET)
+#define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 \
+ + 0x042000)
+
+/* SPI */
+#define CONFIG_ATMEL_SPI
+#define CONFIG_SYS_SPI_WRITE_TOUT (5 * CONFIG_SYS_HZ)
+#define AT91_SPI_CLK 15000000
+
+/* Serial port */
+#define CONFIG_ATMEL_USART
+#define CONFIG_USART3 /* USART 3 is DBGU */
+#define CONFIG_BAUDRATE 115200
+#define CONFIG_SYS_BAUDRATE_TABLE {115200 , 19200, 38400, 57600, 9600 }
+
+#define CONFIG_USART_BASE ATMEL_BASE_DBGU
+#define CONFIG_USART_ID ATMEL_ID_SYS
+
+
+/* Misc. hardware drivers */
+#define CONFIG_AT91_GPIO
+#define CONFIG_ATMEL_LEGACY
+
+/* Command line configuration */
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_LOADS
+
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_SPI
+
+#ifdef MINIMAL_LOADER
+#undef CONFIG_CMD_CONSOLE
+#undef CONFIG_CMD_EDITENV
+#undef CONFIG_CMD_IMI
+#undef CONFIG_CMD_ITEST
+#undef CONFIG_CMD_IMLS
+#undef CONFIG_CMD_LOADB
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_SETGETDCR
+#undef CONFIG_CMD_XIMG
+#else
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_BSP
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_CDP
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DNS
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_RARP
+#define CONFIG_CMD_REISER
+#define CONFIG_CMD_SAVES
+#define CONFIG_CMD_SETEXPR
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_UBI
+#define CONFIG_CMD_UBIFS
+#define CONFIG_CMD_UNZIP
+#define CONFIG_CMD_USB
+#endif
+
+/* NAND flash */
+#ifdef CONFIG_CMD_NAND
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE 0x40000000
+#define CONFIG_SYS_NAND_DBW_8
+#define CONFIG_NAND_ATMEL
+/* our ALE is AD21 */
+#define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
+/* our CLE is AD22 */
+#define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
+#define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PC14
+#define CONFIG_AT91_LEGACY
+#endif
+
+/* JFFS2 */
+#ifdef CONFIG_CMD_JFFS2
+#define CONFIG_MTD_NAND_ECC_JFFS2
+#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_JFFS2_NAND
+#endif
+
+/* Ethernet */
+#define CONFIG_NET_MULTI
+#define CONFIG_NET_RETRY_COUNT 20
+#define CONFIG_MACB
+#define CONFIG_RMII
+#define CONFIG_PHY_ID 0
+#define CONFIG_MACB_SEARCH_PHY
+
+/* MMC */
+#ifdef CONFIG_CMD_MMC
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_GENERIC_ATMEL_MCI
+#define CONFIG_SYS_MMC_CD_PIN AT91_PIN_PC8
+#endif
+
+/* USB */
+#ifdef CONFIG_CMD_USB
+#define CONFIG_USB_ATMEL
+#define CONFIG_USB_OHCI_NEW
+#define CONFIG_SYS_USB_OHCI_CPU_INIT
+#define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000
+#define CONFIG_SYS_USB_OHCI_SLOT_NAME "host"
+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
+#define CONFIG_USB_STORAGE
+#endif
+
+/* RTC */
+#if defined(CONFIG_CMD_DATE) || defined(CONFIG_CMD_SNTP)
+#define CONFIG_RTC_PCF8563
+#define CONFIG_SYS_I2C_RTC_ADDR 0x51
+#endif
+
+/* I2C */
+#define CONFIG_SYS_MAX_I2C_BUS 1
+#define CONFIG_SYS_I2C_SLAVE 0
+#define CONFIG_SYS_I2C_SPEED 100000
+
+#define CONFIG_SOFT_I2C
+#define I2C_SOFT_DECLARATIONS
+
+#define GPIO_I2C_SCL AT91_PIN_PA24
+#define GPIO_I2C_SDA AT91_PIN_PA23
+
+#define I2C_INIT { \
+ at91_set_pio_periph(AT91_PIO_PORTA, 23, 0); \
+ at91_set_pio_multi_drive(AT91_PIO_PORTA, 23, 1); \
+ at91_set_pio_periph(AT91_PIO_PORTA, 24, 0); \
+ at91_set_pio_output(AT91_PIO_PORTA, 24, 0); \
+ at91_set_pio_multi_drive(AT91_PIO_PORTA, 24, 1); \
+}
+
+#define I2C_ACTIVE at91_set_pio_output(AT91_PIO_PORTA, 23, 0)
+#define I2C_TRISTATE at91_set_pio_input(AT91_PIO_PORTA, 23, 0)
+#define I2C_SCL(bit) at91_set_pio_value(AT91_PIO_PORTA, 24, bit)
+#define I2C_SDA(bit) at91_set_pio_value(AT91_PIO_PORTA, 23, bit)
+#define I2C_DELAY udelay(100)
+#define I2C_READ at91_get_pio_value(AT91_PIO_PORTA, 23)
+
+/* DHCP/BOOTP options */
+#ifdef CONFIG_CMD_DHCP
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_SYS_AUTOLOAD "n"
+#endif
+
+/* File systems */
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#if defined(CONFIG_CMD_MTDPARTS) || defined(CONFIG_CMD_NAND)
+#define MTDIDS_DEFAULT "nand0=atmel_nand"
+#define MTDPARTS_DEFAULT "mtdparts=atmel_nand:-(root)"
+#endif
+#if defined(CONFIG_CMD_REISER) || defined(CONFIG_CMD_EXT2) || \
+ defined(CONFIG_CMD_USB) || defined(CONFIG_MMC)
+#define CONFIG_DOS_PARTITION
+#endif
+#define CONFIG_LZO
+#define CONFIG_RBTREE
+
+/* Boot command */
+#define CONFIG_BOOTDELAY 3
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_BOOTCOMMAND "cp.b 0xC00C6000 ${loadaddr} 0x294000; bootm"
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_BOOTARGS "console=ttyS0,115200 " \
+ "root=/dev/mtdblock0 " \
+ MTDPARTS_DEFAULT \
+ " rw rootfstype=jffs2"
+#endif
+
+/* Misc. u-boot settings */
+#define CONFIG_SYS_PROMPT "U-Boot> "
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
+#define CONFIG_SYS_CBSIZE 256
+#define CONFIG_SYS_MAXARGS 16
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + 16 \
+ + sizeof(CONFIG_SYS_PROMPT))
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_CMDLINE_EDITING
+
+
+#endif
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] nestedhvm: handle l2 guest MMIO access
From: Tim Deegan @ 2011-10-24 10:31 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel@lists.xensource.com
In-Reply-To: <4EA17193.1020108@amd.com>
At 15:20 +0200 on 21 Oct (1319210419), Christoph Egger wrote:
> Hyper-V starts a root domain which effectively an l2 guest.
> Hyper-V passes its devices through to the root domain and
> let it do the MMIO accesses. The emulation is done by
> Xen (host) and Hyper-V forwards the interrupts to the l2 guest.
>
> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Applied, thanks.
Tim.
^ permalink raw reply
* [PATCH] mmc: core: Assemble the codes of related to eMMC4.5
From: Seungwon Jeon @ 2011-10-24 10:31 UTC (permalink / raw)
To: linux-mmc; +Cc: cjb, linux-samsung-soc, kgene.kim, dh.han
Code cleanup. The codes of related to eMMC4.5 are scattered.
This patch removes a duplicate if-statement and assembles all.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
---
drivers/mmc/core/mmc.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index fb5bf01..3627044 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -467,29 +467,27 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
}
- /* eMMC v4.5 or later */
- if (card->ext_csd.rev >= 6)
- card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
-
card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
card->erased_byte = 0xFF;
else
card->erased_byte = 0x0;
+ /* eMMC v4.5 or later */
if (card->ext_csd.rev >= 6) {
+ card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
+
card->ext_csd.generic_cmd6_time = 10 *
ext_csd[EXT_CSD_GENERIC_CMD6_TIME];
card->ext_csd.power_off_longtime = 10 *
ext_csd[EXT_CSD_POWER_OFF_LONG_TIME];
- } else
- card->ext_csd.generic_cmd6_time = 0;
- card->ext_csd.cache_size =
- ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
- ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
- ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
- ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
+ card->ext_csd.cache_size =
+ ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
+ ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
+ ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
+ ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
+ }
out:
return err;
--
1.7.0.4
^ permalink raw reply related
* [PATCH] prlimit: add a units column
From: Davidlohr Bueso @ 2011-10-24 10:30 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
From: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
sys-utils/prlimit.c | 40 ++++++++++++++++++++++++----------------
1 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c
index 74c7fc9..49f8f6e 100644
--- a/sys-utils/prlimit.c
+++ b/sys-utils/prlimit.c
@@ -55,27 +55,28 @@ enum {
struct prlimit_desc {
const char *name;
const char *help;
+ const char *unit;
int resource;
};
static struct prlimit_desc prlimit_desc[] =
{
- [AS] = { "AS", N_("address space limit"), RLIMIT_AS },
- [CORE] = { "CORE", N_("max core file size"), RLIMIT_CORE },
- [CPU] = { "CPU", N_("CPU time in secs"), RLIMIT_CPU },
- [DATA] = { "DATA", N_("max data size"), RLIMIT_DATA },
- [FSIZE] = { "FSIZE", N_("max file size"), RLIMIT_FSIZE },
- [LOCKS] = { "LOCKS", N_("max amount of file locks held"), RLIMIT_LOCKS },
- [MEMLOCK] = { "MEMLOCK", N_("max locked-in-memory address space"), RLIMIT_MEMLOCK },
- [MSGQUEUE] = { "MSGQUEUE", N_("max bytes in POSIX mqueues"), RLIMIT_MSGQUEUE },
- [NICE] = { "NICE", N_("max nice prio allowed to raise"), RLIMIT_NICE },
- [NOFILE] = { "NOFILE", N_("max amount of open files"), RLIMIT_NOFILE },
- [NPROC] = { "NPROC", N_("max number of processes"), RLIMIT_NPROC },
- [RSS] = { "RSS", N_("max resident set size"), RLIMIT_RSS },
- [RTPRIO] = { "RTPRIO", N_("max real-time priority"), RLIMIT_RTPRIO },
- [RTTIME] = { "RTTIME", N_("timeout for real-time tasks"), RLIMIT_RTTIME },
- [SIGPENDING] = { "SIGPENDING", N_("max amount of pending signals"), RLIMIT_SIGPENDING },
- [STACK] = { "STACK", N_("max stack size"), RLIMIT_STACK }
+ [AS] = { "AS", N_("address space limit"), "bytes", RLIMIT_AS },
+ [CORE] = { "CORE", N_("max core file size"), "blocks", RLIMIT_CORE },
+ [CPU] = { "CPU", N_("CPU time"), "seconds", RLIMIT_CPU },
+ [DATA] = { "DATA", N_("max data size"), "bytes", RLIMIT_DATA },
+ [FSIZE] = { "FSIZE", N_("max file size"), "blocks", RLIMIT_FSIZE },
+ [LOCKS] = { "LOCKS", N_("max amount of file locks held"), NULL, RLIMIT_LOCKS },
+ [MEMLOCK] = { "MEMLOCK", N_("max locked-in-memory address space"), "kbytes", RLIMIT_MEMLOCK },
+ [MSGQUEUE] = { "MSGQUEUE", N_("max bytes in POSIX mqueues"), "bytes", RLIMIT_MSGQUEUE },
+ [NICE] = { "NICE", N_("max nice prio allowed to raise"), NULL, RLIMIT_NICE },
+ [NOFILE] = { "NOFILE", N_("max amount of open files"), NULL, RLIMIT_NOFILE },
+ [NPROC] = { "NPROC", N_("max number of processes"), NULL, RLIMIT_NPROC },
+ [RSS] = { "RSS", N_("max resident set size"), "pages", RLIMIT_RSS },
+ [RTPRIO] = { "RTPRIO", N_("max real-time priority"), NULL, RLIMIT_RTPRIO },
+ [RTTIME] = { "RTTIME", N_("timeout for real-time tasks"), "microsecs", RLIMIT_RTTIME },
+ [SIGPENDING] = { "SIGPENDING", N_("max amount of pending signals"), NULL, RLIMIT_SIGPENDING },
+ [STACK] = { "STACK", N_("max stack size"), "kbytes", RLIMIT_STACK }
};
struct prlimit {
@@ -91,6 +92,7 @@ enum {
COL_RES,
COL_SOFT,
COL_HARD,
+ COL_UNITS,
};
/* column names */
@@ -107,6 +109,7 @@ struct colinfo infos[] = {
[COL_HELP] = { "DESCRIPTION", 0.1, TT_FL_TRUNC, N_("resource description")},
[COL_SOFT] = { "SOFT", 0.1, TT_FL_RIGHT, N_("soft limit")},
[COL_HARD] = { "HARD", 1, TT_FL_RIGHT, N_("hard limit (ceiling)")},
+ [COL_UNITS] = { "UNITS", 0.1, TT_FL_TRUNC, N_("units")},
};
#define NCOLS ARRAY_SIZE(infos)
@@ -217,6 +220,10 @@ static void add_tt_line(struct tt *tt, struct prlimit *l)
asprintf(&str, "%s", "unlimited") :
asprintf(&str, "%llu", (unsigned long long) l->rlim.rlim_max);
break;
+ case COL_UNITS:
+ rc = l->desc->unit ? asprintf(&str, "%s", l->desc->unit) :
+ asprintf(&str, "------");
+ break;
default:
break;
}
@@ -557,6 +564,7 @@ int main(int argc, char **argv)
columns[ncolumns++] = COL_HELP;
columns[ncolumns++] = COL_SOFT;
columns[ncolumns++] = COL_HARD;
+ columns[ncolumns++] = COL_UNITS;
}
if (!n) {
--
1.7.7
^ permalink raw reply related
* Re: [PATCH bluez] add get_le/get_be helpers
From: Szymon Janc @ 2011-10-24 10:27 UTC (permalink / raw)
To: Vinicius Gomes; +Cc: Emeltchenko Andrei, linux-bluetooth@vger.kernel.org
In-Reply-To: <CAE6HaMkxvTPa1eTj1Og7Lvqn=PvieuKJyzugPouwiUTOsnnW_g@mail.gmail.com>
Hi,
> Sorry if this comes too late, but here's an idea:
>
> How about changing the name of the functions to something a little
> more high level, for example: in attrib/att.h we have
> att_{get,put}_u16() that uses the byte order defined in the ATT spec
> (little endian).
>
> So my suggestion is to have bt_{get,put}_u*() and sdp_{get,put}_u*
> functions (perhaps also no_{get,put}_u* for cases when we use the host
> byte order). The bt_ functions will be used for everything that uses
> the Bluetooth byte order and the sdp_ ones for SDP, which is the only
> case of Big Endian defined by Bluetooth, correct me if I am wrong.
>
> What do you think?
Some profiles e.g. AVRCP and SAP use big endian...
--
BR
Szymon
^ permalink raw reply
* Re: [PATCH bluez] add get_le/get_be helpers
From: Andrei Emeltchenko @ 2011-10-24 10:26 UTC (permalink / raw)
To: Vinicius Gomes; +Cc: linux-bluetooth
In-Reply-To: <CAE6HaMkxvTPa1eTj1Og7Lvqn=PvieuKJyzugPouwiUTOsnnW_g@mail.gmail.com>
Hi Vinicius,
On Mon, Oct 24, 2011 at 12:13:43PM +0200, Vinicius Gomes wrote:
> Hi Andrei,
>
> On Mon, Oct 24, 2011 at 11:20 AM, Emeltchenko Andrei
> <Andrei.Emeltchenko.news@gmail.com> wrote:
> > From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> >
> > Helpers to access LE / BE values. In bluetooth there is a mixture
> > of LE / BE network byte order.
> > ---
>
> Sorry if this comes too late, but here's an idea:
>
> How about changing the name of the functions to something a little
> more high level, for example: in attrib/att.h we have
> att_{get,put}_u16() that uses the byte order defined in the ATT spec
> (little endian).
>
> So my suggestion is to have bt_{get,put}_u*() and sdp_{get,put}_u*
> functions (perhaps also no_{get,put}_u* for cases when we use the host
> byte order). The bt_ functions will be used for everything that uses
> the Bluetooth byte order and the sdp_ ones for SDP, which is the only
maybe we can define bt_{get,put}_u*() as bt_{get,put}_le*() and be with
SDP?
Best regards
Andrei Emeltchenko
> case of Big Endian defined by Bluetooth, correct me if I am wrong.
>
> What do you think?
>
> > lib/bluetooth.h | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 files changed, 64 insertions(+), 0 deletions(-)
> >
> > diff --git a/lib/bluetooth.h b/lib/bluetooth.h
> > index b0680e2..5bd4f03 100644
> > --- a/lib/bluetooth.h
> > +++ b/lib/bluetooth.h
> > @@ -125,6 +125,70 @@ do { \
> > __p->__v = (val); \
> > } while(0)
> >
> > +#if __BYTE_ORDER == __LITTLE_ENDIAN
> > +static inline uint64_t bt_get_le64(void *ptr)
> > +{
> > + return bt_get_unaligned((uint64_t *) ptr);
> > +}
> > +
> > +static inline uint64_t bt_get_be64(void *ptr)
> > +{
> > + return bswap_64(bt_get_unaligned((uint64_t *) ptr));
> > +}
> > +
> > +static inline uint32_t bt_get_le32(void *ptr)
> > +{
> > + return bt_get_unaligned((uint32_t *) ptr);
> > +}
> > +
> > +static inline uint32_t bt_get_be32(void *ptr)
> > +{
> > + return bswap_32(bt_get_unaligned((uint32_t *) ptr));
> > +}
> > +
> > +static inline uint16_t bt_get_le16(void *ptr)
> > +{
> > + return bt_get_unaligned((uint16_t *) ptr);
> > +}
> > +
> > +static inline uint16_t bt_get_be16(void *ptr)
> > +{
> > + return bswap_16(bt_get_unaligned((uint16_t *) ptr));
> > +}
> > +#elif __BYTE_ORDER == __BIG_ENDIAN
> > +static inline uint64_t bt_get_le64(void *ptr)
> > +{
> > + return bswap_64(bt_get_unaligned((uint64_t *) ptr));
> > +}
> > +
> > +static inline uint64_t bt_get_be64(void *ptr)
> > +{
> > + return bt_get_unaligned((uint64_t *) ptr);
> > +}
> > +
> > +static inline uint32_t bt_get_le32(void *ptr)
> > +{
> > + return bswap_32(bt_get_unaligned((uint32_t *) ptr));
> > +}
> > +
> > +static inline uint32_t bt_get_be32(void *ptr)
> > +{
> > + return bt_get_unaligned((uint32_t *) ptr);
> > +}
> > +
> > +static inline uint16_t bt_get_le16(void *ptr)
> > +{
> > + return bswap_16(bt_get_unaligned((uint16_t *) ptr));
> > +}
> > +
> > +static inline uint16_t bt_get_be16(void *ptr)
> > +{
> > + return bt_get_unaligned((uint16_t *) ptr);
> > +}
> > +#else
> > +#error "Unknown byte order"
> > +#endif
> > +
> > /* BD Address */
> > typedef struct {
> > uint8_t b[6];
> > --
> > 1.7.4.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
>
>
> Cheers,
> --
> Vinicius
^ permalink raw reply
* Re: Use of _hint() functions and older machines
From: Clemens Ladisch @ 2011-10-24 10:26 UTC (permalink / raw)
To: Randell Jesup; +Cc: alsa-devel
In-Reply-To: <4EA4F573.9060704@jesup.org>
Randell Jesup wrote:
> On 10/23/2011 6:36 AM, Clemens Ladisch wrote:
> > The best way to get a list of devices would have been to enumerate sound
> > cards with snd_card_next(), then use device names "default:CARD=x".
> > However, this gets only the primary device of each card, there might be
> > sound cards without a PCM device, devices not based on an ALSA kernel
> > driver aren't listed, and the "default:CARD=x" mechanism doesn't work if
> > the user has redefined the "default" device.
>
> Ugh. So, there's no reasonable way to get a user-understandable list
> before .14? How useful was snd_ctl_card_info_get_name()?
That gives you the card name, which is not the same as the name of the
PCM device (although it shouldn't matter when the card has only one
PCM device).
> And I guess I'd need to enumerate the 'devices' and 'subdevices' on
> each card as well...
Yes, but subdevices are typically used for multiple streams that are
mixed together, so you can ignore them.
Regards,
Clemens
^ permalink raw reply
* [Qemu-devel] (no subject)
From: 王永博 @ 2011-10-24 10:25 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 3 bytes --]
ff
[-- Attachment #2: Type: text/html, Size: 5 bytes --]
^ permalink raw reply
* [PATCH] OMAP: SPI: Fix the trying to free nonexistent resource error
From: Shubhrajyoti D @ 2011-10-24 10:24 UTC (permalink / raw)
To: spi-devel-general; +Cc: linux-kernel, Shubhrajyoti D
Currently there is a request_mem_region(r->start, ..
followed by r->start += pdata->regs_offset;
And then in remove
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(r->start, resource_size(r));
Here the offset addition is not taken care. Fix the code for the
same.
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
drivers/spi/spi-omap2-mcspi.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 06dc9a9..471b0f3 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1123,15 +1123,15 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
status = -ENODEV;
goto err1;
}
+ r->start += pdata->regs_offset;
+ r->end += pdata->regs_offset;
+ mcspi->phys = r->start;
if (!request_mem_region(r->start, resource_size(r),
dev_name(&pdev->dev))) {
status = -EBUSY;
goto err1;
}
- r->start += pdata->regs_offset;
- r->end += pdata->regs_offset;
- mcspi->phys = r->start;
mcspi->base = ioremap(r->start, resource_size(r));
if (!mcspi->base) {
dev_dbg(&pdev->dev, "can't ioremap MCSPI\n");
--
1.7.1
^ permalink raw reply related
* LVM2 ./WHATS_NEW lib/metadata/metadata.c
From: zkabelac @ 2011-10-24 10:24 UTC (permalink / raw)
To: lvm-devel
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-10-24 10:24:40
Modified files:
. : WHATS_NEW
lib/metadata : metadata.c
Log message:
Don't print char type[8] as a plain string
pvck prints 'extra' character from the label since there is no '\0'
after the struct label entry and just uint64_t follows directly.
So avoid it by limiting 8 chars to be printed.
https://www.redhat.com/archives/lvm-devel/2011-January/msg00109.html
Signed-off-by: Paul Bolle <pebolle tiscali nl>
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2170&r2=1.2171
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.469&r2=1.470
--- LVM2/WHATS_NEW 2011/10/23 16:05:45 1.2170
+++ LVM2/WHATS_NEW 2011/10/24 10:24:39 1.2171
@@ -1,5 +1,6 @@
Version 2.02.89 -
==================================
+ Don't print char type[8] as a plain string in pvck PV type.
Use vg memory pool implicitely for vg read.
Always use vg memory pool for allocated lv segment.
Remove extra 4kB buffer allocated on stack in print_log().
--- LVM2/lib/metadata/metadata.c 2011/10/11 09:09:00 1.469
+++ LVM2/lib/metadata/metadata.c 2011/10/24 10:24:40 1.470
@@ -3794,7 +3794,7 @@
return 0;
}
- log_print("Found label on %s, sector %"PRIu64", type=%s",
+ log_print("Found label on %s, sector %"PRIu64", type=%.8s",
pv_name, label->sector, label->type);
/*
^ permalink raw reply
* [ath9k-devel] ath9k: good, but can I get to the next level?
From: Manuel Sáez @ 2011-10-24 10:24 UTC (permalink / raw)
To: ath9k-devel
In-Reply-To: <CC00F9CF-6ED5-4E5B-BD77-4F604FA73C08@terran.org>
> The other problem I'm seeing is that when I have a lot of clients connected - say, 20 or so - performance degrades pretty steeply and I start seeing high packet loss. ?I know that sounds like a pure load issue, but I'd like to make sure it's only that and not some efficiency setting I can tune in the driver. ?I do NOT see this kind of performance degradation if I have the same 20 people connected to the AP via a wired connection, doing the same traffic test - so that seems to suggest the WiFi is suffering early.
>
> Thoughts or suggestions? ?Tests I can run? ?Data I can gather?
Is there more networks in this channel? You could use wireshark to see
what's happening and try to use a channel that is not so congested.
>
> Thanks all,
> --
> -bp
>
>
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel at lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
^ permalink raw reply
* [PATCH] OMAP: SPI: Fix the trying to free nonexistent resource error
From: Shubhrajyoti D @ 2011-10-24 10:24 UTC (permalink / raw)
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Shubhrajyoti D
Currently there is a request_mem_region(r->start, ..
followed by r->start += pdata->regs_offset;
And then in remove
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(r->start, resource_size(r));
Here the offset addition is not taken care. Fix the code for the
same.
Signed-off-by: Shubhrajyoti D <shubhrajyoti-l0cyMroinI0@public.gmane.org>
---
drivers/spi/spi-omap2-mcspi.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 06dc9a9..471b0f3 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1123,15 +1123,15 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
status = -ENODEV;
goto err1;
}
+ r->start += pdata->regs_offset;
+ r->end += pdata->regs_offset;
+ mcspi->phys = r->start;
if (!request_mem_region(r->start, resource_size(r),
dev_name(&pdev->dev))) {
status = -EBUSY;
goto err1;
}
- r->start += pdata->regs_offset;
- r->end += pdata->regs_offset;
- mcspi->phys = r->start;
mcspi->base = ioremap(r->start, resource_size(r));
if (!mcspi->base) {
dev_dbg(&pdev->dev, "can't ioremap MCSPI\n");
--
1.7.1
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.