From: miaofng <miaofng@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Fw: Re: Re: [PATCH] add u-boot sja1000/can support
Date: Mon, 26 Oct 2009 16:47:57 +0800 [thread overview]
Message-ID: <200910261647227347739@gmail.com> (raw)
In-Reply-To: 200910261629132341038@gmail.com
Hi mike,
It seems there's a big difference between my current project
and u-boot common usage. I can only enjoy the patch myself now
i want to get a packet from usb/network, then redirect it to can bus.
So blocked write/read of can is not allowed.
On Monday 26 October 2009 00:48:39 miaofng wrote:
> Thanks for careful review. I'll resend the patch according to your remarks
> except follwing: 1)
>
> > +int register_candev(struct can_device *dev)
>
> use "can" or "candev", dont mix the two
>
> answer: register_candev is origin from register_netdev(...). CAN is
> something like network, it may has high level protocols such as open-can
> and etc, so i want to keep that story.
i know what CAN is. the Linux approach makes sense because they've
architected CAN at the socket() layer, and all of the network layers are
written with common coding style. but there is no such socket/network layer
in u-boot so the can/candev distinction isnt necessary.
> > +int sja1000_interrupt(struct can_device *dev)
>
> u-boot is a polled architecture, not an interrupt based one. i guess this
> driver needs rewriting to do that.
>
> answer: no, i want to keep that structure. Then linux drivers can be ported
> to u-boot easily. take an example, in sja1000, i only need to replace
> "_net" to "_can" at most of time. To gain this convience, i added the wrap
> layer of can_core.c.
the convenience factor doesnt mean you can ignore u-boot design principles.
the default behavior for all frameworks/drivers is a polled mode because it's
simple and straightforward. not all u-boot ports even support interrupts
> In order to work in u-boot polled mode, people only
> need to call sja1000_interrupt periodly. It works fine on my board.
erm, no, that's not how things work in u-boot. u-boot processes commands
given to it (either via scripts or from user input), and each command does not
return until it is completely done processing. there is no "backgrounding" of
drivers -- u-boot is not an OS and it is not threaded. that means any CAN
operation does not return until it has finished sending/receiving everything
it was told to.
-mike
next prev parent reply other threads:[~2009-10-26 8:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-24 4:17 [U-Boot] [PATCH] add u-boot sja1000/can support miaofng
2009-10-24 6:35 ` Mike Frysinger
[not found] ` <200910261248270312273@gmail.com>
2009-10-26 7:02 ` Mike Frysinger
[not found] ` <200910261629132341038@gmail.com>
2009-10-26 8:41 ` Mike Frysinger
2009-10-26 13:01 ` miaofng
2009-10-26 8:47 ` miaofng [this message]
2009-10-26 12:32 ` [U-Boot] Fw: Re: " Wolfgang Grandegger
2009-10-26 13:29 ` miaofng
2009-10-26 14:44 ` Wolfgang Grandegger
2009-10-26 22:03 ` Wolfgang Denk
2009-10-26 22:00 ` Wolfgang Denk
2009-10-26 8:18 ` [U-Boot] " Matthias Fuchs
2009-10-26 12:14 ` Wolfgang Grandegger
2009-10-26 21:56 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200910261647227347739@gmail.com \
--to=miaofng@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox