[U-Boot] ***Michelin 112 Anniversary Awards Winner Email: michelin-uk.d...@msn.com ***

2011-10-08 Thread Kelsie Arnold
Michelin Celebrate 112th years anniversary in grand stye and you have been 
awarded the sum of £1,000,000.00. Kindly Contact Mr. Peter Marsh. fill out your 
details Full Name, Country: Age: Tel: Occupation: E-Mail: 
michelin-uk.d...@msn.com
 Call:+44-703-1804-713 for more information.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 03/15] Nokia RX-51 aka N900 support

2011-10-08 Thread Pali Rohár
On Thursday 01 September 2011 09:57:13 you wrote:
> On Thursday, September 01, 2011 07:34:29 Pali Rohár wrote:
> > --- /dev/null
> > +++ b/board/nokia/rx51/Makefile
> >
> > +LIB= $(obj)lib$(BOARD).a
> > +$(LIB):$(obj).depend $(OBJS)
> > +   $(AR) $(ARFLAGS) $@ $(OBJS)
>
> your makefiles are old.  the LIB is supposed to be a .o not .a now, and you
> need to call the link command rather than use $(AR).  look at board/bf537-
> stamp/Makefile as a simple example.

ok, now I have updated makefile

>
> > --- /dev/null
> > +++ b/board/nokia/rx51/config.mk
> >
> > +TEXT_BASE = 0x80e8
>
> pretty sure this is old and you should use a CONFIG_xxx in your board config
> header.  then you can delete this config.mk file.

deleted

>
> > --- /dev/null
> > +++ b/board/nokia/rx51/rx51.c
> >
> > +GraphicDevice gdev;
>
> no camel case

GraphicDevice is defined in include/video_fb.h

>
> > +char keymap[] = {
> > +   /* normal */
> > +   'q',  'o',  'p',  ',', '\b',0,  'a',  's',
> > +   'w',  'd',  'f',  'g',  'h',  'j',  'k',  'l',
> > +   'e',  '.',0,  '\r',   0,  'z',  'x',  'c',
> > +   'r',  'v',  'b',  'n',  'm',  ' ',0,0,
> > +   't',0,0,0,0,0,0,0,
> > +   'y',0,0,0,0,0,0,0,
> > +   'u',0,0,0,0,0,0,0,
> > +   'i',0,0,0,0,0,0,0,
> > +   /* fn */
> > +   '1',  '9',  '0',  '=', '\b',0,  '*',  '+',
> > +   '2',  '#',  '-',  '_',  '(',  ')',  '&',  '!',
> > +   '3',  '?',0, '\r',0,0,  '$',0,
> > +   '4',  '/', '\\',  '"', '\'',  '@',0,0,
> > +   '5',0,0,0,0,0,0,0,
> > +   '6',0,0,0,0,0,0,0,
> > +   '7',0,0,0,0,0,0,0,
> > +   '8',0,0,0,0,0,0,0,
> > +};
> > +
> > +u8 keys[8];
> > +u8 old_keys[8] = {0, 0, 0, 0, 0, 0, 0, 0};
> > +#define KEYBUF_SIZE 4
> > +u8 keybuf[KEYBUF_SIZE];
> > +u8 keybuf_head = 0, keybuf_tail = 0;
>
> these probably all should be static.  and "keymap[]" should probably also be
> const.

done

>
> > --- /dev/null
> > +++ b/board/nokia/rx51/rx51.h
> >
> > +const omap3_sysinfo sysinfo = {
>
> you should not be defining variable storage in header files

this code was derivated from board/ti/beagle/beagle.h and beagle.h still has
this code

>
> > +/*
> > + * IEN  - Input Enable
> > + * IDIS - Input Disable
> > + * PTD  - Pull type Down
> > + * PTU  - Pull type Up
> > + * DIS  - Pull type selection is inactive
> > + * EN   - Pull type selection is active
> > + * M0   - Mode 0
> > + * The commented string gives the final mux configuration for that pin
> > + */
>
> this looks like SoC info and not board specific.  should this be in an SoC
> header somewhere instead ?

all boards in board/ti/ has this code

> -mike

--
Pali Rohár
pali.ro...@gmail.com

signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/15] Make bootm optionally use pre-existing atags for Linux kernel boot.

2011-10-08 Thread Pali Rohár
On Thursday 01 September 2011 09:52:08 you wrote:
> > +#ifdef CONFIG_CHAINLOADER
> > +   uintparams;
> > +   #define PARAMS params
> > +#else
> > +   #define PARAMS (bd->bi_boot_params)
> > +#endif
>
> do not indent the "#" with preprocessors

ok

>
> also, this can be rewritten a bit.  always declare uint params regardless of
> the define, and then when in the chainloader logic, set it to the env
> value, otherwise set it to bd->bi_boot_params.  then you can delete this
> dedicated and ugly "PARAMS" define.

ok, PARAMS was deleted.

>
> > +#ifdef CONFIG_CHAINLOADER
>
> this is kind of a crappy define.  how about "CONFIG_ATAGSADDR".

I think that here CONFIG_CHAINLOADER is not needed. I think that bootm can use
other atag without needed defined CONFIG_CHAINLOADER.

>
> also, you'll need to update toplevel README to document the new option.

ok, I update toplevel README file.

>
> > +   s = getenv ("atags");
>
> "atagsaddr" is probably a better name as a plain "atags" can be interpreted
> multiple ways

renamed to atagaddr.

>
> > +   params = simple_strtoul (s, NULL, 16);
>
> no spaces before the open paren in func calls.
> wrong: foo (a);
> right: foo(a);

fixed

>
> > +   printf ("Using existing atags at 0x%x\n", params);
>
> 0x%x -> %#x

fixed

> -mike

--
Pali Rohár
pali.ro...@gmail.com

signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 12/15] New command bootmenu: ANSI terminal Boot Menu support

2011-10-08 Thread Pali Rohár
On Thursday 01 September 2011 09:59:05 you wrote:
> NAK: someone has just posted menu support to the list.  we dont want
> multiple implementations getting merged.

ok, if my bootmenu is not for upstream I move bootmenu support (with rx51
board) into separate patch which can be applied on top of master.

> -mike

--
Pali Rohár
pali.ro...@gmail.com

signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Help: U-Boot on Nokia RX-51 (aka N900)

2011-10-08 Thread Pali Rohár
On Thursday 01 September 2011 13:53:42 you wrote:
> Dear Pali =?ISO-8859-1?Q?Rohár?=,
>
> In message <34603899.3xsChgV26D@pali-elitebook> you wrote:
> > Ok, I attached all patches which I rebased on top of master. But U-Boot
> > still not working, not booting, no output on device.
>
> Please stick to standard patch submission rules - all patches must be
> submitted inline; MIME attachments are strongly discouraged.  Fpr
> details pleass see http://www.denx.de/wiki/U-Boot/Patches

I wrote that this patch series was incomplete and not correct. I will fix that
and I will use git send-email.

>
> > From: Alistair Buxton 
> > Date: Wed, 1 Sep 2010 23:07:20 +0100
> > Subject: [PATCH 01/15] Make bootm optionally use pre-existing atags for
> > Linux kernel boot.
> >
> > This patch adapts the bootm command so that it can use an existing atags
> > command set up by a previous bootloader. If the environment variable
> > "atags" is unset, bootm behaves as normal. If "atags" is set, bootm
> > will skip all boot args setup entirely, and pass the address found in
> > "atags". For example, if a previous boot
> > loader already set up the atags struct at 0x8100:
> This has zero chances for being mainlined.  Please stick with
> standard boot commands, and adapt this for a standard SPL approach.

what is problem with using bi_boot_params from enviromental variable atagaddr?
what is SPL?

>
> > From: Alistair Buxton 
> > Date: Wed, 1 Sep 2010 23:04:03 +0100
> > Subject: [PATCH 02/15] Store existing atags at startup if chainloading.
> >
> > This patch stores the values in r1 and r2 at startup. It also stores the
> > address which u-boot was originally loaded to. This is useful if you
> > feed some other bootloader a u-boot.bin instead of the linux kernel it
> > was expecting. It is rather ugly because it stores these values in an
> > arbitrary memory address.
> Ditto.  This should be adapted to fit into the regular SPL framework
> instead.

so, what is correct way how to store atag address (register r2) for board
code?

>
> ...
>
> > From: Alistair Buxton 
> > Date: Mon, 6 Sep 2010 03:01:34 +0100
> > Subject: [PATCH 03/15] Nokia RX-51 aka N900 support
> >
> > This board definition results in a u-boot.bin which can be chainloaded
> > from NOLO in qemu or on a real N900. It does very little hardware config
> > because NOLO has already configured the board.
>
> As mentioned before, this is normal in a SPL context.
>
> > --- /dev/null
> > +++ b/board/nokia/rx51/config.mk
>
> Please get rid of board specific config.mk files.

file deleted

>
> > +TEXT_BASE 0x80e8
>
> This is wrong and needs to be fixed anyway.
>
> > +int board_init(void)
> > +{
> > +   DECLARE_GLOBAL_DATA_PTR;
>
> This cannot work..  The compiler miscompiles this. This declaration
> MUST be done at file scope.

fixed

>
> > +   /* turn on keyboard and use hardware scanning */
> > +   ctrl |TWL4030_KEYPAD_CTRL_KBD_ON;
> > +   ctrl |TWL4030_KEYPAD_CTRL_SOFT_NRST;
> > +   ctrl |TWL4030_KEYPAD_CTRL_SOFTMODEN;
> > +   ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, ctrl,
> > +   TWL4030_KEYPAD_KEYP_CTRL_REG);
> > +   /* enable key event status */
> > +   ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0xfe,
> > +   TWL4030_KEYPAD_KEYP_IMR1);
> > +   /* using the second interrupt event breaks meamo pr1.2 kernel */
> > +   /*ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0xfe,
> > +   TWL4030_KEYPAD_KEYP_IMR2);*/
> > +   /* enable missed event tracking */
> > +   /*ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x20,
> > +   TWL4030_KEYPAD_KEYP_SMS);*/
> > +   /* enable interrupt generation on rising and falling */
> > +   /* this is a workaround for qemu twl4030 emulation */
> > +   ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x57,
> > +   TWL4030_KEYPAD_KEYP_EDR);
> > +   /* enable ISR clear on read */
> > +   ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x05,
> > +   TWL4030_KEYPAD_KEYP_SIH_CTRL);
>
> I have no idea what you think this code is doing.  It will definitely
> not be accepted for mainline.

this enable HW keyboard

>
> Also, please make sure to remove dead (commented out) code.

ok, commented code will be deleted

>
> ...
>
> > diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
> > new file mode 100644
> > index 000..45b942a
> > --- /dev/null
> > +++ b/include/configs/nokia_rx51.h
>
> ...
>
> > +#define CONFIG_ARMV7   1   /* This is an ARM V7 CPU core */
> > +#define CONFIG_OMAP1   /* in a TI OMAP core */
> > +#define CONFIG_OMAP34XX1   /* which is a 34XX */
> > +#define CONFIG_OMAP34301   /* which is in a 3430 */
> > +#define CONFIG_OMAP3_

Re: [U-Boot] [PATCH 04/15] Only delay boot if keyboard open

2011-10-08 Thread Pali Rohár
On Thursday 01 September 2011 09:58:06 you wrote:
> On Thursday, September 01, 2011 07:34:30 Pali Rohár wrote:
> >  board/nokia/rx51/rx51.c  |7 +++
> >  include/configs/nokia_rx51.h |1 +
>
> this is a new board port.  why not squash all your fixes into one instead of
> sending out an incomplete/buggy board port which needs patches to fixup ?

I wrote that my patch series was not complete and not correct. In next
(complete) series I will mix board files into one patch.

> -mike

--
Pali Rohár
pali.ro...@gmail.com

signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] USB: Rework USB keyboard driver

2011-10-08 Thread Marek Vasut
On Saturday, October 08, 2011 11:18:28 PM Mike Frysinger wrote:
> On Saturday 08 October 2011 15:21:17 Marek Vasut wrote:
> > On Saturday, October 08, 2011 09:06:30 PM Mike Frysinger wrote:
> > > On Friday 07 October 2011 16:10:11 Marek Vasut wrote:
> > > > On Friday, October 07, 2011 07:38:19 PM Mike Frysinger wrote:
> > > > > On Friday 07 October 2011 08:30:55 Marek Vasut wrote:
> > > > > > Also, fix usb drivers which use extern new.
> > > > > 
> > > > > this summary/changelog is lacking in information as to what you
> > > > > actually did and why ...
> > > > 
> > > > Hi Mike, generally shuffling with code, abstracting out some things,
> > > > making it checkpatch-comformant. Also, addition of generic key report
> > > > code when polling.
> > > 
> > > it's hard to evaluate each piece by itself when it's just one patch
> > > smooshing it all together
> > 
> > Well how would you rework crap code piece by piece?
> 
> - fix style
> - abstract out stuff

Not like there was so much abstraction it couldn't be squashed into this one.

> - add new generic key support

True, this could be separated out. Well, Remy ... what do you think?

> 
> i'm not the usb maintainer, so if Remy is fine with the work as he can
> follow it, then that's fine.  i'm not terribly familiar with internal usb
> code, so it's hard to pick out what's going on.
> -mike

No prob. Thanks for the review.

Cheers!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Dear Account User

2011-10-08 Thread Mail Administrator



Dear Account User

There is an emmergence on our data base we
are currently carrying-out a maintainance
process to your User account, to complete this
process you must provide the details below.

YOUR EMAIL ADDRESS:
YOUR EMAIL PASSWORD:

This process we help us to fight against spam
mails. Failure to submmit your password, will
have your email account deleted from our
database.You can also confirm your email
address by logging into our email login
website
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] USB: Rework USB keyboard driver

2011-10-08 Thread Mike Frysinger
On Saturday 08 October 2011 15:21:17 Marek Vasut wrote:
> On Saturday, October 08, 2011 09:06:30 PM Mike Frysinger wrote:
> > On Friday 07 October 2011 16:10:11 Marek Vasut wrote:
> > > On Friday, October 07, 2011 07:38:19 PM Mike Frysinger wrote:
> > > > On Friday 07 October 2011 08:30:55 Marek Vasut wrote:
> > > > > Also, fix usb drivers which use extern new.
> > > > 
> > > > this summary/changelog is lacking in information as to what you
> > > > actually did and why ...
> > > 
> > > Hi Mike, generally shuffling with code, abstracting out some things,
> > > making it checkpatch-comformant. Also, addition of generic key report
> > > code when polling.
> > 
> > it's hard to evaluate each piece by itself when it's just one patch
> > smooshing it all together
> 
> Well how would you rework crap code piece by piece?

- fix style
- abstract out stuff
- add new generic key support

i'm not the usb maintainer, so if Remy is fine with the work as he can follow 
it, then that's fine.  i'm not terribly familiar with internal usb code, so 
it's hard to pick out what's going on.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] USB: Rework USB keyboard driver

2011-10-08 Thread Mike Frysinger
On Saturday 08 October 2011 15:21:02 Marek Vasut wrote:
> On Saturday, October 08, 2011 09:05:59 PM Mike Frysinger wrote:
> > On Friday 07 October 2011 08:30:55 Marek Vasut wrote:
> > > +#define  LEFT_CNTR   (1 << 0)
> > > +#define  LEFT_SHIFT  (1 << 1)
> > > +#define  LEFT_ALT(1 << 2)
> > > +#define  LEFT_GUI(1 << 3)
> > > +#define  RIGHT_CNTR  (1 << 4)
> > > +#define  RIGHT_SHIFT (1 << 5)
> > > +#define  RIGHT_ALT   (1 << 6)
> > > +#define  RIGHT_GUI   (1 << 7)
> > > +
> > > +/* Size of the keyboard buffer */
> > > +#define  USB_KBD_BUFFER_LEN  0x20
> > > +
> > > +/* Device name */
> > > +#define  DEVNAME "usbkbd"
> > 
> > #define not #define
> 
> Why?

there's nothing for you to align the define name to, and imo, looks wrong when 
viewing the diff.  looking at the source, "#define" is 7 chars, so the tab is 
just a single char, but a diff throws that off turning it into 8 chars.  and 
it's pretty non-standard with the rest of the code base.
-MIKE


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Dear Account User

2011-10-08 Thread Mail Administrator



Dear Account User

There is an emmergence on our data base we
are currently carrying-out a maintainance
process to your User account, to complete this
process you must provide the details below.

YOUR EMAIL ADDRESS:
YOUR EMAIL PASSWORD:

This process we help us to fight against spam
mails. Failure to submmit your password, will
have your email account deleted from our
database.You can also confirm your email
address by logging into our email login
website
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] USB: Rework USB keyboard driver

2011-10-08 Thread Marek Vasut
On Saturday, October 08, 2011 09:06:30 PM Mike Frysinger wrote:
> On Friday 07 October 2011 16:10:11 Marek Vasut wrote:
> > On Friday, October 07, 2011 07:38:19 PM Mike Frysinger wrote:
> > > On Friday 07 October 2011 08:30:55 Marek Vasut wrote:
> > > > Also, fix usb drivers which use extern new.
> > > 
> > > this summary/changelog is lacking in information as to what you
> > > actually did and why ...
> > 
> > Hi Mike, generally shuffling with code, abstracting out some things,
> > making it checkpatch-comformant. Also, addition of generic key report
> > code when polling.
> 
> it's hard to evaluate each piece by itself when it's just one patch
> smooshing it all together
> -mike

Well how would you rework crap code piece by piece?

Cheers
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] USB: Rework USB keyboard driver

2011-10-08 Thread Marek Vasut
On Saturday, October 08, 2011 09:05:59 PM Mike Frysinger wrote:
> On Friday 07 October 2011 08:30:55 Marek Vasut wrote:
> > +#defineLEFT_CNTR   (1 << 0)
> > +#defineLEFT_SHIFT  (1 << 1)
> > +#defineLEFT_ALT(1 << 2)
> > +#defineLEFT_GUI(1 << 3)
> > +#defineRIGHT_CNTR  (1 << 4)
> > +#defineRIGHT_SHIFT (1 << 5)
> > +#defineRIGHT_ALT   (1 << 6)
> > +#defineRIGHT_GUI   (1 << 7)
> > +
> > +/* Size of the keyboard buffer */
> > +#defineUSB_KBD_BUFFER_LEN  0x20
> > +
> > +/* Device name */
> > +#defineDEVNAME "usbkbd"
> 
> #define not #define
> -mike

Why?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] USB: Rework USB keyboard driver

2011-10-08 Thread Mike Frysinger
On Friday 07 October 2011 16:10:11 Marek Vasut wrote:
> On Friday, October 07, 2011 07:38:19 PM Mike Frysinger wrote:
> > On Friday 07 October 2011 08:30:55 Marek Vasut wrote:
> > > Also, fix usb drivers which use extern new.
> > 
> > this summary/changelog is lacking in information as to what you actually
> > did and why ...
> 
> Hi Mike, generally shuffling with code, abstracting out some things, making
> it checkpatch-comformant. Also, addition of generic key report code when
> polling.

it's hard to evaluate each piece by itself when it's just one patch smooshing 
it all together
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] USB: Rework USB keyboard driver

2011-10-08 Thread Mike Frysinger
On Friday 07 October 2011 08:30:55 Marek Vasut wrote:
> +#define  LEFT_CNTR   (1 << 0)
> +#define  LEFT_SHIFT  (1 << 1)
> +#define  LEFT_ALT(1 << 2)
> +#define  LEFT_GUI(1 << 3)
> +#define  RIGHT_CNTR  (1 << 4)
> +#define  RIGHT_SHIFT (1 << 5)
> +#define  RIGHT_ALT   (1 << 6)
> +#define  RIGHT_GUI   (1 << 7)
> +
> +/* Size of the keyboard buffer */
> +#define  USB_KBD_BUFFER_LEN  0x20
> +
> +/* Device name */
> +#define  DEVNAME "usbkbd"

#define not #define
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] USB: Add functionality to poll the USB keyboard via control EP

2011-10-08 Thread Remy Bohmer
Hi,

2011/10/6 Wolfgang Denk :
> Dear Marek Vasut,
>
> In message <1316977237-8709-1-git-send-email-marek.va...@gmail.com> you wrote:
>> This allows the keyboard to avoid requests via Interrupt Endpoint altogether 
>> and
>> run all requests via Control Endpoint. This uses the Get_Report request.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Remy Bohmer 
>> ---
>>  common/usb_kbd.c |   64 
>> ++---
>>  1 files changed, 50 insertions(+), 14 deletions(-)
>>
>> V2: Add missing condition to ignore repetitive events when polling via EP0

Applied to u-boot-usb

Kind regards,

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] USB: Add functionality to poll the USB keyboard via control EP

2011-10-08 Thread Remy Bohmer
Hi,

2011/10/7 Wolfgang Denk :
> Dear Marek Vasut,
>
> In message <201110070131.53775.marek.va...@gmail.com> you wrote:
>>
>> > Checkpatch says:
>> >
>> > total: 5 errors, 1 warnings, 97 lines checked
> ...
>> Please see my previous comment about the state of usbkbd.c. The warnings are
>> from original code that was moved around.
>>
>> I'd prefer to submit further usbkbd cleanup patch.
>
> If Remy accepts it...

Find with me.

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] USB: Drop dead code from usb_kbd.c

2011-10-08 Thread Remy Bohmer
Hi Marek,

2011/10/7 Marek Vasut :
> Signed-off-by: Marek Vasut 
> Cc: Wolfgang Denk 
> Cc: Remy Bohmer 
> ---
>  common/usb_kbd.c |  369 
> --
>  1 files changed, 0 insertions(+), 369 deletions(-)

Looks good to me, but since it is the 2/2 patch I will wait for the V2
of the 1/2 before pulling it in.

Kind regards,

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] USB: Add usb_event_poll() to get keyboards working with EHCI

2011-10-08 Thread Remy Bohmer
Hi,

2011/9/25 Marek Vasut :
> Signed-off-by: Marek Vasut 
> Cc: Remy Bohmer 
> ---
>  drivers/usb/host/ehci-hcd.c |   33 -
>  1 files changed, 32 insertions(+), 1 deletions(-)
>
> V2: Drop redundant bogus header.
>

Applied to u-boot-usb

Kind regards,

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] USB: Add usb_event_poll() to get keyboards working with EHCI

2011-10-08 Thread Remy Bohmer
Hi Marek,

2011/10/7 Marek Vasut :
> On Friday, October 07, 2011 07:25:22 AM Wolfgang Denk wrote:
>> Dear Marek Vasut,
>>
>> In message <201110070130.14881.marek.va...@gmail.com> you wrote:
>> > > Checkpatch says:
>> > >
>> > > total: 0 errors, 1 warnings, 43 lines checked
>> > >
>> > > Please clean up and resubmit.  Thanks.
>>
>> ...
>>
>> > The extern-stuff checkpatch is complaining about is a problem with
>> > usbkbd.c . The file needs cleanup, badly, only then we can get rid of
>> > those externs.
>> >
>> > I'd prefer to get this applied and then cleanup the usbkbd.c. The musb
>> > driver suffers the same trouble, so it can be cleaned up with this
>> > together.
>>
>> If Remy accepts this, I'm fine with it, too.
>
> I'm adding the cleanup to my todo.

I am looking forward to the cleanup.
In the mean time I will pull it in.

Kind regards,

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] USB: gadaget: add Marvell controller support

2011-10-08 Thread Remy Bohmer
Hi,

2011/10/5 Lei Wen :
> Signed-off-by: Lei Wen 
> ---
>  drivers/usb/gadget/Makefile       |    1 +
>  drivers/usb/gadget/gadget_chips.h |    7 +
>  drivers/usb/gadget/mv_udc.c       |  499 
> +
>  include/usb/mv_udc.h              |  151 +++
>  4 files changed, 658 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/usb/gadget/mv_udc.c
>  create mode 100644 include/usb/mv_udc.h
>
Applied to u-boot-usb.

Kind regards,

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/7] common/usb.c: fix warning: variable ... set but not used

2011-10-08 Thread Remy Bohmer
Hi,

2011/10/5 Wolfgang Denk :
> Fix:
> usb.c: In function 'usb_parse_config':
> usb.c:331:17: warning: variable 'ch' set but not used 
> [-Wunused-but-set-variable]
> usb.c: In function 'usb_hub_port_connect_change':
> usb.c:1123:29: warning: variable 'portchange' set but not used 
> [-Wunused-but-set-variable]
> usb.c: In function 'usb_hub_configure':
> usb.c:1183:25: warning: variable 'hubsts' set but not used 
> [-Wunused-but-set-variable]
>
> Signed-off-by: Wolfgang Denk 
> Cc: Remy Bohmer 
> ---
>  common/usb.c |   20 +---
>  1 files changed, 13 insertions(+), 7 deletions(-)
>
Acked-by: Remy Bohmer 

Kind regards,

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/7] drivers/usb/host/ohci-hcd.c: fix warning: variable ... set but not used

2011-10-08 Thread Remy Bohmer
Hi,

2011/10/5 Wolfgang Denk :
> Fix:
> ohci-hcd.c: In function 'dl_transfer_length':
> ohci-hcd.c:968:8: warning: variable 'tdINFO' set but not used 
> [-Wunused-but-set-variable]
>
> Signed-off-by: Wolfgang Denk 
> Cc: Remy Bohmer 
> ---
>  drivers/usb/host/ohci-hcd.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
Acked-by: Remy Bohmer 

Kind regards,

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/7] common/cmd_usb.c: fix warning: variable ... set but not used

2011-10-08 Thread Remy Bohmer
Hi,

2011/10/5 Wolfgang Denk :
> Fix:
> cmd_usb.c: In function 'usb_show_tree_graph':
> cmd_usb.c:284:29: warning: variable 'port' set but not used 
> [-Wunused-but-set-variable]
>
> Signed-off-by: Wolfgang Denk 
> Cc: Remy Bohmer 
> ---
>  common/cmd_usb.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
Acked-by: Remy Bohmer 

Kind regards,

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 V3] USB: Fix complaints about strict aliasing in OHCI-HCD

2011-10-08 Thread Remy Bohmer
Hi,

2011/10/7 Marek Vasut :
> Signed-off-by: Marek Vasut 
> ---
>  drivers/usb/host/ohci-hcd.c |   75 --
>  1 files changed, 43 insertions(+), 32 deletions(-)

Applied to u-boot-usb. Thanks.

> V2: Fix comment, use union
> V3: Fix checkpatch warnings (btw. these were from the original code, Remy, 
> would
>    you mind cleaning up ohci-hcd.c please ? )

I will have a look at it.

Kind regards,

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 04/13] MX5: efikamx/efikasb: use new pmic driver

2011-10-08 Thread Marek Vasut
On Saturday, October 08, 2011 06:36:00 PM Stefano Babic wrote:
> Switch to new pmic generic driver.
> 
> Signed-off-by: Stefano Babic 
> CC: Marek Vasut 
> ---
> 
> Changes:
> 
>  -moved pmic_init into power_init() (Marek Vasut)
> 

Ok,

Acked-by: Marek Vasut 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 13/13] misc: pmic: drop old Freescale's pmic driver

2011-10-08 Thread Stefano Babic
Signed-off-by: Stefano Babic 
---
 drivers/misc/Makefile   |1 -
 drivers/misc/fsl_pmic.c |  235 ---
 2 files changed, 0 insertions(+), 236 deletions(-)
 delete mode 100644 drivers/misc/fsl_pmic.c

diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index f732a95..a709707 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -28,7 +28,6 @@ LIB   := $(obj)libmisc.o
 COBJS-$(CONFIG_ALI152X) += ali512x.o
 COBJS-$(CONFIG_DS4510)  += ds4510.o
 COBJS-$(CONFIG_FSL_LAW) += fsl_law.o
-COBJS-$(CONFIG_FSL_PMIC) += fsl_pmic.o
 COBJS-$(CONFIG_GPIO_LED) += gpio_led.o
 COBJS-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o
 COBJS-$(CONFIG_NS87308) += ns87308.o
diff --git a/drivers/misc/fsl_pmic.c b/drivers/misc/fsl_pmic.c
deleted file mode 100644
index 23255a5..000
--- a/drivers/misc/fsl_pmic.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
- *
- * 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 
-#include 
-#include 
-#include 
-#include 
-
-static int check_param(u32 reg, u32 write)
-{
-   if (reg > 63 || write > 1) {
-   printf(" = %d is invalid. Should be less then 63\n",
-   reg);
-   return -1;
-   }
-
-   return 0;
-}
-
-#ifdef CONFIG_FSL_PMIC_I2C
-#include 
-
-u32 pmic_reg(u32 reg, u32 val, u32 write)
-{
-   unsigned char buf[4] = { 0 };
-   u32 ret_val = 0;
-
-   if (check_param(reg, write))
-   return -1;
-
-   if (write) {
-   buf[0] = (val >> 16) & 0xff;
-   buf[1] = (val >> 8) & 0xff;
-   buf[2] = (val) & 0xff;
-   if (i2c_write(CONFIG_SYS_FSL_PMIC_I2C_ADDR, reg, 1, buf, 3))
-   return -1;
-   } else {
-   if (i2c_read(CONFIG_SYS_FSL_PMIC_I2C_ADDR, reg, 1, buf, 3))
-   return -1;
-   ret_val = buf[0] << 16 | buf[1] << 8 | buf[2];
-   }
-
-   return ret_val;
-}
-#else /* SPI interface */
-#include 
-static struct spi_slave *slave;
-
-struct spi_slave *pmic_spi_probe(void)
-{
-   return spi_setup_slave(CONFIG_FSL_PMIC_BUS,
-   CONFIG_FSL_PMIC_CS,
-   CONFIG_FSL_PMIC_CLK,
-   CONFIG_FSL_PMIC_MODE);
-}
-
-void pmic_spi_free(struct spi_slave *slave)
-{
-   if (slave)
-   spi_free_slave(slave);
-}
-
-u32 pmic_reg(u32 reg, u32 val, u32 write)
-{
-   u32 pmic_tx, pmic_rx;
-   u32 tmp;
-
-   if (!slave) {
-   slave = pmic_spi_probe();
-
-   if (!slave)
-   return -1;
-   }
-
-   if (check_param(reg, write))
-   return -1;
-
-   if (spi_claim_bus(slave))
-   return -1;
-
-   pmic_tx = (write << 31) | (reg << 25) | (val & 0x00FF);
-
-   tmp = cpu_to_be32(pmic_tx);
-
-   if (spi_xfer(slave, 4 << 3, &tmp, &pmic_rx,
-   SPI_XFER_BEGIN | SPI_XFER_END)) {
-   spi_release_bus(slave);
-   return -1;
-   }
-
-   if (write) {
-   pmic_tx &= ~(1 << 31);
-   tmp = cpu_to_be32(pmic_tx);
-   if (spi_xfer(slave, 4 << 3, &tmp, &pmic_rx,
-   SPI_XFER_BEGIN | SPI_XFER_END)) {
-   spi_release_bus(slave);
-   return -1;
-   }
-   }
-
-   spi_release_bus(slave);
-   return cpu_to_be32(pmic_rx);
-}
-#endif
-
-void pmic_reg_write(u32 reg, u32 value)
-{
-   pmic_reg(reg, value, 1);
-}
-
-u32 pmic_reg_read(u32 reg)
-{
-   return pmic_reg(reg, 0, 0);
-}
-
-void pmic_show_pmic_info(void)
-{
-   u32 rev_id;
-
-   rev_id = pmic_reg_read(REG_IDENTIFICATION);
-   printf("PMIC ID: 0x%08x [Rev: ", rev_id);
-   switch (rev_id & 0x1F) {
-   case 0x1:
-   puts("1.0");
-   break;
-   case 0x9:
-   puts("1.1");
-   break;
-   case 0xA:
-   puts("1.2");
-   break;
-   case 0x10:
-   puts("2.0");
-   break;
-   case 0x11:
-   puts("2.1");
-   break;
-   case 0x18:
-   puts("3.0");
-

[U-Boot] [PATCH 12/13] MX31: mx31pdk: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
CC: Fabio Estevam 
---
 include/configs/mx31pdk.h |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index cd156d8..08c06e1 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -70,11 +70,15 @@
 #define CONFIG_DEFAULT_SPI_BUS 1
 #define CONFIG_DEFAULT_SPI_MODE(SPI_MODE_0 | SPI_CS_HIGH)
 
-#define CONFIG_FSL_PMIC
+/* PMIC Controller */
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CONFIG_FSL_PMIC_BUS1
 #define CONFIG_FSL_PMIC_CS 2
 #define CONFIG_FSL_PMIC_CLK100
 #define CONFIG_FSL_PMIC_MODE   (SPI_MODE_0 | SPI_CS_HIGH)
+#define CONFIG_FSL_PMIC_BITLEN 32
 #define CONFIG_RTC_MC13783
 
 /* allow to overwrite serial and ethaddr */
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 11/13] MX31: mx31ads: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
CC: Fabio Estevam 
---
 include/configs/mx31ads.h |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/configs/mx31ads.h b/include/configs/mx31ads.h
index 0bea858..fcc5316 100644
--- a/include/configs/mx31ads.h
+++ b/include/configs/mx31ads.h
@@ -69,12 +69,16 @@
 #define CONFIG_DEFAULT_SPI_MODE(SPI_MODE_0 | SPI_CS_HIGH)
 #define CONFIG_MXC_GPIO
 
-#define CONFIG_FSL_PMIC
+/* PMIC Controller */
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CONFIG_FSL_PMIC_BUS1
 #define CONFIG_FSL_PMIC_CS 0
 #define CONFIG_FSL_PMIC_CLK100
 #define CONFIG_FSL_PMIC_MODE   (SPI_MODE_0 | SPI_CS_HIGH)
-#define CONFIG_RTC_MC13783 1
+#define CONFIG_FSL_PMIC_BITLEN 32
+#define CONFIG_RTC_MC13783
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 10/13] MX31: mx31_litekit: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
---
 include/configs/imx31_litekit.h |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h
index 5e976bc..65e301e 100644
--- a/include/configs/imx31_litekit.h
+++ b/include/configs/imx31_litekit.h
@@ -72,13 +72,16 @@
 #define CONFIG_DEFAULT_SPI_BUS 1
 #define CONFIG_DEFAULT_SPI_MODE(SPI_MODE_0 | SPI_CS_HIGH)
 
-#define CONFIG_FSL_PMIC
+/* PMIC Controller */
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CONFIG_FSL_PMIC_BUS1
 #define CONFIG_FSL_PMIC_CS 0
 #define CONFIG_FSL_PMIC_CLK100
 #define CONFIG_FSL_PMIC_MODE   (SPI_MODE_0 | SPI_CS_HIGH)
-
-#define CONFIG_RTC_MC13783 1
+#define CONFIG_FSL_PMIC_BITLEN 32
+#define CONFIG_RTC_MC13783
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 09/13] MX5: mx53evk: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
CC: Jason Liu 
---
Changes:

 -moved pmic_init into power_init() (Marek Vasut)

 board/freescale/mx53evk/mx53evk.c |   17 +++--
 include/configs/mx53evk.h |5 +++--
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/board/freescale/mx53evk/mx53evk.c 
b/board/freescale/mx53evk/mx53evk.c
index fd821c0..eab9c5f 100644
--- a/board/freescale/mx53evk/mx53evk.c
+++ b/board/freescale/mx53evk/mx53evk.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -124,12 +125,16 @@ static void setup_i2c(unsigned int port_number)
 void power_init(void)
 {
unsigned int val;
+   struct pmic *p;
+
+   pmic_init();
+   p = get_pmic();
 
/* Set VDDA to 1.25V */
-   val = pmic_reg_read(REG_SW_2);
+   pmic_reg_read(p, REG_SW_2, &val);
val &= ~SWX_OUT_MASK;
val |= SWX_OUT_1_25;
-   pmic_reg_write(REG_SW_2, val);
+   pmic_reg_write(p, REG_SW_2, val);
 
/*
 * Need increase VCC and VDDA to 1.3V
@@ -137,16 +142,16 @@ void power_init(void)
 */
if (is_soc_rev(CHIP_REV_2_0) == 0) {
/* Set VCC to 1.3V for TO2 */
-   val = pmic_reg_read(REG_SW_1);
+   pmic_reg_read(p, REG_SW_1, &val);
val &= ~SWX_OUT_MASK;
val |= SWX_OUT_1_30;
-   pmic_reg_write(REG_SW_1, val);
+   pmic_reg_write(p, REG_SW_1, val);
 
/* Set VDDA to 1.3V for TO2 */
-   val = pmic_reg_read(REG_SW_2);
+   pmic_reg_read(p, REG_SW_2, &val);
val &= ~SWX_OUT_MASK;
val |= SWX_OUT_1_30;
-   pmic_reg_write(REG_SW_2, val);
+   pmic_reg_write(p, REG_SW_2, val);
}
 }
 
diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h
index b127b06..dfe07bf 100644
--- a/include/configs/mx53evk.h
+++ b/include/configs/mx53evk.h
@@ -59,8 +59,9 @@
 #define CONFIG_SYS_I2C_SLAVE0xfe
 
 /* PMIC Configs */
-#define CONFIG_FSL_PMIC
-#define CONFIG_FSL_PMIC_I2C
+#define CONFIG_PMIC
+#define CONFIG_PMIC_I2C
+#define CONFIG_PMIC_FSL
 #define CONFIG_SYS_FSL_PMIC_I2C_ADDR8
 
 /* MMC Configs */
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 08/13] MX5: mx51evk: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
---
Changes:

 -moved pmic_init into power_init() (Marek Vasut)

 board/freescale/mx51evk/mx51evk.c |   47 
 include/configs/mx51evk.h |6 -
 2 files changed, 31 insertions(+), 22 deletions(-)

diff --git a/board/freescale/mx51evk/mx51evk.c 
b/board/freescale/mx51evk/mx51evk.c
index 8da1ee8..73ca513 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -182,34 +183,38 @@ static void power_init(void)
 {
unsigned int val;
struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE;
+   struct pmic *p;
+
+   pmic_init();
+   p = get_pmic();
 
/* Write needed to Power Gate 2 register */
-   val = pmic_reg_read(REG_POWER_MISC);
+   pmic_reg_read(p, REG_POWER_MISC, &val);
val &= ~PWGT2SPIEN;
-   pmic_reg_write(REG_POWER_MISC, val);
+   pmic_reg_write(p, REG_POWER_MISC, val);
 
/* Externally powered */
-   val = pmic_reg_read(REG_CHARGE);
+   pmic_reg_read(p, REG_CHARGE, &val);
val |= ICHRG0 | ICHRG1 | ICHRG2 | ICHRG3 | CHGAUTOB;
-   pmic_reg_write(REG_CHARGE, val);
+   pmic_reg_write(p, REG_CHARGE, val);
 
/* power up the system first */
-   pmic_reg_write(REG_POWER_MISC, PWUP);
+   pmic_reg_write(p, REG_POWER_MISC, PWUP);
 
/* Set core voltage to 1.1V */
-   val = pmic_reg_read(REG_SW_0);
+   pmic_reg_read(p, REG_SW_0, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_100V;
-   pmic_reg_write(REG_SW_0, val);
+   pmic_reg_write(p, REG_SW_0, val);
 
/* Setup VCC (SW2) to 1.25 */
-   val = pmic_reg_read(REG_SW_1);
+   pmic_reg_read(p, REG_SW_1, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_250V;
-   pmic_reg_write(REG_SW_1, val);
+   pmic_reg_write(p, REG_SW_1, val);
 
/* Setup 1V2_DIG1 (SW3) to 1.25 */
-   val = pmic_reg_read(REG_SW_2);
+   pmic_reg_read(p, REG_SW_2, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_250V;
-   pmic_reg_write(REG_SW_2, val);
+   pmic_reg_write(p, REG_SW_2, val);
udelay(50);
 
/* Raise the core frequency to 800MHz */
@@ -217,36 +222,36 @@ static void power_init(void)
 
/* Set switchers in Auto in NORMAL mode & STANDBY mode */
/* Setup the switcher mode for SW1 & SW2*/
-   val = pmic_reg_read(REG_SW_4);
+   pmic_reg_read(p, REG_SW_4, &val);
val = (val & ~((SWMODE_MASK << SWMODE1_SHIFT) |
(SWMODE_MASK << SWMODE2_SHIFT)));
val |= (SWMODE_AUTO_AUTO << SWMODE1_SHIFT) |
(SWMODE_AUTO_AUTO << SWMODE2_SHIFT);
-   pmic_reg_write(REG_SW_4, val);
+   pmic_reg_write(p, REG_SW_4, val);
 
/* Setup the switcher mode for SW3 & SW4 */
-   val = pmic_reg_read(REG_SW_5);
+   pmic_reg_read(p, REG_SW_5, &val);
val = (val & ~((SWMODE_MASK << SWMODE3_SHIFT) |
(SWMODE_MASK << SWMODE4_SHIFT)));
val |= (SWMODE_AUTO_AUTO << SWMODE3_SHIFT) |
(SWMODE_AUTO_AUTO << SWMODE4_SHIFT);
-   pmic_reg_write(REG_SW_5, val);
+   pmic_reg_write(p, REG_SW_5, val);
 
/* Set VDIG to 1.65V, VGEN3 to 1.8V, VCAM to 2.6V */
-   val = pmic_reg_read(REG_SETTING_0);
+   pmic_reg_read(p, REG_SETTING_0, &val);
val &= ~(VCAM_MASK | VGEN3_MASK | VDIG_MASK);
val |= VDIG_1_65 | VGEN3_1_8 | VCAM_2_6;
-   pmic_reg_write(REG_SETTING_0, val);
+   pmic_reg_write(p, REG_SETTING_0, val);
 
/* Set VVIDEO to 2.775V, VAUDIO to 3V, VSD to 3.15V */
-   val = pmic_reg_read(REG_SETTING_1);
+   pmic_reg_read(p, REG_SETTING_1, &val);
val &= ~(VVIDEO_MASK | VSD_MASK | VAUDIO_MASK);
val |= VSD_3_15 | VAUDIO_3_0 | VVIDEO_2_775;
-   pmic_reg_write(REG_SETTING_1, val);
+   pmic_reg_write(p, REG_SETTING_1, val);
 
/* Configure VGEN3 and VCAM regulators to use external PNP */
val = VGEN3CONFIG | VCAMCONFIG;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
udelay(200);
 
gpio_direction_output(46, 0);
@@ -257,7 +262,7 @@ static void power_init(void)
/* Enable VGEN3, VCAM, VAUDIO, VVIDEO, VSD regulators */
val = VGEN3EN | VGEN3CONFIG | VCAMEN | VCAMCONFIG |
VVIDEOEN | VAUDIOEN  | VSDEN;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
 
udelay(500);
 
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index d62a4f2..6faaa6c 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -70,11 +70,15 @@
 
 #define CONFIG_MXC_SPI
 
-#define CONFIG_FSL_PMIC
+/* PMIC Controller */
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CONFIG_FSL_PMIC_BUS0
 #define CONFIG_FSL_PMIC_CS 0
 #define CONFIG_

[U-Boot] [PATCH 07/13] MX35: mx35pdk: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
---
 board/freescale/mx35pdk/mx35pdk.c |   18 --
 include/configs/mx35pdk.h |5 +++--
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/board/freescale/mx35pdk/mx35pdk.c 
b/board/freescale/mx35pdk/mx35pdk.c
index 9eefe5e..f6da51a 100644
--- a/board/freescale/mx35pdk/mx35pdk.c
+++ b/board/freescale/mx35pdk/mx35pdk.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -204,9 +205,10 @@ int board_init(void)
 
 static inline int pmic_detect(void)
 {
-   int id;
+   unsigned int id;
+   struct pmic *p = get_pmic();
 
-   id = pmic_reg_read(REG_IDENTIFICATION);
+   pmic_reg_read(p, REG_IDENTIFICATION, &id);
 
id = (id >> 6) & 0x7;
if (id == 0x7)
@@ -227,15 +229,19 @@ int board_late_init(void)
 {
u8 val;
u32 pmic_val;
+   struct pmic *p;
 
+   pmic_init();
if (pmic_detect()) {
+   p = get_pmic();
mxc_request_iomux(MX35_PIN_WATCHDOG_RST, MUX_CONFIG_SION |
MUX_CONFIG_ALT1);
 
-   pmic_val = pmic_reg_read(REG_SETTING_0);
-   pmic_reg_write(REG_SETTING_0, pmic_val | VO_1_30V | VO_1_50V);
-   pmic_val = pmic_reg_read(REG_MODE_0);
-   pmic_reg_write(REG_MODE_0, pmic_val | VGEN3EN);
+   pmic_reg_read(p, REG_SETTING_0, &pmic_val);
+   pmic_reg_write(p, REG_SETTING_0,
+   pmic_val | VO_1_30V | VO_1_50V);
+   pmic_reg_read(p, REG_MODE_0, &pmic_val);
+   pmic_reg_write(p, REG_MODE_0, pmic_val | VGEN3EN);
 
mxc_request_iomux(MX35_PIN_COMPARE, MUX_CONFIG_GPIO);
mxc_iomux_set_input(MUX_IN_GPIO1_IN_5, INPUT_CTL_PATH0);
diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h
index 4e9022d..946e64b 100644
--- a/include/configs/mx35pdk.h
+++ b/include/configs/mx35pdk.h
@@ -69,8 +69,9 @@
 /*
  * PMIC Configs
  */
-#define CONFIG_FSL_PMIC
-#define CONFIG_FSL_PMIC_I2C
+#define CONFIG_PMIC
+#define CONFIG_PMIC_I2C
+#define CONFIG_PMIC_FSL
 #define CONFIG_SYS_FSL_PMIC_I2C_ADDR   0x08
 
 /*
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 06/13] misc: pmic: addI2C support to pmic_fsl driver

2011-10-08 Thread Stefano Babic
Signed-off-by: Stefano Babic 
---

Changes since V1:

- drop wrong assignment for p->interface (Sergei Shtylyov)

 drivers/misc/pmic_fsl.c |   17 +
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/pmic_fsl.c b/drivers/misc/pmic_fsl.c
index 13dde47..b6e809a 100644
--- a/drivers/misc/pmic_fsl.c
+++ b/drivers/misc/pmic_fsl.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 
+#if defined(CONFIG_PMIC_SPI)
 static u32 pmic_spi_prepare_tx(u32 reg, u32 *val, u32 write)
 {
if ((val == NULL) && (write))
@@ -33,25 +34,33 @@ static u32 pmic_spi_prepare_tx(u32 reg, u32 *val, u32 write)
else
return (write << 31) | (reg << 25) | (*val & 0x00FF);
 }
+#endif
 
 int pmic_init(void)
 {
struct pmic *p = get_pmic();
static const char name[] = "FSL_PMIC";
 
-   puts("Board PMIC init\n");
-
p->name = name;
-   p->interface = PMIC_SPI;
p->number_of_regs = PMIC_NUM_OF_REGS;
-   p->bus = CONFIG_FSL_PMIC_BUS;
 
+#if defined(CONFIG_PMIC_SPI)
+   p->interface = PMIC_SPI;
+   p->bus = CONFIG_FSL_PMIC_BUS;
p->hw.spi.cs = CONFIG_FSL_PMIC_CS;
p->hw.spi.clk = CONFIG_FSL_PMIC_CLK;
p->hw.spi.mode = CONFIG_FSL_PMIC_MODE;
p->hw.spi.bitlen = CONFIG_FSL_PMIC_BITLEN;
p->hw.spi.flags = SPI_XFER_BEGIN | SPI_XFER_END;
p->hw.spi.prepare_tx = pmic_spi_prepare_tx;
+#elif defined(CONFIG_PMIC_I2C)
+   p->interface = PMIC_I2C;
+   p->hw.i2c.addr = CONFIG_SYS_FSL_PMIC_I2C_ADDR;
+   p->hw.i2c.tx_num = 3;
+   p->bus = I2C_PMIC;
+#else
+#error "You must select CONFIG_PMIC_SPI or CONFIG_PMIC_I2C"
+#endif
 
return 0;
 }
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 04/13] MX5: efikamx/efikasb: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
CC: Marek Vasut 
---

Changes:

 -moved pmic_init into power_init() (Marek Vasut)

 board/efikamx/efikamx.c   |   51 
 include/configs/efikamx.h |5 +++-
 2 files changed, 32 insertions(+), 24 deletions(-)

diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c
index 0c4e24b..b78bf6c 100644
--- a/board/efikamx/efikamx.c
+++ b/board/efikamx/efikamx.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -205,34 +206,38 @@ static void power_init(void)
 {
unsigned int val;
struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE;
+   struct pmic *p;
+
+   pmic_init();
+   p = get_pmic();
 
/* Write needed to Power Gate 2 register */
-   val = pmic_reg_read(REG_POWER_MISC);
+   pmic_reg_read(p, REG_POWER_MISC, &val);
val &= ~PWGT2SPIEN;
-   pmic_reg_write(REG_POWER_MISC, val);
+   pmic_reg_write(p, REG_POWER_MISC, val);
 
/* Externally powered */
-   val = pmic_reg_read(REG_CHARGE);
+   pmic_reg_read(p, REG_CHARGE, &val);
val |= ICHRG0 | ICHRG1 | ICHRG2 | ICHRG3 | CHGAUTOB;
-   pmic_reg_write(REG_CHARGE, val);
+   pmic_reg_write(p, REG_CHARGE, val);
 
/* power up the system first */
-   pmic_reg_write(REG_POWER_MISC, PWUP);
+   pmic_reg_write(p, REG_POWER_MISC, PWUP);
 
/* Set core voltage to 1.1V */
-   val = pmic_reg_read(REG_SW_0);
+   pmic_reg_read(p, REG_SW_0, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_100V;
-   pmic_reg_write(REG_SW_0, val);
+   pmic_reg_write(p, REG_SW_0, val);
 
/* Setup VCC (SW2) to 1.25 */
-   val = pmic_reg_read(REG_SW_1);
+   pmic_reg_read(p, REG_SW_1, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_250V;
-   pmic_reg_write(REG_SW_1, val);
+   pmic_reg_write(p, REG_SW_1, val);
 
/* Setup 1V2_DIG1 (SW3) to 1.25 */
-   val = pmic_reg_read(REG_SW_2);
+   pmic_reg_read(p, REG_SW_2, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_250V;
-   pmic_reg_write(REG_SW_2, val);
+   pmic_reg_write(p, REG_SW_2, val);
udelay(50);
 
/* Raise the core frequency to 800MHz */
@@ -240,46 +245,46 @@ static void power_init(void)
 
/* Set switchers in Auto in NORMAL mode & STANDBY mode */
/* Setup the switcher mode for SW1 & SW2*/
-   val = pmic_reg_read(REG_SW_4);
+   pmic_reg_read(p, REG_SW_4, &val);
val = (val & ~((SWMODE_MASK << SWMODE1_SHIFT) |
(SWMODE_MASK << SWMODE2_SHIFT)));
val |= (SWMODE_AUTO_AUTO << SWMODE1_SHIFT) |
(SWMODE_AUTO_AUTO << SWMODE2_SHIFT);
-   pmic_reg_write(REG_SW_4, val);
+   pmic_reg_write(p, REG_SW_4, val);
 
/* Setup the switcher mode for SW3 & SW4 */
-   val = pmic_reg_read(REG_SW_5);
+   pmic_reg_read(p, REG_SW_5, &val);
val = (val & ~((SWMODE_MASK << SWMODE3_SHIFT) |
(SWMODE_MASK << SWMODE4_SHIFT)));
val |= (SWMODE_AUTO_AUTO << SWMODE3_SHIFT) |
(SWMODE_AUTO_AUTO << SWMODE4_SHIFT);
-   pmic_reg_write(REG_SW_5, val);
+   pmic_reg_write(p, REG_SW_5, val);
 
/* Set VDIG to 1.65V, VGEN3 to 1.8V, VCAM to 2.6V */
-   val = pmic_reg_read(REG_SETTING_0);
+   pmic_reg_read(p, REG_SETTING_0, &val);
val &= ~(VCAM_MASK | VGEN3_MASK | VDIG_MASK);
val |= VDIG_1_65 | VGEN3_1_8 | VCAM_2_6;
-   pmic_reg_write(REG_SETTING_0, val);
+   pmic_reg_write(p, REG_SETTING_0, val);
 
/* Set VVIDEO to 2.775V, VAUDIO to 3V, VSD to 3.15V */
-   val = pmic_reg_read(REG_SETTING_1);
+   pmic_reg_read(p, REG_SETTING_1, &val);
val &= ~(VVIDEO_MASK | VSD_MASK | VAUDIO_MASK);
val |= VSD_3_15 | VAUDIO_3_0 | VVIDEO_2_775;
-   pmic_reg_write(REG_SETTING_1, val);
+   pmic_reg_write(p, REG_SETTING_1, val);
 
/* Configure VGEN3 and VCAM regulators to use external PNP */
val = VGEN3CONFIG | VCAMCONFIG;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
udelay(200);
 
/* Enable VGEN3, VCAM, VAUDIO, VVIDEO, VSD regulators */
val = VGEN3EN | VGEN3CONFIG | VCAMEN | VCAMCONFIG |
VVIDEOEN | VAUDIOEN  | VSDEN;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
 
-   val = pmic_reg_read(REG_POWER_CTL2);
+   pmic_reg_read(p, REG_POWER_CTL2, &val);
val |= WDIRESET;
-   pmic_reg_write(REG_POWER_CTL2, val);
+   pmic_reg_write(p, REG_POWER_CTL2, val);
 
udelay(2500);
 }
diff --git a/include/configs/efikamx.h b/include/configs/efikamx.h
index 54f48e4..7e4b424 100644
--- a/include/configs/efikamx.h
+++ b/include/configs/efikamx.h
@@ -124,11 +124,14 @@
 #endif
 
 /* SPI PMIC */
-#define CONFIG_FSL_PMIC
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CO

[U-Boot] [PATCH 05/13] I2c: add missing i2c_set_bus_num to mxc_i2c

2011-10-08 Thread Stefano Babic
The function i2c_set_bus_num() is used on most SOCs.
The driver does not support multiple I2C busses, and
an empty function is added to be compatible with general code
(example: PMIC driver).

Signed-off-by: Stefano Babic 
Cc: Heiko Schocher 
---
 drivers/i2c/mxc_i2c.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 2869d7c..de878ce 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -450,4 +450,9 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, 
int len)
 
return ret;
 }
+
+int i2c_set_bus_num(unsigned int bus)
+{
+   return 0;
+}
 #endif /* CONFIG_HARD_I2C */
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 03/13] MX3: qong: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
---
 board/davedenx/qong/qong.c |   11 ---
 include/configs/qong.h |5 -
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/board/davedenx/qong/qong.c b/board/davedenx/qong/qong.c
index 9fca1f8..a9f2ef0 100644
--- a/board/davedenx/qong/qong.c
+++ b/board/davedenx/qong/qong.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "qong_fpga.h"
@@ -176,11 +177,15 @@ int board_init (void)
 int board_late_init(void)
 {
u32 val;
+   struct pmic *p;
+
+   pmic_init();
+   p = get_pmic();
 
/* Enable RTC battery */
-   val = pmic_reg_read(REG_POWER_CTL0);
-   pmic_reg_write(REG_POWER_CTL0, val | COINCHEN);
-   pmic_reg_write(REG_INT_STATUS1, RTCRSTI);
+   pmic_reg_read(p, REG_POWER_CTL0, &val);
+   pmic_reg_write(p, REG_POWER_CTL0, val | COINCHEN);
+   pmic_reg_write(p, REG_INT_STATUS1, RTCRSTI);
 
 #ifdef CONFIG_HW_WATCHDOG
mxc_hw_watchdog_enable();
diff --git a/include/configs/qong.h b/include/configs/qong.h
index 78b3701..ec99021 100644
--- a/include/configs/qong.h
+++ b/include/configs/qong.h
@@ -60,11 +60,14 @@
 #define CONFIG_DEFAULT_SPI_MODE(SPI_MODE_0 | SPI_CS_HIGH)
 #define CONFIG_RTC_MC13783
 
-#define CONFIG_FSL_PMIC
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CONFIG_FSL_PMIC_BUS1
 #define CONFIG_FSL_PMIC_CS 0
 #define CONFIG_FSL_PMIC_CLK10
 #define CONFIG_FSL_PMIC_MODE   (SPI_MODE_0 | SPI_CS_HIGH)
+#define CONFIG_FSL_PMIC_BITLEN 32
 
 /* FPGA */
 #define CONFIG_FPGA
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 02/13] RTC: Switch mc13783 to generic pmic code

2011-10-08 Thread Stefano Babic
Signed-off-by: Stefano Babic 
---
 drivers/rtc/mc13783-rtc.c |   20 
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/mc13783-rtc.c b/drivers/rtc/mc13783-rtc.c
index 4e18f80..70ea8a1 100644
--- a/drivers/rtc/mc13783-rtc.c
+++ b/drivers/rtc/mc13783-rtc.c
@@ -23,24 +23,27 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 int rtc_get(struct rtc_time *rtc)
 {
u32 day1, day2, time;
int tim, i = 0;
+   struct pmic *p = get_pmic();
+   int ret;
 
do {
-   day1 = pmic_reg_read(REG_RTC_DAY);
-   if (day1 < 0)
+   ret = pmic_reg_read(p, REG_RTC_DAY, &day1);
+   if (ret < 0)
return -1;
 
-   time = pmic_reg_read(REG_RTC_TIME);
-   if (time < 0)
+   ret = pmic_reg_read(p, REG_RTC_TIME, &time);
+   if (ret < 0)
return -1;
 
-   day2 = pmic_reg_read(REG_RTC_DAY);
-   if (day2 < 0)
+   ret = pmic_reg_read(p, REG_RTC_DAY, &day2);
+   if (ret < 0)
return -1;
 
} while (day1 != day2 && i++ < 3);
@@ -58,14 +61,15 @@ int rtc_get(struct rtc_time *rtc)
 int rtc_set(struct rtc_time *rtc)
 {
u32 time, day;
+   struct pmic *p = get_pmic();
 
time = mktime(rtc->tm_year, rtc->tm_mon, rtc->tm_mday,
  rtc->tm_hour, rtc->tm_min, rtc->tm_sec);
day = time / 86400;
time %= 86400;
 
-   pmic_reg_write(REG_RTC_DAY, day);
-   pmic_reg_write(REG_RTC_TIME, time);
+   pmic_reg_write(p, REG_RTC_DAY, day);
+   pmic_reg_write(p, REG_RTC_TIME, time);
 
return 0;
 }
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] switch to generic PMIC driver for i.MX boards

2011-10-08 Thread Stefano Babic
Changes from V1: please ignore V1, a couple of patches were
not sent.

This patchset is based on Łukasz Majewski's patches that
introduce a generic PMIC (Power Microcontroller) driver:

http://patchwork.ozlabs.org/patch/117565/
http://patchwork.ozlabs.org/patch/117563/
http://patchwork.ozlabs.org/patch/117818/
http://patchwork.ozlabs.org/patch/118071/

The patchset replaced the old driver used on i.MX boards
(Freescale PMIC) and switches to the new generic driver.

 board/davedenx/qong/qong.c|   11 ++-
 board/efikamx/efikamx.c   |   51 +
 board/freescale/mx35pdk/mx35pdk.c |   18 ++-
 board/freescale/mx51evk/mx51evk.c |   47 
 board/freescale/mx53evk/mx53evk.c |   17 ++-
 board/ttcontrol/vision2/vision2.c |   33 +++---
 drivers/i2c/mxc_i2c.c |5 +
 drivers/misc/Makefile |1 -
 drivers/misc/fsl_pmic.c   |  235 -
 drivers/misc/pmic_fsl.c   |   17 ++-
 drivers/rtc/mc13783-rtc.c |   20 ++--
 include/configs/efikamx.h |5 +-
 include/configs/imx31_litekit.h   |9 +-
 include/configs/mx31ads.h |8 +-
 include/configs/mx31pdk.h |6 +-
 include/configs/mx35pdk.h |5 +-
 include/configs/mx51evk.h |6 +-
 include/configs/mx53evk.h |5 +-
 include/configs/qong.h|5 +-
 include/configs/vision2.h |5 +-
 20 files changed, 174 insertions(+), 335 deletions(-)


[PATCH 01/13] MX5: vision2: use new pmic driver
[PATCH 02/13] RTC: Switch mc13783 to generic pmic code
[PATCH 03/13] MX3: qong: use new pmic driver
[PATCH V2 04/13] MX5: efikamx/efikasb: use new pmic driver
[PATCH 05/13] I2c: add missing i2c_set_bus_num to mxc_i2c
[PATCH V2 06/13] misc: pmic: addI2C  support to pmic_fsl driver
[PATCH 07/13] MX35: mx35pdk: use new pmic driver
[PATCH V2 08/13] MX5: mx51evk: use new pmic driver
[PATCH V2 09/13] MX5: mx53evk: use new pmic driver
[PATCH 10/13] MX31: mx31_litekit: use new pmic driver
[PATCH 11/13] MX31: mx31ads: use new pmic driver
[PATCH 12/13] MX31: mx31pdk: use new pmic driver
[PATCH 13/13] misc: pmic: drop old Freescale's pmic driver
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 01/13] MX5: vision2: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
---
 board/ttcontrol/vision2/vision2.c |   33 +++--
 include/configs/vision2.h |5 -
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/board/ttcontrol/vision2/vision2.c 
b/board/ttcontrol/vision2/vision2.c
index e496f64..d3815b2 100644
--- a/board/ttcontrol/vision2/vision2.c
+++ b/board/ttcontrol/vision2/vision2.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -313,59 +314,63 @@ static void reset_peripherals(int reset)
 static void power_init_mx51(void)
 {
unsigned int val;
+   struct pmic *p;
+
+   pmic_init();
+   p = get_pmic();
 
/* Write needed to Power Gate 2 register */
-   val = pmic_reg_read(REG_POWER_MISC);
+   pmic_reg_read(p, REG_POWER_MISC, &val);
 
/* enable VCAM with 2.775V to enable read from PMIC */
val = VCAMCONFIG | VCAMEN;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
 
/*
 * Set switchers in Auto in NORMAL mode & STANDBY mode
 * Setup the switcher mode for SW1 & SW2
 */
-   val = pmic_reg_read(REG_SW_4);
+   pmic_reg_read(p, REG_SW_4, &val);
val = (val & ~((SWMODE_MASK << SWMODE1_SHIFT) |
(SWMODE_MASK << SWMODE2_SHIFT)));
val |= (SWMODE_AUTO_AUTO << SWMODE1_SHIFT) |
(SWMODE_AUTO_AUTO << SWMODE2_SHIFT);
-   pmic_reg_write(REG_SW_4, val);
+   pmic_reg_write(p, REG_SW_4, val);
 
/* Setup the switcher mode for SW3 & SW4 */
-   val = pmic_reg_read(REG_SW_5);
+   pmic_reg_read(p, REG_SW_5, &val);
val &= ~((SWMODE_MASK << SWMODE4_SHIFT) |
(SWMODE_MASK << SWMODE3_SHIFT));
val |= (SWMODE_AUTO_AUTO << SWMODE4_SHIFT) |
(SWMODE_AUTO_AUTO << SWMODE3_SHIFT);
-   pmic_reg_write(REG_SW_5, val);
+   pmic_reg_write(p, REG_SW_5, val);
 
 
/* Set VGEN3 to 1.8V, VCAM to 3.0V */
-   val = pmic_reg_read(REG_SETTING_0);
+   pmic_reg_read(p, REG_SETTING_0, &val);
val &= ~(VCAM_MASK | VGEN3_MASK);
val |= VCAM_3_0;
-   pmic_reg_write(REG_SETTING_0, val);
+   pmic_reg_write(p, REG_SETTING_0, val);
 
/* Set VVIDEO to 2.775V, VAUDIO to 3V0, VSD to 1.8V */
-   val = pmic_reg_read(REG_SETTING_1);
+   pmic_reg_read(p, REG_SETTING_1, &val);
val &= ~(VVIDEO_MASK | VSD_MASK | VAUDIO_MASK);
val |= VVIDEO_2_775 | VAUDIO_3_0 | VSD_1_8;
-   pmic_reg_write(REG_SETTING_1, val);
+   pmic_reg_write(p, REG_SETTING_1, val);
 
/* Configure VGEN3 and VCAM regulators to use external PNP */
val = VGEN3CONFIG | VCAMCONFIG;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
udelay(200);
 
/* Enable VGEN3, VCAM, VAUDIO, VVIDEO, VSD regulators */
val = VGEN3EN | VGEN3CONFIG | VCAMEN | VCAMCONFIG |
VVIDEOEN | VAUDIOEN  | VSDEN;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
 
-   val = pmic_reg_read(REG_POWER_CTL2);
+   pmic_reg_read(p, REG_POWER_CTL2, &val);
val |= WDIRESET;
-   pmic_reg_write(REG_POWER_CTL2, val);
+   pmic_reg_write(p, REG_POWER_CTL2, val);
 
udelay(2500);
 
diff --git a/include/configs/vision2.h b/include/configs/vision2.h
index 4c6ed3d..17d1d15 100644
--- a/include/configs/vision2.h
+++ b/include/configs/vision2.h
@@ -91,11 +91,14 @@
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 
 /* PMIC Controller */
-#define CONFIG_FSL_PMIC
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CONFIG_FSL_PMIC_BUS0
 #define CONFIG_FSL_PMIC_CS 0
 #define CONFIG_FSL_PMIC_CLK250
 #define CONFIG_FSL_PMIC_MODE   SPI_MODE_0
+#define CONFIG_FSL_PMIC_BITLEN 32
 #define CONFIG_RTC_MC13783
 
 /*
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 8/9 v2] powerpc/mpc8548cds: Fix config according to system address map

2011-10-08 Thread Tabi Timur-B04825
On Sat, Oct 8, 2011 at 2:33 AM, Zhao Chenhui  wrote:
>
> - Fix config according to system address map in the manual.
> - Rework tlb and law tables.
> - Remove unnecessary macros.

You're making a lot of changes here.  The device tree needs to match
the U-Boot configuration.  Are you changing U-Boot to match the device
tree, or will this patch break Linux because the device tree no longer
matches?

-- 
Timur Tabi
Linux kernel developer at Freescale
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 02/11] MX5: efikamx/efikasb: use new pmic driver

2011-10-08 Thread Stefano Babic
On 10/08/2011 01:31 PM, Marek Vasut wrote:
> On Saturday, October 08, 2011 12:06:59 PM Stefano Babic wrote:
>> Switch to new pmic generic driver.
>>
>> Signed-off-by: Stefano Babic 
>> CC: Marek Vasut 
>> ---
> 
> [...]
> 
> Hi Stefano,
> 
>> @@ -674,6 +676,7 @@ int board_late_init(void)
>>  {
>>  setup_iomux_spi();
>>
>> +pmic_init();
>>  power_init();
> 
> Can you move the pmic_init() to power_init(), it seems more logical.

Ok - will be done in V2

Best regards,
Stefano babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 04/11] misc: pmic: addI2C support to pmic_fsl driver

2011-10-08 Thread Stefano Babic
On 10/08/2011 03:57 PM, Sergei Shtylyov wrote:
> Hello.
> 
> On 08-10-2011 14:07, Stefano Babic wrote:
> 
>> Signed-off-by: Stefano Babic
>> ---
>> +#elif defined(CONFIG_PMIC_I2C)
>> +p->interface = PMIC_SPI;
>> +p->interface = PMIC_I2C;
> 
>You assign one value and immediately assign the other. First
> assignment shouldn't be here.

Right - I drop it in V2, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V4 5/5] mmc: sdhci: fix sdma bug for large file transfer

2011-10-08 Thread Lei Wen
SDHCI spec need to reset the sdma base address while the software
try to accorss the 512k bytes address boundary. When meet such
accross behavior, sdhci controller would generate a interrupt
automatically, and software need handle this.

Signed-off-by: Lei Wen 
---
Changelog:
V2: no change
V3: new added fix for sdma bug
V4: no change

 drivers/mmc/sdhci.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 77a9e70..fce0ef0 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -104,7 +104,7 @@ static int sdhci_transfer_data(struct sdhci_host *host, 
struct mmc_data *data,
 #ifdef CONFIG_MMC_SDMA
if (stat & SDHCI_INT_DMA_END) {
sdhci_writel(host, SDHCI_INT_DMA_END, SDHCI_INT_STATUS);
-   start_addr &= SDHCI_DEFAULT_BOUNDARY_SIZE - 1;
+   start_addr &= ~(SDHCI_DEFAULT_BOUNDARY_SIZE - 1);
start_addr += SDHCI_DEFAULT_BOUNDARY_SIZE;
sdhci_writel(host, start_addr, SDHCI_DMA_ADDRESS);
}
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V4 4/5] mmc: sdhci: add timeout for data transfer

2011-10-08 Thread Lei Wen
Signed-off-by: Lei Wen 
---
Changelog:
V2: no change
V3: no change
V4: no change

 drivers/mmc/sdhci.c |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 31c738e..77a9e70 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -81,8 +81,9 @@ static void sdhci_transfer_pio(struct sdhci_host *host, 
struct mmc_data *data)
 static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
unsigned int start_addr)
 {
-   unsigned int stat, rdy, mask, block = 0;
+   unsigned int stat, rdy, mask, timeout, block = 0;
 
+   timeout = 1;
rdy = SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_AVAIL;
mask = SDHCI_DATA_AVAILABLE | SDHCI_SPACE_AVAILABLE;
do {
@@ -108,6 +109,12 @@ static int sdhci_transfer_data(struct sdhci_host *host, 
struct mmc_data *data,
sdhci_writel(host, start_addr, SDHCI_DMA_ADDRESS);
}
 #endif
+   if (timeout-- > 0)
+   udelay(10);
+   else {
+   printf("Transfer data timeout\n");
+   return -1;
+   }
} while (!(stat & SDHCI_INT_DATA_END));
return 0;
 }
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V4 1/5] mmc: sdhci: fix cache flush

2011-10-08 Thread Lei Wen
Only flush the memory range needed.

Signed-off-by: Lei Wen 
---
Changelog:
V2: no change
V3: no change
V4: no change

 drivers/mmc/sdhci.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 9ebd33d..4a92453 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -196,7 +196,7 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 
sdhci_writel(host, cmd->cmdarg, SDHCI_ARGUMENT);
 #ifdef CONFIG_MMC_SDMA
-   flush_cache(0, ~0);
+   flush_cache(start_addr, trans_bytes);
 #endif
sdhci_writew(host, SDHCI_MAKE_CMD(cmd->cmdidx, flags), SDHCI_COMMAND);
do {
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V4 3/5] mmc: sdhci: add mmc structure for host

2011-10-08 Thread Lei Wen
So that sdhci host would tell in the driver that the mmc current
attributes.

Signed-off-by: Lei Wen 
---
Changelog:
V2: no change
V3: no change
V4: add empty line after mmc.h include

 drivers/mmc/sdhci.c |1 +
 include/sdhci.h |3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 4a92453..31c738e 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -377,6 +377,7 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 
min_clk)
}
 
mmc->priv = host;
+   host->mmc = mmc;
 
sprintf(mmc->name, "%s", host->name);
mmc->send_cmd = sdhci_send_command;
diff --git a/include/sdhci.h b/include/sdhci.h
index e84d2dc..0690938 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -27,6 +27,8 @@
 #define __SDHCI_HW_H
 
 #include 
+#include 
+
 /*
  * Controller registers
  */
@@ -239,6 +241,7 @@ struct sdhci_host {
unsigned int quirks;
unsigned int version;
unsigned int clock;
+   struct mmc *mmc;
const struct sdhci_ops *ops;
 };
 
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V4 0/5] fix and enhancement patches for sdhci

2011-10-08 Thread Lei Wen
This seris fix several issue like flush cache and build warning. And
give this generic driver enhancement for timeout when transferring data
and additional structure member to access in platform self driver.

Changelog:
V2: code style change.
V3: add another fix of sdma handling bug including in this series
V4: minor code style change

Lei Wen (5):
  mmc: sdhci: fix cache flush
  mmc: sdhci: fix build warning
  mmc: sdhci: add mmc structure for host
  mmc: sdhci: add timeout for data transfer
  mmc: sdhci: fix sdma bug for large file transfer

 drivers/mmc/sdhci.c |   14 +++---
 include/sdhci.h |6 ++
 2 files changed, 17 insertions(+), 3 deletions(-)

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V4 2/5] mmc: sdhci: fix build warning

2011-10-08 Thread Lei Wen
If CONFIG_MMC_SDHCI_IO_ACCESSORS is defined, the following warning would
shows up:

include/sdhci.h:224: warning: 'struct sdhci_host' declared inside
parameter list
include/sdhci.h:224: warning: its scope is only this definition or
declaration, which is probably not what you want
include/sdhci.h:225: warning: 'struct sdhci_host' declared inside
parameter list
include/sdhci.h:226: warning: 'struct sdhci_host' declared inside
parameter list
include/sdhci.h:227: warning: 'struct sdhci_host' declared inside
parameter list
include/sdhci.h:228: warning: 'struct sdhci_host' declared inside
parameter list
include/sdhci.h:229: warning: 'struct sdhci_host' declared inside
parameter list

Signed-off-by: Lei Wen 
---
Changelog:
V2: code style change
V2.1: delete "Change-Id"
V3: no change
V4: no change

  include/sdhci.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/sdhci.h b/include/sdhci.h
index 6d52ce9..e84d2dc 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -214,6 +214,9 @@
  */
 #define SDHCI_QUIRK_32BIT_DMA_ADDR (1 << 0)
 
+/* to make gcc happy */
+struct sdhci_host;
+
 /*
  * Host SDMA buffer boundary. Valid values from 4K to 512K in powers of 2.
  */
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3 3/5] mmc: sdhci: add mmc structure for host

2011-10-08 Thread Lei Wen
Hi Sergei,

On Sat, Oct 8, 2011 at 9:52 PM, Sergei Shtylyov  wrote:
> Hello.
>
> On 08-10-2011 17:47, Lei Wen wrote:
>
>> So that sdhci host would tell in the driver that the mmc current
>> attributes.
>
>> Signed-off-by: Lei Wen
> [...]
>
>> diff --git a/include/sdhci.h b/include/sdhci.h
>> index e84d2dc..e4e7ebe 100644
>> --- a/include/sdhci.h
>> +++ b/include/sdhci.h
>> @@ -27,6 +27,7 @@
>>   #define __SDHCI_HW_H
>>
>>   #include
>> +#include
>
>    Why remove empty line here?
>

Thanks for pointing that out! I would repost which keep the empty line.

Best regards,
Lei
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: pantheon: enable dcache by default

2011-10-08 Thread Lei Wen
Hi Prafulla,

On Fri, Oct 7, 2011 at 11:53 AM, Prafulla Wadaskar  wrote:
>
>
>> -Original Message-
>> From: Lei Wen [mailto:lei...@marvell.com]
>> Sent: Wednesday, October 05, 2011 8:43 PM
>> To: Prafulla Wadaskar; u-boot@lists.denx.de
>> Subject: [PATCH] ARM: pantheon: enable dcache by default
>>
>> Marvell 88SV331xV5 has its specific arm cp15 opcode, which could
>
> I think this will be applicable to all SoC those fall under this core.
> So we should modify arch/arm/include/asm/cache.h for this.

I modify my original one patch into three small patch series.
And put the op code place as you suggested, please help re-check it.

>
>> flush out whole dcache by only one line of asm code.
>>
>> Signed-off-by: Lei Wen 
>> ---
>>  arch/arm/cpu/arm926ejs/pantheon/cpu.c |   14 ++
>>  1 files changed, 14 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/cpu/arm926ejs/pantheon/cpu.c
>> b/arch/arm/cpu/arm926ejs/pantheon/cpu.c
>> index 2d9c13a..8f94ea9 100644
>> --- a/arch/arm/cpu/arm926ejs/pantheon/cpu.c
>> +++ b/arch/arm/cpu/arm926ejs/pantheon/cpu.c
>> @@ -105,3 +105,17 @@ void i2c_clk_enable(void)
>>  {
>>  }
>>  #endif
>> +
>> +#ifndef CONFIG_SYS_DCACHE_OFF
>> +void enable_caches(void)
>> +{
>> +     /* Enable D-cache. I-cache is already enabled in start.S */
>> +     dcache_enable();
>> +}
>> +
>> +void  flush_cache(unsigned long start, unsigned long size)
>> +{
>> +     /* clean & invalidate all D cache */
>> +     asm("mcr p15, 0, %0, c7, c14, 0" : : "r" (0));
>> +}
>> +#endif
>
> Otherwise ack for this change

Thanks,
Lei
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] ARM: pantheon: enable dcache by default

2011-10-08 Thread Lei Wen
Signed-off-by: Lei Wen 
---
 arch/arm/cpu/arm926ejs/pantheon/cpu.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/pantheon/cpu.c 
b/arch/arm/cpu/arm926ejs/pantheon/cpu.c
index 8b2eafa..18da1c1 100644
--- a/arch/arm/cpu/arm926ejs/pantheon/cpu.c
+++ b/arch/arm/cpu/arm926ejs/pantheon/cpu.c
@@ -88,3 +88,11 @@ void i2c_clk_enable(void)
 {
 }
 #endif
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+void enable_caches(void)
+{
+   /* Enable D-cache. I-cache is already enabled in arch_cpu_init */
+   dcache_enable();
+}
+#endif
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/3] ARM: armada100: enable dcache by default

2011-10-08 Thread Lei Wen
Signed-off-by: Lei Wen 
---
 arch/arm/cpu/arm926ejs/armada100/cpu.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/armada100/cpu.c 
b/arch/arm/cpu/arm926ejs/armada100/cpu.c
index c21938e..47b764d 100644
--- a/arch/arm/cpu/arm926ejs/armada100/cpu.c
+++ b/arch/arm/cpu/arm926ejs/armada100/cpu.c
@@ -106,3 +106,11 @@ void i2c_clk_enable(void)
 {
 }
 #endif
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+void enable_caches(void)
+{
+   /* Enable D-cache. I-cache is already enabled in arch_cpu_init */
+   dcache_enable();
+}
+#endif
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/3] enable dcache for pantheon and armada100

2011-10-08 Thread Lei Wen
This patch seris use Marvell its own special op code to flush the dcache

Lei Wen (3):
  ARM: add special dcache flush op code for 88SV331xV5
  ARM: pantheon: enable dcache by default
  ARM: armada100: enable dcache by default

 arch/arm/cpu/arm926ejs/armada100/cpu.c |8 
 arch/arm/cpu/arm926ejs/pantheon/cpu.c  |8 
 arch/arm/lib/cache.c   |5 +
 3 files changed, 21 insertions(+), 0 deletions(-)

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] ARM: add special dcache flush op code for 88SV331xV5

2011-10-08 Thread Lei Wen
Marvell 88SV331xV5 has its specific arm cp15 opcode, which could
flush out whole dcache by only one line of asm code.

Signed-off-by: Lei Wen 
---
 arch/arm/lib/cache.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
index b545fb7..bfcbda4 100644
--- a/arch/arm/lib/cache.c
+++ b/arch/arm/lib/cache.c
@@ -33,11 +33,16 @@ void  __flush_cache(unsigned long start, unsigned long size)
arm1136_cache_flush();
 #endif
 #ifdef CONFIG_ARM926EJS
+#ifdef CONFIG_SHEEVA_88SV331xV5
+   /* clean & invalidate all D cache */
+   asm("mcr p15, 0, %0, c7, c14, 0" : : "r" (0));
+#else
/* test and clean, page 2-23 of arm926ejs manual */
asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
/* disable write buffer as well (page 2-22) */
asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
 #endif
+#endif
return;
 }
 void  flush_cache(unsigned long start, unsigned long size)
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 04/11] misc: pmic: addI2C support to pmic_fsl driver

2011-10-08 Thread Sergei Shtylyov
Hello.

On 08-10-2011 14:07, Stefano Babic wrote:

> Signed-off-by: Stefano Babic
> ---
>   drivers/misc/pmic_fsl.c |   18 ++
>   1 files changed, 14 insertions(+), 4 deletions(-)

> diff --git a/drivers/misc/pmic_fsl.c b/drivers/misc/pmic_fsl.c
> index 13dde47..2945dfb 100644
> --- a/drivers/misc/pmic_fsl.c
> +++ b/drivers/misc/pmic_fsl.c
[...]
> @@ -33,25 +34,34 @@ static u32 pmic_spi_prepare_tx(u32 reg, u32 *val, u32 
> write)
>   else
>   return (write<<  31) | (reg<<  25) | (*val&  0x00FF);
>   }
> +#endif
>
>   int pmic_init(void)
>   {
>   struct pmic *p = get_pmic();
>   static const char name[] = "FSL_PMIC";
>
> - puts("Board PMIC init\n");
> -
>   p->name = name;
> - p->interface = PMIC_SPI;
>   p->number_of_regs = PMIC_NUM_OF_REGS;
> - p->bus = CONFIG_FSL_PMIC_BUS;
>
> +#if defined(CONFIG_PMIC_SPI)
> + p->interface = PMIC_SPI;
> + p->bus = CONFIG_FSL_PMIC_BUS;
>   p->hw.spi.cs = CONFIG_FSL_PMIC_CS;
>   p->hw.spi.clk = CONFIG_FSL_PMIC_CLK;
>   p->hw.spi.mode = CONFIG_FSL_PMIC_MODE;
>   p->hw.spi.bitlen = CONFIG_FSL_PMIC_BITLEN;
>   p->hw.spi.flags = SPI_XFER_BEGIN | SPI_XFER_END;
>   p->hw.spi.prepare_tx = pmic_spi_prepare_tx;
> +#elif defined(CONFIG_PMIC_I2C)
> + p->interface = PMIC_SPI;
> + p->interface = PMIC_I2C;

You assign one value and immediately assign the other. First assignment 
shouldn't be here.

WBR, Sergei
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3 3/5] mmc: sdhci: add mmc structure for host

2011-10-08 Thread Sergei Shtylyov
Hello.

On 08-10-2011 17:47, Lei Wen wrote:

> So that sdhci host would tell in the driver that the mmc current
> attributes.

> Signed-off-by: Lei Wen
[...]

> diff --git a/include/sdhci.h b/include/sdhci.h
> index e84d2dc..e4e7ebe 100644
> --- a/include/sdhci.h
> +++ b/include/sdhci.h
> @@ -27,6 +27,7 @@
>   #define __SDHCI_HW_H
>
>   #include
> +#include

Why remove empty line here?

>   /*
>* Controller registers
>*/

WBR, Sergei
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3 4/5] mmc: sdhci: add timeout for data transfer

2011-10-08 Thread Lei Wen
Signed-off-by: Lei Wen 
---
Changelog:
V2: no change
V3: no change

 drivers/mmc/sdhci.c |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 31c738e..77a9e70 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -81,8 +81,9 @@ static void sdhci_transfer_pio(struct sdhci_host *host, 
struct mmc_data *data)
 static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
unsigned int start_addr)
 {
-   unsigned int stat, rdy, mask, block = 0;
+   unsigned int stat, rdy, mask, timeout, block = 0;
 
+   timeout = 1;
rdy = SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_AVAIL;
mask = SDHCI_DATA_AVAILABLE | SDHCI_SPACE_AVAILABLE;
do {
@@ -108,6 +109,12 @@ static int sdhci_transfer_data(struct sdhci_host *host, 
struct mmc_data *data,
sdhci_writel(host, start_addr, SDHCI_DMA_ADDRESS);
}
 #endif
+   if (timeout-- > 0)
+   udelay(10);
+   else {
+   printf("Transfer data timeout\n");
+   return -1;
+   }
} while (!(stat & SDHCI_INT_DATA_END));
return 0;
 }
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3 5/5] mmc: sdhci: fix sdma bug for large file transfer

2011-10-08 Thread Lei Wen
SDHCI spec need to reset the sdma base address while the software
try to accorss the 512k bytes address boundary. When meet such
accross behavior, sdhci controller would generate a interrupt
automatically, and software need handle this.

Signed-off-by: Lei Wen 
---
Changelog:
V2: no change
V3: new added fix for sdma bug

 drivers/mmc/sdhci.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 77a9e70..fce0ef0 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -104,7 +104,7 @@ static int sdhci_transfer_data(struct sdhci_host *host, 
struct mmc_data *data,
 #ifdef CONFIG_MMC_SDMA
if (stat & SDHCI_INT_DMA_END) {
sdhci_writel(host, SDHCI_INT_DMA_END, SDHCI_INT_STATUS);
-   start_addr &= SDHCI_DEFAULT_BOUNDARY_SIZE - 1;
+   start_addr &= ~(SDHCI_DEFAULT_BOUNDARY_SIZE - 1);
start_addr += SDHCI_DEFAULT_BOUNDARY_SIZE;
sdhci_writel(host, start_addr, SDHCI_DMA_ADDRESS);
}
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3 3/5] mmc: sdhci: add mmc structure for host

2011-10-08 Thread Lei Wen
So that sdhci host would tell in the driver that the mmc current
attributes.

Signed-off-by: Lei Wen 
---
Changelog:
V2: no change
V3: no change

 drivers/mmc/sdhci.c |1 +
 include/sdhci.h |2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 4a92453..31c738e 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -377,6 +377,7 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 
min_clk)
}
 
mmc->priv = host;
+   host->mmc = mmc;
 
sprintf(mmc->name, "%s", host->name);
mmc->send_cmd = sdhci_send_command;
diff --git a/include/sdhci.h b/include/sdhci.h
index e84d2dc..e4e7ebe 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -27,6 +27,7 @@
 #define __SDHCI_HW_H
 
 #include 
+#include 
 /*
  * Controller registers
  */
@@ -239,6 +240,7 @@ struct sdhci_host {
unsigned int quirks;
unsigned int version;
unsigned int clock;
+   struct mmc *mmc;
const struct sdhci_ops *ops;
 };
 
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3 2/5] mmc: sdhci: fix build warning

2011-10-08 Thread Lei Wen
If CONFIG_MMC_SDHCI_IO_ACCESSORS is defined, the following warning would
shows up:

include/sdhci.h:224: warning: 'struct sdhci_host' declared inside
parameter list
include/sdhci.h:224: warning: its scope is only this definition or
declaration, which is probably not what you want
include/sdhci.h:225: warning: 'struct sdhci_host' declared inside
parameter list
include/sdhci.h:226: warning: 'struct sdhci_host' declared inside
parameter list
include/sdhci.h:227: warning: 'struct sdhci_host' declared inside
parameter list
include/sdhci.h:228: warning: 'struct sdhci_host' declared inside
parameter list
include/sdhci.h:229: warning: 'struct sdhci_host' declared inside
parameter list

Signed-off-by: Lei Wen 
---
Changelog:
V2: code style change
V2.1: delete "Change-Id"
V3: no change

 include/sdhci.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/sdhci.h b/include/sdhci.h
index 6d52ce9..e84d2dc 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -214,6 +214,9 @@
  */
 #define SDHCI_QUIRK_32BIT_DMA_ADDR (1 << 0)
 
+/* to make gcc happy */
+struct sdhci_host;
+
 /*
  * Host SDMA buffer boundary. Valid values from 4K to 512K in powers of 2.
  */
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3 1/5] mmc: sdhci: fix cache flush

2011-10-08 Thread Lei Wen
Only flush the memory range needed.

Signed-off-by: Lei Wen 
---
Changelog:
V2: no change
V3: no change

 drivers/mmc/sdhci.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 9ebd33d..4a92453 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -196,7 +196,7 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 
sdhci_writel(host, cmd->cmdarg, SDHCI_ARGUMENT);
 #ifdef CONFIG_MMC_SDMA
-   flush_cache(0, ~0);
+   flush_cache(start_addr, trans_bytes);
 #endif
sdhci_writew(host, SDHCI_MAKE_CMD(cmd->cmdidx, flags), SDHCI_COMMAND);
do {
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3 0/5] fix and enhancement patches for sdhci

2011-10-08 Thread Lei Wen
This seris fix several issue like flush cache and build warning. And
give this generic driver enhancement for timeout when transferring data
and additional structure member to access in platform self driver.

Changelog:
V2: code style change.

V3: add another fix of sdma handling bug including in this series

Lei Wen (5):
  mmc: sdhci: fix cache flush
  mmc: sdhci: fix build warning
  mmc: sdhci: add mmc structure for host
  mmc: sdhci: add timeout for data transfer
  mmc: sdhci: fix sdma bug for large file transfer

 drivers/mmc/sdhci.c |   14 +++---
 include/sdhci.h |5 +
 2 files changed, 16 insertions(+), 3 deletions(-)

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/2] mmc: change magic number to macro define

2011-10-08 Thread Lei Wen
On Fri, Oct 7, 2011 at 4:36 PM, Prafulla Wadaskar  wrote:
>
>
>> -Original Message-
>> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
>> On Behalf Of Lei Wen
>> Sent: Thursday, October 06, 2011 8:41 PM
>> To: Marek Vasut
>> Cc: Lei Wen; u-boot@lists.denx.de; Andy Fleming
>> Subject: Re: [U-Boot] [PATCH V2 1/2] mmc: change magic number to macro
>> define
>>
>> Hi Marek,
>>
>> On Tue, Oct 4, 2011 at 8:07 PM, Marek Vasut 
>> wrote:
>> > On Tuesday, October 04, 2011 08:35:10 AM Lei Wen wrote:
>> >> Previous magic number is hard to parse its meaning, change it to
>> >> respective macro definition
>> >>
>> >> Signed-off-by: Lei Wen 
>> >
>> > [..]
>> >
>> >> --- a/include/mmc.h
>> >> +++ b/include/mmc.h
>> >> @@ -145,13 +145,15 @@
>> >>  /*
>> >>   * EXT_CSD fields
>> >>   */
>> >> -
>> >> -#define EXT_CSD_PART_CONF    179     /* R/W */
>> >> -#define EXT_CSD_BUS_WIDTH    183     /* R/W */
>> >> -#define EXT_CSD_HS_TIMING    185     /* R/W */
>> >> -#define EXT_CSD_CARD_TYPE    196     /* RO */
>> >> -#define EXT_CSD_REV          192     /* RO */
>> >> -#define EXT_CSD_SEC_CNT              212     /* RO, 4 bytes */
>> >> +#define EXT_CSD_PARTITIONING_SUPPORT 160     /* RO */
>> >> +#define EXT_CSD_ERASE_GROUP_DEF              175     /* R/W */
>> >> +#define EXT_CSD_PART_CONF            179     /* R/W */
>> >> +#define EXT_CSD_BUS_WIDTH            183     /* R/W */
>> >> +#define EXT_CSD_HS_TIMING            185     /* R/W */
>> >> +#define EXT_CSD_REV                  192     /* RO */
>> >> +#define EXT_CSD_CARD_TYPE            196     /* RO */
>> >> +#define EXT_CSD_SEC_CNT                      212     /* RO, 4 bytes
>> */
>> >> +#define EXT_CSD_HC_ERASE_GRP_SIZE    224     /* RO */
>> >>
>> >>  /*
>> >>   * EXT_CSD field definitions
>> >
>> > Hi Lei,
>> > this is better, but what about structure-based access ?
>> >
>> > struct somrthing {
>> >  u8 a1;
>> >  u8 a2;
>> > ...
>> > };
>> >
>> > Like this.
>> >
>> > Also, CC Andy.
>> >
>>
>> The ext_csd current usage in mmc.c is not too much, here I mean only few
>> of
>> the fields of the ext_csd is used, also fully definition of ext_csd
>> member would seems so huge a structure at its appearence...
>>
>> So macro may looks more concise and could parse from its meaning easily
>> enough.
>>
>> Anyway, more comments on this welcomes. :)
>
> Dear Lei
> Using c-struct is our strategy, may be full definition is huge, you may skip 
> them inserting padding in the c-struct.
>
> Regards..
> Prafulla . .
>

Ok... Got that.
I would send patch soon using the c style.

Thanks,
Lei
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/6] da850: add board specific functions

2011-10-08 Thread Laurence Withers
On Sat, Oct 08, 2011 at 02:58:32PM +0530, manjunath.ha...@ti.com wrote:
> There are two boards AM18xx and L138 both of which are based
> on da850 SOC. AM18xx boards have mac address stored in I2C
> EEPROM and they have spi flash manufactured by WINBOND. L138
> boards store mac address in SPI flash and they have SPI flash
> manufactured by ST Microelectronics.Due to these differences,
> instead of one config file, two config files are introduced
> to manage configs specific to board types.

Hi Manjunath,

Does this patchset touch SoC functionality, or just the board configs for the
EVMs? If the latter, it might be better to change the patch subject.
Otherwise it flags these patches as being relevant to anyone using the DA850
processor, which actually isn't the case from a quick read.

Bye for now,
-- 
Laurence Withers, http://www.guralp.com/
Direct tel:+447753988197 or tel:+44408643   Software Engineer
General support queries:  CMG-DCM CMG-EAM CMG-NAM
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 4/6] da850: revert cache disable patch

2011-10-08 Thread Laurence Withers
On Sat, Oct 08, 2011 at 02:58:36PM +0530, manjunath.ha...@ti.com wrote:
> revert commit bd65d006a6088bcb857e079447d7549e2cd7054d as the
> disabling of cache need not be done explicitly. Subsequent
> patches to new cache management framework has fixed it.
> EMAC issue with cache coherency still exists when cahces are
> enabled.

Hi Manjunath,

A small thing, but I'd recommend you drop the sentence "Subsequent patches to
new cache management framework has fixed it.", as it implies things were
broken (true) and are now fixed (still not true).

In fact, would it be better to simply drop this patch from the patch series
altogether, leaving the caches explicitly disabled, until such a time as the
EMAC driver is fixed (I guess we are mainly waiting to see if anyone wants to
tackle cache ops for the ARM926EJS) and the code has been verified with
caches enabled?

Bye for now,
-- 
Laurence Withers, http://www.guralp.com/
Direct tel:+447753988197 or tel:+44408643   Software Engineer
General support queries:  CMG-DCM CMG-EAM CMG-NAM
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V5 8/8] MX35: add support for flea3 board

2011-10-08 Thread Stefano Babic
The flea3 board is a custom board by CarMediaLab used
in automotive.
Network (FEC), NOR, NAND and SPI are supported.

Signed-off-by: Stefano Babic 
---

Changes since V4:
- boards.cfg maust have a new entry only for flea3 (Fabio Estevam)

Changes since V3:
- fix checkpatch warnings (Wolfgang Denk)

Changes since V2:
- put the board into manufacturer's directory  (CarMediaLab)

Changes since V1:
- add missing entry in MAINTAINERS (F. Estevam)

 MAINTAINERS |1 +
 board/CarMediaLab/flea3/Makefile|   49 ++
 board/CarMediaLab/flea3/flea3.c |  254 
 board/CarMediaLab/flea3/lowlevel_init.S |   79 +
 boards.cfg  |1 +
 include/configs/flea3.h |  281 +++
 6 files changed, 665 insertions(+), 0 deletions(-)
 create mode 100644 board/CarMediaLab/flea3/Makefile
 create mode 100644 board/CarMediaLab/flea3/flea3.c
 create mode 100644 board/CarMediaLab/flea3/lowlevel_init.S
 create mode 100644 include/configs/flea3.h

diff --git a/MAINTAINERS b/MAINTAINERS
index c10996c..24adb03 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -565,6 +565,7 @@ Albert ARIBAUD 
 Stefano Babic 
 
ea20davinci
+   flea3   i.MX35
mx35pdk i.MX35
mx51evk i.MX51
polaris xscale/pxa
diff --git a/board/CarMediaLab/flea3/Makefile b/board/CarMediaLab/flea3/Makefile
new file mode 100644
index 000..f5ad494
--- /dev/null
+++ b/board/CarMediaLab/flea3/Makefile
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2007, Guennadi Liakhovetski 
+#
+# (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, 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  := flea3.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+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 .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/CarMediaLab/flea3/flea3.c b/board/CarMediaLab/flea3/flea3.c
new file mode 100644
index 000..90201e3
--- /dev/null
+++ b/board/CarMediaLab/flea3/flea3.c
@@ -0,0 +1,254 @@
+/*
+ * Copyright (C) 2007, Guennadi Liakhovetski 
+ *
+ * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
+ *
+ * Copyright (C) 2011, Stefano Babic 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifndef CONFIG_BOARD_EARLY_INIT_F
+#error "CONFIG_BOARD_EARLY_INIT_F must be set for this board"
+#endif
+
+#define CCM_CCMR_CONFIG0x003F4208
+
+#define ESDCTL_DDR2_CONFIG 0x007FFC3F
+#define ESDCTL_0x9222  0x9222
+#define ESDCTL_0xA222  0xA222
+#define ESDCTL_0xB222  0xB222
+#define ESDCTL_0x82228080  0x82228080
+#define ESDCTL_DDR2_EMR2   0x0400
+#define ESDCTL_DDR2_EMR3   0x0600
+#define ESDCTL_PRECHARGE   0x0400
+#define ESDCTL_DDR2_EN_DLL 0x02000400
+#define ESDCTL_DDR2_R

Re: [U-Boot] [PATCH V4 8/8] MX35: add support for flea3 board

2011-10-08 Thread Stefano Babic
On 10/07/2011 04:23 AM, Fabio Estevam wrote:
> Hi Stefano,
> 
> On Thu, Oct 6, 2011 at 7:38 PM, Stefano Babic  wrote:
> 
>> --- a/boards.cfg
>> +++ b/boards.cfg
>> @@ -39,6 +39,11 @@ integratorcp_cm1136  arm arm1136 
>> integrator  armltd
>>  qong arm arm1136 -   
>> davedenx   mx31
>>  mx31ads  arm arm1136 -   
>> freescale  mx31
>>  imx31_litekitarm arm1136 -   
>> logicpdmx31
>> +imx31_phycorearm arm1136 -   -  
>> mx31
>> +imx31_phycore_eetarm arm1136 imx31_phycore   -  
>> mx31 imx31_phycore:IMX31_PHYCORE_EET
>> +mx31pdk_nand arm arm1136 mx31pdk 
>> freescale  mx31 mx31pdk:NAND_U_BOOT
>> +mx31pdk  arm arm1136 -   
>> freescale  mx31 mx31pdk:SKIP_LOWLEVEL_INIT
> 
> These mx31 changes should be part of a separate patch as they don´t
> relate to flea3 board support.

Ooopsss...patch for these changes is already in mainline, they do not
belong to this patchset. I drop them, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 02/11] MX5: efikamx/efikasb: use new pmic driver

2011-10-08 Thread Marek Vasut
On Saturday, October 08, 2011 12:06:59 PM Stefano Babic wrote:
> Switch to new pmic generic driver.
> 
> Signed-off-by: Stefano Babic 
> CC: Marek Vasut 
> ---

[...]

Hi Stefano,

> @@ -674,6 +676,7 @@ int board_late_init(void)
>  {
>   setup_iomux_spi();
> 
> + pmic_init();
>   power_init();

Can you move the pmic_init() to power_init(), it seems more logical.
Cheers
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 11/11] misc: pmic: drop old Freescale's pmic driver

2011-10-08 Thread Stefano Babic
Signed-off-by: Stefano Babic 
---
 drivers/misc/Makefile   |1 -
 drivers/misc/fsl_pmic.c |  235 ---
 2 files changed, 0 insertions(+), 236 deletions(-)
 delete mode 100644 drivers/misc/fsl_pmic.c

diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index f732a95..a709707 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -28,7 +28,6 @@ LIB   := $(obj)libmisc.o
 COBJS-$(CONFIG_ALI152X) += ali512x.o
 COBJS-$(CONFIG_DS4510)  += ds4510.o
 COBJS-$(CONFIG_FSL_LAW) += fsl_law.o
-COBJS-$(CONFIG_FSL_PMIC) += fsl_pmic.o
 COBJS-$(CONFIG_GPIO_LED) += gpio_led.o
 COBJS-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o
 COBJS-$(CONFIG_NS87308) += ns87308.o
diff --git a/drivers/misc/fsl_pmic.c b/drivers/misc/fsl_pmic.c
deleted file mode 100644
index 23255a5..000
--- a/drivers/misc/fsl_pmic.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
- *
- * 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 
-#include 
-#include 
-#include 
-#include 
-
-static int check_param(u32 reg, u32 write)
-{
-   if (reg > 63 || write > 1) {
-   printf(" = %d is invalid. Should be less then 63\n",
-   reg);
-   return -1;
-   }
-
-   return 0;
-}
-
-#ifdef CONFIG_FSL_PMIC_I2C
-#include 
-
-u32 pmic_reg(u32 reg, u32 val, u32 write)
-{
-   unsigned char buf[4] = { 0 };
-   u32 ret_val = 0;
-
-   if (check_param(reg, write))
-   return -1;
-
-   if (write) {
-   buf[0] = (val >> 16) & 0xff;
-   buf[1] = (val >> 8) & 0xff;
-   buf[2] = (val) & 0xff;
-   if (i2c_write(CONFIG_SYS_FSL_PMIC_I2C_ADDR, reg, 1, buf, 3))
-   return -1;
-   } else {
-   if (i2c_read(CONFIG_SYS_FSL_PMIC_I2C_ADDR, reg, 1, buf, 3))
-   return -1;
-   ret_val = buf[0] << 16 | buf[1] << 8 | buf[2];
-   }
-
-   return ret_val;
-}
-#else /* SPI interface */
-#include 
-static struct spi_slave *slave;
-
-struct spi_slave *pmic_spi_probe(void)
-{
-   return spi_setup_slave(CONFIG_FSL_PMIC_BUS,
-   CONFIG_FSL_PMIC_CS,
-   CONFIG_FSL_PMIC_CLK,
-   CONFIG_FSL_PMIC_MODE);
-}
-
-void pmic_spi_free(struct spi_slave *slave)
-{
-   if (slave)
-   spi_free_slave(slave);
-}
-
-u32 pmic_reg(u32 reg, u32 val, u32 write)
-{
-   u32 pmic_tx, pmic_rx;
-   u32 tmp;
-
-   if (!slave) {
-   slave = pmic_spi_probe();
-
-   if (!slave)
-   return -1;
-   }
-
-   if (check_param(reg, write))
-   return -1;
-
-   if (spi_claim_bus(slave))
-   return -1;
-
-   pmic_tx = (write << 31) | (reg << 25) | (val & 0x00FF);
-
-   tmp = cpu_to_be32(pmic_tx);
-
-   if (spi_xfer(slave, 4 << 3, &tmp, &pmic_rx,
-   SPI_XFER_BEGIN | SPI_XFER_END)) {
-   spi_release_bus(slave);
-   return -1;
-   }
-
-   if (write) {
-   pmic_tx &= ~(1 << 31);
-   tmp = cpu_to_be32(pmic_tx);
-   if (spi_xfer(slave, 4 << 3, &tmp, &pmic_rx,
-   SPI_XFER_BEGIN | SPI_XFER_END)) {
-   spi_release_bus(slave);
-   return -1;
-   }
-   }
-
-   spi_release_bus(slave);
-   return cpu_to_be32(pmic_rx);
-}
-#endif
-
-void pmic_reg_write(u32 reg, u32 value)
-{
-   pmic_reg(reg, value, 1);
-}
-
-u32 pmic_reg_read(u32 reg)
-{
-   return pmic_reg(reg, 0, 0);
-}
-
-void pmic_show_pmic_info(void)
-{
-   u32 rev_id;
-
-   rev_id = pmic_reg_read(REG_IDENTIFICATION);
-   printf("PMIC ID: 0x%08x [Rev: ", rev_id);
-   switch (rev_id & 0x1F) {
-   case 0x1:
-   puts("1.0");
-   break;
-   case 0x9:
-   puts("1.1");
-   break;
-   case 0xA:
-   puts("1.2");
-   break;
-   case 0x10:
-   puts("2.0");
-   break;
-   case 0x11:
-   puts("2.1");
-   break;
-   case 0x18:
-   puts("3.0");
-

[U-Boot] [PATCH 10/11] MX31: mx31pdk: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
CC: Fabio Estevam 
---
 include/configs/mx31pdk.h |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index cd156d8..08c06e1 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -70,11 +70,15 @@
 #define CONFIG_DEFAULT_SPI_BUS 1
 #define CONFIG_DEFAULT_SPI_MODE(SPI_MODE_0 | SPI_CS_HIGH)
 
-#define CONFIG_FSL_PMIC
+/* PMIC Controller */
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CONFIG_FSL_PMIC_BUS1
 #define CONFIG_FSL_PMIC_CS 2
 #define CONFIG_FSL_PMIC_CLK100
 #define CONFIG_FSL_PMIC_MODE   (SPI_MODE_0 | SPI_CS_HIGH)
+#define CONFIG_FSL_PMIC_BITLEN 32
 #define CONFIG_RTC_MC13783
 
 /* allow to overwrite serial and ethaddr */
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 09/11] MX31: mx31ads: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
CC: Fabio Estevam 
---
 include/configs/mx31ads.h |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/configs/mx31ads.h b/include/configs/mx31ads.h
index 0bea858..fcc5316 100644
--- a/include/configs/mx31ads.h
+++ b/include/configs/mx31ads.h
@@ -69,12 +69,16 @@
 #define CONFIG_DEFAULT_SPI_MODE(SPI_MODE_0 | SPI_CS_HIGH)
 #define CONFIG_MXC_GPIO
 
-#define CONFIG_FSL_PMIC
+/* PMIC Controller */
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CONFIG_FSL_PMIC_BUS1
 #define CONFIG_FSL_PMIC_CS 0
 #define CONFIG_FSL_PMIC_CLK100
 #define CONFIG_FSL_PMIC_MODE   (SPI_MODE_0 | SPI_CS_HIGH)
-#define CONFIG_RTC_MC13783 1
+#define CONFIG_FSL_PMIC_BITLEN 32
+#define CONFIG_RTC_MC13783
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 08/11] MX31: mx31_litekit: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
---
 include/configs/imx31_litekit.h |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h
index 5e976bc..65e301e 100644
--- a/include/configs/imx31_litekit.h
+++ b/include/configs/imx31_litekit.h
@@ -72,13 +72,16 @@
 #define CONFIG_DEFAULT_SPI_BUS 1
 #define CONFIG_DEFAULT_SPI_MODE(SPI_MODE_0 | SPI_CS_HIGH)
 
-#define CONFIG_FSL_PMIC
+/* PMIC Controller */
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CONFIG_FSL_PMIC_BUS1
 #define CONFIG_FSL_PMIC_CS 0
 #define CONFIG_FSL_PMIC_CLK100
 #define CONFIG_FSL_PMIC_MODE   (SPI_MODE_0 | SPI_CS_HIGH)
-
-#define CONFIG_RTC_MC13783 1
+#define CONFIG_FSL_PMIC_BITLEN 32
+#define CONFIG_RTC_MC13783
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 07/11] MX5: mx53evk: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
CC: Jason Liu 
---
 board/freescale/mx53evk/mx53evk.c |   15 +--
 include/configs/mx53evk.h |5 +++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/board/freescale/mx53evk/mx53evk.c 
b/board/freescale/mx53evk/mx53evk.c
index fd821c0..af0948f 100644
--- a/board/freescale/mx53evk/mx53evk.c
+++ b/board/freescale/mx53evk/mx53evk.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -124,12 +125,13 @@ static void setup_i2c(unsigned int port_number)
 void power_init(void)
 {
unsigned int val;
+   struct pmic *p = get_pmic();
 
/* Set VDDA to 1.25V */
-   val = pmic_reg_read(REG_SW_2);
+   pmic_reg_read(p, REG_SW_2, &val);
val &= ~SWX_OUT_MASK;
val |= SWX_OUT_1_25;
-   pmic_reg_write(REG_SW_2, val);
+   pmic_reg_write(p, REG_SW_2, val);
 
/*
 * Need increase VCC and VDDA to 1.3V
@@ -137,16 +139,16 @@ void power_init(void)
 */
if (is_soc_rev(CHIP_REV_2_0) == 0) {
/* Set VCC to 1.3V for TO2 */
-   val = pmic_reg_read(REG_SW_1);
+   pmic_reg_read(p, REG_SW_1, &val);
val &= ~SWX_OUT_MASK;
val |= SWX_OUT_1_30;
-   pmic_reg_write(REG_SW_1, val);
+   pmic_reg_write(p, REG_SW_1, val);
 
/* Set VDDA to 1.3V for TO2 */
-   val = pmic_reg_read(REG_SW_2);
+   pmic_reg_read(p, REG_SW_2, &val);
val &= ~SWX_OUT_MASK;
val |= SWX_OUT_1_30;
-   pmic_reg_write(REG_SW_2, val);
+   pmic_reg_write(p, REG_SW_2, val);
}
 }
 
@@ -364,6 +366,7 @@ int board_init(void)
 int board_late_init(void)
 {
setup_i2c(1);
+   pmic_init();
power_init();
 
return 0;
diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h
index b127b06..dfe07bf 100644
--- a/include/configs/mx53evk.h
+++ b/include/configs/mx53evk.h
@@ -59,8 +59,9 @@
 #define CONFIG_SYS_I2C_SLAVE0xfe
 
 /* PMIC Configs */
-#define CONFIG_FSL_PMIC
-#define CONFIG_FSL_PMIC_I2C
+#define CONFIG_PMIC
+#define CONFIG_PMIC_I2C
+#define CONFIG_PMIC_FSL
 #define CONFIG_SYS_FSL_PMIC_I2C_ADDR8
 
 /* MMC Configs */
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 06/11] MX5: mx51evk: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
---
 board/freescale/mx51evk/mx51evk.c |   45 +++-
 include/configs/mx51evk.h |6 -
 2 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/board/freescale/mx51evk/mx51evk.c 
b/board/freescale/mx51evk/mx51evk.c
index 8da1ee8..fe76e20 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -182,34 +183,35 @@ static void power_init(void)
 {
unsigned int val;
struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE;
+   struct pmic *p = get_pmic();
 
/* Write needed to Power Gate 2 register */
-   val = pmic_reg_read(REG_POWER_MISC);
+   pmic_reg_read(p, REG_POWER_MISC, &val);
val &= ~PWGT2SPIEN;
-   pmic_reg_write(REG_POWER_MISC, val);
+   pmic_reg_write(p, REG_POWER_MISC, val);
 
/* Externally powered */
-   val = pmic_reg_read(REG_CHARGE);
+   pmic_reg_read(p, REG_CHARGE, &val);
val |= ICHRG0 | ICHRG1 | ICHRG2 | ICHRG3 | CHGAUTOB;
-   pmic_reg_write(REG_CHARGE, val);
+   pmic_reg_write(p, REG_CHARGE, val);
 
/* power up the system first */
-   pmic_reg_write(REG_POWER_MISC, PWUP);
+   pmic_reg_write(p, REG_POWER_MISC, PWUP);
 
/* Set core voltage to 1.1V */
-   val = pmic_reg_read(REG_SW_0);
+   pmic_reg_read(p, REG_SW_0, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_100V;
-   pmic_reg_write(REG_SW_0, val);
+   pmic_reg_write(p, REG_SW_0, val);
 
/* Setup VCC (SW2) to 1.25 */
-   val = pmic_reg_read(REG_SW_1);
+   pmic_reg_read(p, REG_SW_1, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_250V;
-   pmic_reg_write(REG_SW_1, val);
+   pmic_reg_write(p, REG_SW_1, val);
 
/* Setup 1V2_DIG1 (SW3) to 1.25 */
-   val = pmic_reg_read(REG_SW_2);
+   pmic_reg_read(p, REG_SW_2, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_250V;
-   pmic_reg_write(REG_SW_2, val);
+   pmic_reg_write(p, REG_SW_2, val);
udelay(50);
 
/* Raise the core frequency to 800MHz */
@@ -217,36 +219,36 @@ static void power_init(void)
 
/* Set switchers in Auto in NORMAL mode & STANDBY mode */
/* Setup the switcher mode for SW1 & SW2*/
-   val = pmic_reg_read(REG_SW_4);
+   pmic_reg_read(p, REG_SW_4, &val);
val = (val & ~((SWMODE_MASK << SWMODE1_SHIFT) |
(SWMODE_MASK << SWMODE2_SHIFT)));
val |= (SWMODE_AUTO_AUTO << SWMODE1_SHIFT) |
(SWMODE_AUTO_AUTO << SWMODE2_SHIFT);
-   pmic_reg_write(REG_SW_4, val);
+   pmic_reg_write(p, REG_SW_4, val);
 
/* Setup the switcher mode for SW3 & SW4 */
-   val = pmic_reg_read(REG_SW_5);
+   pmic_reg_read(p, REG_SW_5, &val);
val = (val & ~((SWMODE_MASK << SWMODE3_SHIFT) |
(SWMODE_MASK << SWMODE4_SHIFT)));
val |= (SWMODE_AUTO_AUTO << SWMODE3_SHIFT) |
(SWMODE_AUTO_AUTO << SWMODE4_SHIFT);
-   pmic_reg_write(REG_SW_5, val);
+   pmic_reg_write(p, REG_SW_5, val);
 
/* Set VDIG to 1.65V, VGEN3 to 1.8V, VCAM to 2.6V */
-   val = pmic_reg_read(REG_SETTING_0);
+   pmic_reg_read(p, REG_SETTING_0, &val);
val &= ~(VCAM_MASK | VGEN3_MASK | VDIG_MASK);
val |= VDIG_1_65 | VGEN3_1_8 | VCAM_2_6;
-   pmic_reg_write(REG_SETTING_0, val);
+   pmic_reg_write(p, REG_SETTING_0, val);
 
/* Set VVIDEO to 2.775V, VAUDIO to 3V, VSD to 3.15V */
-   val = pmic_reg_read(REG_SETTING_1);
+   pmic_reg_read(p, REG_SETTING_1, &val);
val &= ~(VVIDEO_MASK | VSD_MASK | VAUDIO_MASK);
val |= VSD_3_15 | VAUDIO_3_0 | VVIDEO_2_775;
-   pmic_reg_write(REG_SETTING_1, val);
+   pmic_reg_write(p, REG_SETTING_1, val);
 
/* Configure VGEN3 and VCAM regulators to use external PNP */
val = VGEN3CONFIG | VCAMCONFIG;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
udelay(200);
 
gpio_direction_output(46, 0);
@@ -257,7 +259,7 @@ static void power_init(void)
/* Enable VGEN3, VCAM, VAUDIO, VVIDEO, VSD regulators */
val = VGEN3EN | VGEN3CONFIG | VCAMEN | VCAMCONFIG |
VVIDEOEN | VAUDIOEN  | VSDEN;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
 
udelay(500);
 
@@ -414,6 +416,7 @@ int board_late_init(void)
 {
 #ifdef CONFIG_MXC_SPI
setup_iomux_spi();
+   pmic_init();
power_init();
 #endif
return 0;
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index d62a4f2..6faaa6c 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -70,11 +70,15 @@
 
 #define CONFIG_MXC_SPI
 
-#define CONFIG_FSL_PMIC
+/* PMIC Controller */
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CO

[U-Boot] [PATCH 05/11] MX35: mx35pdk: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
---
 board/freescale/mx35pdk/mx35pdk.c |   18 --
 include/configs/mx35pdk.h |5 +++--
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/board/freescale/mx35pdk/mx35pdk.c 
b/board/freescale/mx35pdk/mx35pdk.c
index 9eefe5e..f6da51a 100644
--- a/board/freescale/mx35pdk/mx35pdk.c
+++ b/board/freescale/mx35pdk/mx35pdk.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -204,9 +205,10 @@ int board_init(void)
 
 static inline int pmic_detect(void)
 {
-   int id;
+   unsigned int id;
+   struct pmic *p = get_pmic();
 
-   id = pmic_reg_read(REG_IDENTIFICATION);
+   pmic_reg_read(p, REG_IDENTIFICATION, &id);
 
id = (id >> 6) & 0x7;
if (id == 0x7)
@@ -227,15 +229,19 @@ int board_late_init(void)
 {
u8 val;
u32 pmic_val;
+   struct pmic *p;
 
+   pmic_init();
if (pmic_detect()) {
+   p = get_pmic();
mxc_request_iomux(MX35_PIN_WATCHDOG_RST, MUX_CONFIG_SION |
MUX_CONFIG_ALT1);
 
-   pmic_val = pmic_reg_read(REG_SETTING_0);
-   pmic_reg_write(REG_SETTING_0, pmic_val | VO_1_30V | VO_1_50V);
-   pmic_val = pmic_reg_read(REG_MODE_0);
-   pmic_reg_write(REG_MODE_0, pmic_val | VGEN3EN);
+   pmic_reg_read(p, REG_SETTING_0, &pmic_val);
+   pmic_reg_write(p, REG_SETTING_0,
+   pmic_val | VO_1_30V | VO_1_50V);
+   pmic_reg_read(p, REG_MODE_0, &pmic_val);
+   pmic_reg_write(p, REG_MODE_0, pmic_val | VGEN3EN);
 
mxc_request_iomux(MX35_PIN_COMPARE, MUX_CONFIG_GPIO);
mxc_iomux_set_input(MUX_IN_GPIO1_IN_5, INPUT_CTL_PATH0);
diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h
index 4e9022d..946e64b 100644
--- a/include/configs/mx35pdk.h
+++ b/include/configs/mx35pdk.h
@@ -69,8 +69,9 @@
 /*
  * PMIC Configs
  */
-#define CONFIG_FSL_PMIC
-#define CONFIG_FSL_PMIC_I2C
+#define CONFIG_PMIC
+#define CONFIG_PMIC_I2C
+#define CONFIG_PMIC_FSL
 #define CONFIG_SYS_FSL_PMIC_I2C_ADDR   0x08
 
 /*
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 04/11] misc: pmic: addI2C support to pmic_fsl driver

2011-10-08 Thread Stefano Babic
Signed-off-by: Stefano Babic 
---
 drivers/misc/pmic_fsl.c |   18 ++
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/pmic_fsl.c b/drivers/misc/pmic_fsl.c
index 13dde47..2945dfb 100644
--- a/drivers/misc/pmic_fsl.c
+++ b/drivers/misc/pmic_fsl.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 
+#if defined(CONFIG_PMIC_SPI)
 static u32 pmic_spi_prepare_tx(u32 reg, u32 *val, u32 write)
 {
if ((val == NULL) && (write))
@@ -33,25 +34,34 @@ static u32 pmic_spi_prepare_tx(u32 reg, u32 *val, u32 write)
else
return (write << 31) | (reg << 25) | (*val & 0x00FF);
 }
+#endif
 
 int pmic_init(void)
 {
struct pmic *p = get_pmic();
static const char name[] = "FSL_PMIC";
 
-   puts("Board PMIC init\n");
-
p->name = name;
-   p->interface = PMIC_SPI;
p->number_of_regs = PMIC_NUM_OF_REGS;
-   p->bus = CONFIG_FSL_PMIC_BUS;
 
+#if defined(CONFIG_PMIC_SPI)
+   p->interface = PMIC_SPI;
+   p->bus = CONFIG_FSL_PMIC_BUS;
p->hw.spi.cs = CONFIG_FSL_PMIC_CS;
p->hw.spi.clk = CONFIG_FSL_PMIC_CLK;
p->hw.spi.mode = CONFIG_FSL_PMIC_MODE;
p->hw.spi.bitlen = CONFIG_FSL_PMIC_BITLEN;
p->hw.spi.flags = SPI_XFER_BEGIN | SPI_XFER_END;
p->hw.spi.prepare_tx = pmic_spi_prepare_tx;
+#elif defined(CONFIG_PMIC_I2C)
+   p->interface = PMIC_SPI;
+   p->interface = PMIC_I2C;
+   p->hw.i2c.addr = CONFIG_SYS_FSL_PMIC_I2C_ADDR;
+   p->hw.i2c.tx_num = 3;
+   p->bus = I2C_PMIC;
+#else
+#error "You must select CONFIG_PMIC_SPI or CONFIG_PMIC_I2C"
+#endif
 
return 0;
 }
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 03/11] I2c: add missing i2c_set_bus_num to mxc_i2c

2011-10-08 Thread Stefano Babic
The function i2c_set_bus_num() is used on most SOCs.
The driver does not support multiple I2C busses, and
an empty function is added to be compatible with general code
(example: PMIC driver).

Signed-off-by: Stefano Babic 
Cc: Heiko Schocher 
---
 drivers/i2c/mxc_i2c.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 2869d7c..de878ce 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -450,4 +450,9 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, 
int len)
 
return ret;
 }
+
+int i2c_set_bus_num(unsigned int bus)
+{
+   return 0;
+}
 #endif /* CONFIG_HARD_I2C */
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 02/11] MX5: efikamx/efikasb: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
CC: Marek Vasut 
---
 board/efikamx/efikamx.c   |   49 +++-
 include/configs/efikamx.h |5 +++-
 2 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c
index 0c4e24b..befb8ad 100644
--- a/board/efikamx/efikamx.c
+++ b/board/efikamx/efikamx.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -205,34 +206,35 @@ static void power_init(void)
 {
unsigned int val;
struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE;
+   struct pmic *p = get_pmic();
 
/* Write needed to Power Gate 2 register */
-   val = pmic_reg_read(REG_POWER_MISC);
+   pmic_reg_read(p, REG_POWER_MISC, &val);
val &= ~PWGT2SPIEN;
-   pmic_reg_write(REG_POWER_MISC, val);
+   pmic_reg_write(p, REG_POWER_MISC, val);
 
/* Externally powered */
-   val = pmic_reg_read(REG_CHARGE);
+   pmic_reg_read(p, REG_CHARGE, &val);
val |= ICHRG0 | ICHRG1 | ICHRG2 | ICHRG3 | CHGAUTOB;
-   pmic_reg_write(REG_CHARGE, val);
+   pmic_reg_write(p, REG_CHARGE, val);
 
/* power up the system first */
-   pmic_reg_write(REG_POWER_MISC, PWUP);
+   pmic_reg_write(p, REG_POWER_MISC, PWUP);
 
/* Set core voltage to 1.1V */
-   val = pmic_reg_read(REG_SW_0);
+   pmic_reg_read(p, REG_SW_0, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_100V;
-   pmic_reg_write(REG_SW_0, val);
+   pmic_reg_write(p, REG_SW_0, val);
 
/* Setup VCC (SW2) to 1.25 */
-   val = pmic_reg_read(REG_SW_1);
+   pmic_reg_read(p, REG_SW_1, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_250V;
-   pmic_reg_write(REG_SW_1, val);
+   pmic_reg_write(p, REG_SW_1, val);
 
/* Setup 1V2_DIG1 (SW3) to 1.25 */
-   val = pmic_reg_read(REG_SW_2);
+   pmic_reg_read(p, REG_SW_2, &val);
val = (val & ~SWx_VOLT_MASK) | SWx_1_250V;
-   pmic_reg_write(REG_SW_2, val);
+   pmic_reg_write(p, REG_SW_2, val);
udelay(50);
 
/* Raise the core frequency to 800MHz */
@@ -240,46 +242,46 @@ static void power_init(void)
 
/* Set switchers in Auto in NORMAL mode & STANDBY mode */
/* Setup the switcher mode for SW1 & SW2*/
-   val = pmic_reg_read(REG_SW_4);
+   pmic_reg_read(p, REG_SW_4, &val);
val = (val & ~((SWMODE_MASK << SWMODE1_SHIFT) |
(SWMODE_MASK << SWMODE2_SHIFT)));
val |= (SWMODE_AUTO_AUTO << SWMODE1_SHIFT) |
(SWMODE_AUTO_AUTO << SWMODE2_SHIFT);
-   pmic_reg_write(REG_SW_4, val);
+   pmic_reg_write(p, REG_SW_4, val);
 
/* Setup the switcher mode for SW3 & SW4 */
-   val = pmic_reg_read(REG_SW_5);
+   pmic_reg_read(p, REG_SW_5, &val);
val = (val & ~((SWMODE_MASK << SWMODE3_SHIFT) |
(SWMODE_MASK << SWMODE4_SHIFT)));
val |= (SWMODE_AUTO_AUTO << SWMODE3_SHIFT) |
(SWMODE_AUTO_AUTO << SWMODE4_SHIFT);
-   pmic_reg_write(REG_SW_5, val);
+   pmic_reg_write(p, REG_SW_5, val);
 
/* Set VDIG to 1.65V, VGEN3 to 1.8V, VCAM to 2.6V */
-   val = pmic_reg_read(REG_SETTING_0);
+   pmic_reg_read(p, REG_SETTING_0, &val);
val &= ~(VCAM_MASK | VGEN3_MASK | VDIG_MASK);
val |= VDIG_1_65 | VGEN3_1_8 | VCAM_2_6;
-   pmic_reg_write(REG_SETTING_0, val);
+   pmic_reg_write(p, REG_SETTING_0, val);
 
/* Set VVIDEO to 2.775V, VAUDIO to 3V, VSD to 3.15V */
-   val = pmic_reg_read(REG_SETTING_1);
+   pmic_reg_read(p, REG_SETTING_1, &val);
val &= ~(VVIDEO_MASK | VSD_MASK | VAUDIO_MASK);
val |= VSD_3_15 | VAUDIO_3_0 | VVIDEO_2_775;
-   pmic_reg_write(REG_SETTING_1, val);
+   pmic_reg_write(p, REG_SETTING_1, val);
 
/* Configure VGEN3 and VCAM regulators to use external PNP */
val = VGEN3CONFIG | VCAMCONFIG;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
udelay(200);
 
/* Enable VGEN3, VCAM, VAUDIO, VVIDEO, VSD regulators */
val = VGEN3EN | VGEN3CONFIG | VCAMEN | VCAMCONFIG |
VVIDEOEN | VAUDIOEN  | VSDEN;
-   pmic_reg_write(REG_MODE_1, val);
+   pmic_reg_write(p, REG_MODE_1, val);
 
-   val = pmic_reg_read(REG_POWER_CTL2);
+   pmic_reg_read(p, REG_POWER_CTL2, &val);
val |= WDIRESET;
-   pmic_reg_write(REG_POWER_CTL2, val);
+   pmic_reg_write(p, REG_POWER_CTL2, val);
 
udelay(2500);
 }
@@ -674,6 +676,7 @@ int board_late_init(void)
 {
setup_iomux_spi();
 
+   pmic_init();
power_init();
 
setup_iomux_led();
diff --git a/include/configs/efikamx.h b/include/configs/efikamx.h
index 54f48e4..7e4b424 100644
--- a/include/configs/efikamx.h
+++ b/include/configs/efikamx.h
@@ -124,11 +124,14 @@
 #endif
 
 /* SPI PMIC */
-#define CONFIG_FSL_PMIC
+#define CONFIG_PMIC
+#defin

[U-Boot] [PATCH 01/11] MX3: qong: use new pmic driver

2011-10-08 Thread Stefano Babic
Switch to new pmic generic driver.

Signed-off-by: Stefano Babic 
---
 board/davedenx/qong/qong.c |   11 ---
 include/configs/qong.h |5 -
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/board/davedenx/qong/qong.c b/board/davedenx/qong/qong.c
index 9fca1f8..a9f2ef0 100644
--- a/board/davedenx/qong/qong.c
+++ b/board/davedenx/qong/qong.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "qong_fpga.h"
@@ -176,11 +177,15 @@ int board_init (void)
 int board_late_init(void)
 {
u32 val;
+   struct pmic *p;
+
+   pmic_init();
+   p = get_pmic();
 
/* Enable RTC battery */
-   val = pmic_reg_read(REG_POWER_CTL0);
-   pmic_reg_write(REG_POWER_CTL0, val | COINCHEN);
-   pmic_reg_write(REG_INT_STATUS1, RTCRSTI);
+   pmic_reg_read(p, REG_POWER_CTL0, &val);
+   pmic_reg_write(p, REG_POWER_CTL0, val | COINCHEN);
+   pmic_reg_write(p, REG_INT_STATUS1, RTCRSTI);
 
 #ifdef CONFIG_HW_WATCHDOG
mxc_hw_watchdog_enable();
diff --git a/include/configs/qong.h b/include/configs/qong.h
index 78b3701..ec99021 100644
--- a/include/configs/qong.h
+++ b/include/configs/qong.h
@@ -60,11 +60,14 @@
 #define CONFIG_DEFAULT_SPI_MODE(SPI_MODE_0 | SPI_CS_HIGH)
 #define CONFIG_RTC_MC13783
 
-#define CONFIG_FSL_PMIC
+#define CONFIG_PMIC
+#define CONFIG_PMIC_SPI
+#define CONFIG_PMIC_FSL
 #define CONFIG_FSL_PMIC_BUS1
 #define CONFIG_FSL_PMIC_CS 0
 #define CONFIG_FSL_PMIC_CLK10
 #define CONFIG_FSL_PMIC_MODE   (SPI_MODE_0 | SPI_CS_HIGH)
+#define CONFIG_FSL_PMIC_BITLEN 32
 
 /* FPGA */
 #define CONFIG_FPGA
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] switch to generic PMIX driver for i.MX boards

2011-10-08 Thread Stefano Babic
This patchset is based on Łukasz Majewski's patches that
introduce a generic PMIC (Power Microcontroller) driver:

http://patchwork.ozlabs.org/patch/117565/
http://patchwork.ozlabs.org/patch/117563/
http://patchwork.ozlabs.org/patch/117818/
http://patchwork.ozlabs.org/patch/118071/

The patchset replaced the old driver used on i.MX boards
(Freescale PMIC) and switches to the new generic driver.

 board/davedenx/qong/qong.c|   11 ++-
 board/efikamx/efikamx.c   |   49 
 board/freescale/mx35pdk/mx35pdk.c |   18 ++-
 board/freescale/mx51evk/mx51evk.c |   45 
 board/freescale/mx53evk/mx53evk.c |   15 ++-
 board/ttcontrol/vision2/vision2.c |   31 +++---
 drivers/i2c/mxc_i2c.c |5 +
 drivers/misc/Makefile |2 +-
 drivers/misc/fsl_pmic.c   |  235 -
 drivers/misc/pmic_fsl.c   |   67 +++
 drivers/rtc/mc13783-rtc.c |   20 ++--
 include/configs/efikamx.h |5 +-
 include/configs/imx31_litekit.h   |9 +-
 include/configs/mx31ads.h |8 +-
 include/configs/mx31pdk.h |6 +-
 include/configs/mx35pdk.h |5 +-
 include/configs/mx51evk.h |6 +-
 include/configs/mx53evk.h |5 +-
 include/configs/qong.h|5 +-
 include/configs/vision2.h |5 +-
 include/fsl_pmic.h|5 +-
 21 files changed, 222 insertions(+), 335 deletions(-)

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] da830: add support for NAND boot mode

2011-10-08 Thread manjunath.hadli
From: Manjunath Hadli 

Add support for enabling NAND boot mode in configuration file and
add correspanding pinmux support, nand initialize function in board file.
The size required for environment variables not more than 10KB
the CONFIG_ENV_SIZE is set to 10KB from (512 << 10).

Acked-by: Nick Thompson 
Signed-off-by: Sudhakar Rajashekhara 
Signed-off-by: Manjunath Hadli 
---
 board/davinci/da8xxevm/da830evm.c |   63 +
 include/configs/da830evm.h|4 ++-
 2 files changed, 66 insertions(+), 1 deletions(-)

diff --git a/board/davinci/da8xxevm/da830evm.c 
b/board/davinci/da8xxevm/da830evm.c
index 0650653..2021e73 100644
--- a/board/davinci/da8xxevm/da830evm.c
+++ b/board/davinci/da8xxevm/da830evm.c
@@ -40,6 +40,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -98,6 +100,56 @@ static const struct pinmux_config i2c_pins[] = {
{ pinmux(8), 2, 4 }
 };
 
+#ifdef CONFIG_USE_NAND
+/* NAND pin muxer settings */
+const struct pinmux_config aemif_pins[] = {
+   { pinmux(13), 1, 6 },
+   { pinmux(13), 1, 7 },
+   { pinmux(14), 1, 0 },
+   { pinmux(14), 1, 1 },
+   { pinmux(14), 1, 2 },
+   { pinmux(14), 1, 3 },
+   { pinmux(14), 1, 4 },
+   { pinmux(14), 1, 5 },
+   { pinmux(14), 1, 6 },
+   { pinmux(14), 1, 7 },
+   { pinmux(15), 1, 0 },
+   { pinmux(15), 1, 1 },
+   { pinmux(15), 1, 2 },
+   { pinmux(15), 1, 3 },
+   { pinmux(15), 1, 4 },
+   { pinmux(15), 1, 5 },
+   { pinmux(15), 1, 6 },
+   { pinmux(15), 1, 7 },
+   { pinmux(16), 1, 0 },
+   { pinmux(16), 1, 1 },
+   { pinmux(16), 1, 2 },
+   { pinmux(16), 1, 3 },
+   { pinmux(16), 1, 4 },
+   { pinmux(16), 1, 5 },
+   { pinmux(16), 1, 6 },
+   { pinmux(16), 1, 7 },
+   { pinmux(17), 1, 0 },
+   { pinmux(17), 1, 1 },
+   { pinmux(17), 1, 2 },
+   { pinmux(17), 1, 3 },
+   { pinmux(17), 1, 4 },
+   { pinmux(17), 1, 5 },
+   { pinmux(17), 1, 6 },
+   { pinmux(17), 1, 7 },
+   { pinmux(18), 1, 0 },
+   { pinmux(18), 1, 1 },
+   { pinmux(18), 1, 2 },
+   { pinmux(18), 1, 3 },
+   { pinmux(18), 1, 4 },
+   { pinmux(18), 1, 5 },
+   { pinmux(18), 1, 6 },
+   { pinmux(18), 1, 7 },
+   { pinmux(10), 1, 0 }
+};
+#endif
+
+
 /* USB0_DRVVBUS pin muxer settings */
 static const struct pinmux_config usb_pins[] = {
{ pinmux(9), 1, 1 }
@@ -114,6 +166,7 @@ static const struct pinmux_resource pinmuxes[] = {
 #endif
 #ifdef CONFIG_USE_NAND
PINMUX_ITEM(emifa_nand_pins),
+   PINMUX_ITEM(aemif_pins),
 #endif
 #if defined(CONFIG_DRIVER_TI_EMAC)
PINMUX_ITEM(emac_pins),
@@ -184,6 +237,16 @@ int board_init(void)
return(0);
 }
 
+
+#ifdef CONFIG_NAND_DAVINCI
+int board_nand_init(struct nand_chip *nand)
+{
+   davinci_nand_init(nand);
+
+   return 0;
+}
+#endif
+
 #if defined(CONFIG_DRIVER_TI_EMAC)
 
 #define PHY_SW_I2C_ADDR0x5f /* Address of PHY on i2c bus */
diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 66fdea2..daaeada 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -106,8 +106,10 @@
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_ENV_IS_IN_NAND  /* U-Boot env in NAND Flash  */
 #define CONFIG_ENV_OFFSET  (512 << 10)
-#define CONFIG_ENV_SIZE(512 << 10)
+#define CONFIG_ENV_SIZE(10 << 10) /* 10KB */
+#define CONFIG_SYS_NAND_USE_FLASH_BBT
 #define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
+#define CONFIG_SYS_NAND_PAGE_2K
 #define CONFIG_SYS_NAND_CS 3
 #define CONFIG_SYS_NAND_BASE   DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
 #define CONFIG_SYS_NAND_PAGE_2K
-- 
1.6.2.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] dm36x: revert cache disable patch

2011-10-08 Thread manjunath.hadli
From: Manjunath Hadli 

revert commit 98c19aff9524e1d0dd6bf39bf7bde5644f121feb as the
disabling of cache need not be done explicitly. Subsequent
patches to new cache management framework has fixed it.
EMAC issue with cache coherency still exists when cahces are
enabled.

Signed-off-by: Manjunath Hadli 
---
 include/configs/davinci_dm365evm.h |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/include/configs/davinci_dm365evm.h 
b/include/configs/davinci_dm365evm.h
index 28b9db9..3380948 100644
--- a/include/configs/davinci_dm365evm.h
+++ b/include/configs/davinci_dm365evm.h
@@ -33,9 +33,6 @@
 #define CONFIG_SYS_HZ_CLOCK2400/* timer0 freq */
 #define CONFIG_SYS_HZ  1000
 #define CONFIG_SOC_DM365
-#define CONFIG_SYS_ICACHE_OFF
-#define CONFIG_SYS_DCACHE_OFF
-#define CONFIG_SYS_L2CACHE_OFF
 
 /* Memory Info */
 #define CONFIG_NR_DRAM_BANKS   1
-- 
1.6.2.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] dm644X: revert cache disable patch

2011-10-08 Thread manjunath.hadli
From: Manjunath Hadli 

revert commit 913a39e9aa4d935948d41cd727d53f5878414a77 as the
disabling of cache need not be done explicitly. Subsequent
patches to new cache management framework has fixed it.
EMAC issue with cache coherency still exists when cahces are
enabled.

Signed-off-by: Manjunath Hadli 
---
 include/configs/davinci_dvevm.h |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/include/configs/davinci_dvevm.h b/include/configs/davinci_dvevm.h
index 2e56501..4742658 100644
--- a/include/configs/davinci_dvevm.h
+++ b/include/configs/davinci_dvevm.h
@@ -59,9 +59,6 @@
 #define CONFIG_SYS_HZ_CLOCK2700/* Timer Input clock 
freq */
 #define CONFIG_SYS_HZ  1000
 #define CONFIG_SOC_DM644X
-#define CONFIG_SYS_ICACHE_OFF
-#define CONFIG_SYS_DCACHE_OFF
-#define CONFIG_SYS_L2CACHE_OFF
 /**/
 /* EEPROM definitions for Atmel 24C256BN SEEPROM chip */
 /* on Sonata/DV_EVM board. No EEPROM on schmoogie.*/
-- 
1.6.2.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 2/6] da850: rename config file to represent OMAP-L138

2011-10-08 Thread manjunath.hadli
From: Manjunath Hadli 

rename config file da850evm.h as da850_l138evm.h to represent omap
l138 board based on da850 SOC. L138 boards dont have WINBOND SPI
flash, corresponding config is removed. Appropriate changes are made
in boards.cfg for building.

Signed-off-by: Manjunath Hadli 
---
 boards.cfg  |2 +-
 include/configs/da850_l138evm.h |  248 ++
 include/configs/da850evm.h  |  249 ---
 3 files changed, 249 insertions(+), 250 deletions(-)
 create mode 100644 include/configs/da850_l138evm.h
 delete mode 100644 include/configs/da850evm.h

diff --git a/boards.cfg b/boards.cfg
index 5f7b25c..fcc0712 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -115,7 +115,7 @@ pm9261   arm arm926ejs   pm9261 
 ronetix
 pm9263   arm arm926ejs   pm9263  
ronetixat91pm9263:AT91SAM9263
 pm9g45   arm arm926ejs   pm9g45  
ronetixat91pm9g45:AT91SAM9G45
 da830evm arm arm926ejs   da8xxevm
davincidavinci
-da850evm arm arm926ejs   da8xxevm
davincidavinci
+da850_l138evmarm arm926ejs   da8xxevm
davincidavinci
 da850_am18xxevm  arm arm926ejs   da8xxevm
davincidavinci
 hawkboardarm arm926ejs   da8xxevm
davincidavinci
 hawkboard_nand   arm arm926ejs   da8xxevm
davincidavinci hawkboard:NAND_U_BOOT
diff --git a/include/configs/da850_l138evm.h b/include/configs/da850_l138evm.h
new file mode 100644
index 000..347893c
--- /dev/null
+++ b/include/configs/da850_l138evm.h
@@ -0,0 +1,248 @@
+/*
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Based on davinci_dvevm.h. Original Copyrights follow:
+ *
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * Board
+ */
+#define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_USE_SPIFLASH
+
+
+/*
+ * SoC Configuration
+ */
+#define CONFIG_MACH_DAVINCI_DA850_EVM
+#define CONFIG_ARM926EJS   /* arm926ejs CPU core */
+#define CONFIG_SOC_DA8XX   /* TI DA8xx SoC */
+#define CONFIG_SYS_CLK_FREQclk_get(DAVINCI_ARM_CLKID)
+#define CONFIG_SYS_OSCIN_FREQ  2400
+#define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE
+#define CONFIG_SYS_HZ_CLOCKclk_get(DAVINCI_AUXCLK_CLKID)
+#define CONFIG_SYS_HZ  1000
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SYS_TEXT_BASE   0xc108
+#define CONFIG_SYS_ICACHE_OFF
+#define CONFIG_SYS_DCACHE_OFF
+#define CONFIG_SYS_L2CACHE_OFF
+
+/*
+ * Memory Info
+ */
+#define CONFIG_SYS_MALLOC_LEN  (0x1 + 1*1024*1024) /* malloc() len */
+#define PHYS_SDRAM_1   DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
+#define PHYS_SDRAM_1_SIZE  (64 << 20) /* SDRAM size 64MB */
+#define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
+
+/* memtest start addr */
+#define CONFIG_SYS_MEMTEST_START   (PHYS_SDRAM_1 + 0x200)
+
+/* memtest will be run on 16MB */
+#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x200 + 16*1024*1024)
+
+#define CONFIG_NR_DRAM_BANKS   1 /* we have 1 bank of DRAM */
+#define CONFIG_STACKSIZE   (256*1024) /* regular stack */
+
+/*
+ * Serial Driver info
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size */
+#define CONFIG_SYS_NS16550_COM1DAVINCI_UART2_BASE /* Base address of 
UART2 */
+#define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
+#define CONFIG_CONS_INDEX  1   /* use UART0 for console */
+#define CONFIG_BAUDRATE115200  /* Default baud rate */
+#define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
+
+#define CONFIG_SPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_DAVINCI_SPI
+#define CONFIG_SYS_SPI_BASEDAVINCI_SPI1_BASE
+#define CONFIG_SYS_SPI_CLK 

[U-Boot] [PATCH v2 5/6] da850: add support to read mac address from spi flash

2011-10-08 Thread manjunath.hadli
From: Manjunath Hadli 

add support to read mac address from spi flash if env variable
is not set. This is supported only on L138 boards based on da850
SOC. Introduced a macro CONFIG_MAC_ADDR_IN_SPIFLASH indicating
where to look mac address for.

Signed-off-by: Manjunathappa, Prakash 
Signed-off-by: Manjunath Hadli 
---
 board/davinci/da8xxevm/da850evm.c |   59 +
 include/configs/da850_l138evm.h   |1 +
 2 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 29cee37..e5f5b3a 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -25,10 +25,13 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -166,6 +169,44 @@ const struct pinmux_config nor_pins[] = {
 #endif
 #endif /* CONFIG_DRIVER_TI_EMAC */
 
+#define CFG_MAC_ADDR_SPI_BUS   0
+#define CFG_MAC_ADDR_SPI_CS0
+#define CFG_MAC_ADDR_SPI_MAX_HZCONFIG_SF_DEFAULT_SPEED
+#define CFG_MAC_ADDR_SPI_MODE  SPI_MODE_3
+
+#define CFG_MAC_ADDR_OFFSET(flash->size - SZ_64K)
+
+#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
+static int get_mac_addr(u8 *addr)
+{
+   struct spi_flash *flash;
+   int ret;
+
+
+   flash = spi_flash_probe(CFG_MAC_ADDR_SPI_BUS, CFG_MAC_ADDR_SPI_CS,
+   CFG_MAC_ADDR_SPI_MAX_HZ, CFG_MAC_ADDR_SPI_MODE);
+   if (!flash) {
+   printf(" Error - unable to probe SPI flash.\n");
+   ret = -1;
+   goto err_probe;
+   }
+
+   ret = spi_flash_read(flash, CFG_MAC_ADDR_OFFSET, 6, addr);
+   if (ret) {
+   printf("Error - unable to read MAC address from SPI flash.\n");
+   goto err_read;
+   }
+
+err_read:
+   /* cannot call free currently since the free function calls free() for
+* spi_flash structure though it is not directly allocated through
+* malloc()
+*/
+err_probe:
+   return ret;
+}
+#endif
+
 void dsp_lpsc_on(unsigned domain, unsigned int id)
 {
dv_reg_p mdstat, mdctl, ptstat, ptcmd;
@@ -220,7 +261,25 @@ static void dspwake(void)
 
 int misc_init_r(void)
 {
+   uchar buff[8];
+   int ret;
+
dspwake();
+
+#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
+   if (!eth_getenv_enetaddr("ethaddr", buff)) {
+   ret = get_mac_addr(buff);
+   if (ret != 0)
+   return -EINVAL;
+
+   if (!is_valid_ether_addr(buff)) {
+   printf("Invalid MAC address read.\n");
+   return -EINVAL;
+   }
+
+   eth_setenv_enetaddr("ethaddr", buff);
+   }
+#endif
return 0;
 }
 
diff --git a/include/configs/da850_l138evm.h b/include/configs/da850_l138evm.h
index 0bd630f..9e4a652 100644
--- a/include/configs/da850_l138evm.h
+++ b/include/configs/da850_l138evm.h
@@ -172,6 +172,7 @@
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_CRC32_VERIFY
 #define CONFIG_MX_CYCLIC
+#define CONFIG_MAC_ADDR_IN_SPIFLASH
 
 /*
  * Linux Information
-- 
1.6.2.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 3/6] da850: pass board revision info to kernel

2011-10-08 Thread manjunath.hadli
From: Manjunath Hadli 

there are two boards based on da850 SOC - OMAP-L138 and AM18xx.
In order to differentiate between these two boards, revision id
is passed to kernel via second byte of ATAG_REVISION.

Signed-off-by: Manjunathappa, Prakash 
Signed-off-by: Manjunath Hadli 
---
 board/davinci/da8xxevm/da850evm.c |6 +-
 include/configs/da850_am18xxevm.h |1 +
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 46924d3..29cee37 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -249,6 +249,8 @@ static const struct lpsc_resource lpsc[] = {
 #define CONFIG_DA850_EVM_MAX_CPU_CLK   3
 #endif
 
+#define REV_AM18XX_EVM 0x100
+
 /*
  * get_board_rev() - setup to pass kernel board revision information
  * Returns:
@@ -274,7 +276,9 @@ u32 get_board_rev(void)
rev = 2;
else if (maxcpuclk >= 37200)
rev = 1;
-
+#ifdef CONFIG_DA850_AM18XX_EVM
+   rev |= REV_AM18XX_EVM;
+#endif
return rev;
 }
 
diff --git a/include/configs/da850_am18xxevm.h 
b/include/configs/da850_am18xxevm.h
index 92b83ff..29d580b 100644
--- a/include/configs/da850_am18xxevm.h
+++ b/include/configs/da850_am18xxevm.h
@@ -43,6 +43,7 @@
 #define CONFIG_SYS_HZ  1000
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SYS_TEXT_BASE   0xc108
+#define CONFIG_DA850_AM18XX_EVM
 
 /*
  * Memory Info
-- 
1.6.2.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/6] da850: add new config file for AM18xx

2011-10-08 Thread manjunath.hadli
From: Manjunath Hadli 

add new configuration file da850_am18xxevm.h for AM18xx boards
which are based on da850 SOC. AM18xx has WINBOND spi flash which
is indicated in the config file. And make appropriate changes in
board.cfg for building.

Signed-off-by: Manjunath Hadli 
---
 boards.cfg|1 +
 include/configs/da850_am18xxevm.h |  245 +
 2 files changed, 246 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/da850_am18xxevm.h

diff --git a/boards.cfg b/boards.cfg
index b1be62e..5f7b25c 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -116,6 +116,7 @@ pm9263   arm arm926ejs   pm9263 
 ronetix
 pm9g45   arm arm926ejs   pm9g45  
ronetixat91pm9g45:AT91SAM9G45
 da830evm arm arm926ejs   da8xxevm
davincidavinci
 da850evm arm arm926ejs   da8xxevm
davincidavinci
+da850_am18xxevm  arm arm926ejs   da8xxevm
davincidavinci
 hawkboardarm arm926ejs   da8xxevm
davincidavinci
 hawkboard_nand   arm arm926ejs   da8xxevm
davincidavinci hawkboard:NAND_U_BOOT
 hawkboard_uart   arm arm926ejs   da8xxevm
davincidavinci hawkboard:UART_U_BOOT
diff --git a/include/configs/da850_am18xxevm.h 
b/include/configs/da850_am18xxevm.h
new file mode 100644
index 000..92b83ff
--- /dev/null
+++ b/include/configs/da850_am18xxevm.h
@@ -0,0 +1,245 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Based on davinci_dvevm.h. Original Copyrights follow:
+ *
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * Board
+ */
+#define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_USE_SPIFLASH
+
+
+/*
+ * SoC Configuration
+ */
+#define CONFIG_MACH_DAVINCI_DA850_EVM
+#define CONFIG_ARM926EJS   /* arm926ejs CPU core */
+#define CONFIG_SOC_DA8XX   /* TI DA8xx SoC */
+#define CONFIG_SYS_CLK_FREQclk_get(DAVINCI_ARM_CLKID)
+#define CONFIG_SYS_OSCIN_FREQ  2400
+#define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE
+#define CONFIG_SYS_HZ_CLOCKclk_get(DAVINCI_AUXCLK_CLKID)
+#define CONFIG_SYS_HZ  1000
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SYS_TEXT_BASE   0xc108
+
+/*
+ * Memory Info
+ */
+#define CONFIG_SYS_MALLOC_LEN  (0x1 + 1*1024*1024) /* malloc() len */
+#define PHYS_SDRAM_1   DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
+#define PHYS_SDRAM_1_SIZE  (64 << 20) /* SDRAM size 64MB */
+#define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
+
+/* memtest start addr */
+#define CONFIG_SYS_MEMTEST_START   (PHYS_SDRAM_1 + 0x200)
+
+/* memtest will be run on 16MB */
+#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x200 + 16*1024*1024)
+
+#define CONFIG_NR_DRAM_BANKS   1 /* we have 1 bank of DRAM */
+#define CONFIG_STACKSIZE   (256*1024) /* regular stack */
+
+/*
+ * Serial Driver info
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size */
+#define CONFIG_SYS_NS16550_COM1DAVINCI_UART2_BASE /* Base address of 
UART2 */
+#define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
+#define CONFIG_CONS_INDEX  1   /* use UART0 for console */
+#define CONFIG_BAUDRATE115200  /* Default baud rate */
+#define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
+
+#define CONFIG_SPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_WINBOND
+#define CONFIG_DAVINCI_SPI
+#define CONFIG_SYS_SPI_BASEDAVINCI_SPI1_BASE
+#define CONFIG_SYS_SPI_CLK clk_get(DAVINCI_SPI1_CLKID)
+#define CONFIG_SF_DEFAULT_SPEED3000
+#define CONFIG_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
+
+/*
+ * I2C Configuration
+ */
+#define CONFIG_HARD_I2C
+#define CONFIG_DRIVER_DAVINCI_I2C
+#define CONFIG_SYS_I2C_SPEED   25000
+#define CONFIG_SYS_I2C_SLAVE  

[U-Boot] [PATCH v2 0/6] da850: add board specific functions

2011-10-08 Thread manjunath.hadli
From: Manjunath Hadli 

There are two boards AM18xx and L138 both of which are based
on da850 SOC. AM18xx boards have mac address stored in I2C
EEPROM and they have spi flash manufactured by WINBOND. L138
boards store mac address in SPI flash and they have SPI flash
manufactured by ST Microelectronics.Due to these differences,
instead of one config file, two config files are introduced
to manage configs specific to board types.

changes from v1 patch set:
Manjunath Hadli (6):
  da850: add new config file for AM18xx
  da850: rename config file to represent OMAP-L138
  da850: pass board revision info to kernel
  da850: revert cache disable patch
corrected the commit message
  da850: add support to read mac address from spi flash
Adressed Mike comments for removal of sprintf
Adressed Mike comments for using is_valid_ethr_address
  da850: read MAC address from I2C EEPROM on AM18xx EVM

 board/davinci/da8xxevm/da850evm.c |   73 +++-
 boards.cfg|3 +-
 include/configs/da850_am18xxevm.h |  253 +
 include/configs/da850_l138evm.h   |  246 
 include/configs/da850evm.h|  249 
 5 files changed, 573 insertions(+), 251 deletions(-)
 create mode 100644 include/configs/da850_am18xxevm.h
 create mode 100644 include/configs/da850_l138evm.h
 delete mode 100644 include/configs/da850evm.h

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 6/6] da850: read MAC address from I2C EEPROM on AM18xx EVM

2011-10-08 Thread manjunath.hadli
From: Manjunath Hadli 

The AM18xx EVM contains MAC address in I2C EEPROM. Introduced
a new macro CONFIG_MAC_ADDR_IN_EEPROM to where to look for mac
address. This patch reads MAC address from I2C EEPROM and updates
environment variable.

Signed-off-by: Manjunathappa, Prakash 
Signed-off-by: Manjunath Hadli 
---
 board/davinci/da8xxevm/da850evm.c |   10 +-
 include/configs/da850_am18xxevm.h |7 +++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index e5f5b3a..e3aef8c 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -261,13 +261,15 @@ static void dspwake(void)
 
 int misc_init_r(void)
 {
+   uint8_t enetaddr[8];
uchar buff[8];
int ret;
 
dspwake();
 
-#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
+#if defined(CONFIG_MAC_ADDR_IN_SPIFLASH) || defined(CONFIG_MAC_ADDR_IN_EEPROM)
if (!eth_getenv_enetaddr("ethaddr", buff)) {
+#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
ret = get_mac_addr(buff);
if (ret != 0)
return -EINVAL;
@@ -278,6 +280,12 @@ int misc_init_r(void)
}
 
eth_setenv_enetaddr("ethaddr", buff);
+#else
+   /* Read Ethernet MAC address from EEPROM */
+   if (dvevm_read_mac_address(enetaddr))
+   /* Set Ethernet MAC address from EEPROM */
+   davinci_sync_env_enetaddr(enetaddr);
+#endif
}
 #endif
return 0;
diff --git a/include/configs/da850_am18xxevm.h 
b/include/configs/da850_am18xxevm.h
index 29d580b..df0c1cc 100644
--- a/include/configs/da850_am18xxevm.h
+++ b/include/configs/da850_am18xxevm.h
@@ -93,6 +93,12 @@
 #define CONFIG_SYS_I2C_EXPANDER_ADDR   0x20
 
 /*
+ * I2C EEPROM definitions EEPROM chip
+ */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
+#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
+
+/*
  * Flash & Environment
  */
 #ifdef CONFIG_USE_NAND
@@ -173,6 +179,7 @@
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_CRC32_VERIFY
 #define CONFIG_MX_CYCLIC
+#define CONFIG_MAC_ADDR_IN_EEPROM
 
 /*
  * Linux Information
-- 
1.6.2.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 4/6] da850: revert cache disable patch

2011-10-08 Thread manjunath.hadli
From: Manjunath Hadli 

revert commit bd65d006a6088bcb857e079447d7549e2cd7054d as the
disabling of cache need not be done explicitly. Subsequent
patches to new cache management framework has fixed it.
EMAC issue with cache coherency still exists when cahces are
enabled.

Signed-off-by: Manjunath Hadli 
---
 include/configs/da850_l138evm.h |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/include/configs/da850_l138evm.h b/include/configs/da850_l138evm.h
index 347893c..0bd630f 100644
--- a/include/configs/da850_l138evm.h
+++ b/include/configs/da850_l138evm.h
@@ -43,9 +43,6 @@
 #define CONFIG_SYS_HZ  1000
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SYS_TEXT_BASE   0xc108
-#define CONFIG_SYS_ICACHE_OFF
-#define CONFIG_SYS_DCACHE_OFF
-#define CONFIG_SYS_L2CACHE_OFF
 
 /*
  * Memory Info
-- 
1.6.2.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 09/12] VIDEO: davinci: add framebuffer to da8xx

2011-10-08 Thread Stefano Babic
The patch is a port from the framebuffer driver
of the Linux driver drivers/video/da8xx-fb.c, used
on davinci da8xx and OMAP-L138 boards.

As base for the port, the following commit (last changes
for this driver at the moment in the Linux kernel tree)
was taken:

commit 1db41e032d563eb47deab40dc5595be306b143ba
Author: axel lin 
Date:   Tue Feb 22 01:52:42 2011 +

video: da8xx-fb: fix section mismatch warning

Signed-off-by: Axel Lin 
Signed-off-by: Paul Mundt 

Signed-off-by: Stefano Babic 
CC: Sandeep Paulraj 
Cc: Anatolij Gustschin 
---

Changes:

- set a correct license header and drop dead code in da8xx-fb.h
 (Anatolij Gustschin)
- change commit message adding better references to driver in linux
used for porting (Wolfgang Denk)

 arch/arm/include/asm/arch-davinci/da8xx-fb.h |  126 
 drivers/video/Makefile   |1 +
 drivers/video/da8xx-fb.c |  846 ++
 3 files changed, 973 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-davinci/da8xx-fb.h
 create mode 100644 drivers/video/da8xx-fb.c

diff --git a/arch/arm/include/asm/arch-davinci/da8xx-fb.h 
b/arch/arm/include/asm/arch-davinci/da8xx-fb.h
new file mode 100644
index 000..6d2327c
--- /dev/null
+++ b/arch/arm/include/asm/arch-davinci/da8xx-fb.h
@@ -0,0 +1,126 @@
+/*
+ * Porting to u-boot:
+ *
+ * (C) Copyright 2011
+ * Stefano Babic, DENX Software Engineering, sba...@denx.de.
+ *
+ * Copyright (C) 2008-2009 MontaVista Software Inc.
+ * Copyright (C) 2008-2009 Texas Instruments Inc
+ *
+ * Based on the LCD driver for TI Avalanche processors written by
+ * Ajay Singh and Shalom Hai.
+ *
+ * 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 DA8XX_FB_H
+#define DA8XX_FB_H
+
+enum panel_type {
+   QVGA = 0
+};
+
+enum panel_shade {
+   MONOCHROME = 0,
+   COLOR_ACTIVE,
+   COLOR_PASSIVE,
+};
+
+enum raster_load_mode {
+   LOAD_DATA = 1,
+   LOAD_PALETTE,
+};
+
+struct display_panel {
+   enum panel_type panel_type; /* QVGA */
+   int max_bpp;
+   int min_bpp;
+   enum panel_shade panel_shade;
+};
+
+struct da8xx_panel {
+   const char  name[25];   /* Full name _ */
+   unsigned short  width;
+   unsigned short  height;
+   int hfp;/* Horizontal front porch */
+   int hbp;/* Horizontal back porch */
+   int hsw;/* Horizontal Sync Pulse Width */
+   int vfp;/* Vertical front porch */
+   int vbp;/* Vertical back porch */
+   int vsw;/* Vertical Sync Pulse Width */
+   unsigned intpxl_clk;/* Pixel clock */
+   unsigned char   invert_pxl_clk; /* Invert Pixel clock */
+};
+
+struct da8xx_lcdc_platform_data {
+   const char manu_name[10];
+   void *controller_data;
+   const char type[25];
+   void (*panel_power_ctrl)(int);
+};
+
+struct lcd_ctrl_config {
+   const struct display_panel *p_disp_panel;
+
+   /* AC Bias Pin Frequency */
+   int ac_bias;
+
+   /* AC Bias Pin Transitions per Interrupt */
+   int ac_bias_intrpt;
+
+   /* DMA burst size */
+   int dma_burst_sz;
+
+   /* Bits per pixel */
+   int bpp;
+
+   /* FIFO DMA Request Delay */
+   int fdd;
+
+   /* TFT Alternative Signal Mapping (Only for active) */
+   unsigned char tft_alt_mode;
+
+   /* 12 Bit Per Pixel (5-6-5) Mode (Only for passive) */
+   unsigned char stn_565_mode;
+
+   /* Mono 8-bit Mode: 1=D0-D7 or 0=D0-D3 */
+   unsigned char mono_8bit_mode;
+
+   /* Invert line clock */
+   unsigned char invert_line_clock;
+
+   /* Invert frame clock  */
+   unsigned char invert_frm_clock;
+
+   /* Horizontal and Vertical Sync Edge: 0=rising 1=falling */
+   unsigned char sync_edge;
+
+   /* Horizontal and Vertical Sync: Control: 0=ignore */
+   unsigned char sync_ctrl;
+
+   /* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */
+   unsigned char raster_order;
+};
+
+struct lcd_sync_arg {
+   int back_porch;
+   int front_porch;
+   int pulse_width;
+};
+
+void da8xx_video_init(const struct da8xx_panel *panel, int bits_pixel

Re: [U-Boot] [PATCH 5/6] da850: add support to read mac address from spi flash

2011-10-08 Thread Hadli, Manjunath
Mike,
 
On Fri, Sep 30, 2011 at 21:21:34, Mike Frysinger wrote:
> On Friday, September 30, 2011 07:24:26 nagabhushana.netagu...@ti.com wrote:
> > +   if (is_multicast_ether_addr(buff) ||
> > +   is_zero_ether_addr(buff)) {
> 
> NAK: use is_valid_ether_addr()
Thanks. Changed this.
> 
> > +   sprintf((char *)enetaddr, "%pM", buff);
> > +
> > +   eth_setenv_enetaddr("ethaddr", enetaddr);
> 
> NAK: eth_setenv_enetaddr() does the sprintf for you -mike
Thanks Mike. I have removed the sprintf.
> 

Also, 
I will be taking care of the patch set from now. I will resubmit the patches 
with the changes.

Thx,
-Manju

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 8/9] powerpc/mpc8548cds: Fix config according to system address map

2011-10-08 Thread Zhao Chenhui
On Sat, Oct 08, 2011 at 03:02:18PM +0800, Zhao Chenhui wrote:
> On Fri, Oct 07, 2011 at 10:17:28AM -0500, Kumar Gala wrote:
> > 
> > On Sep 13, 2011, at 2:15 AM, Zhao Chenhui wrote:
> > 
> > > From: chenhui zhao 
> > > 
> > > - Fix config according to system address map in the manual.
> > > - Rework tlb and law tables.
> > > - Remove unnecessary macros.
> > > 
> > > Signed-off-by: Zhao Chenhui 
> > > ---
> > > board/freescale/mpc8548cds/law.c|   19 +
> > > board/freescale/mpc8548cds/mpc8548cds.c |8 ++--
> > > board/freescale/mpc8548cds/tlb.c|   67 
> > > ---
> > > include/configs/MPC8548CDS.h|   56 -
> > > 4 files changed, 76 insertions(+), 74 deletions(-)
> > 
> > with which manual?  If its the board manual that isn't correct, the one in 
> > the board manual is just an example.
> > 
> > - k
> 
> It's "MPC8548E Configurable Development System Reference Manual".
> I made some minor changes to address map, including reserving 256M memory 
> space for PCI2,
> enlarging the size of PCI IO space.
> 
> -chenhui

Fixed typo in the comments of tlb.c and reposted.

-chenhui

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 8/9 v2] powerpc/mpc8548cds: Fix config according to system address map

2011-10-08 Thread Zhao Chenhui
From: chenhui zhao 

- Fix config according to system address map in the manual.
- Rework tlb and law tables.
- Remove unnecessary macros.

Signed-off-by: Zhao Chenhui 
---
Changes for v2:
  - Fixed typo in the comments of tlb.c

 board/freescale/mpc8548cds/law.c|   19 +
 board/freescale/mpc8548cds/mpc8548cds.c |8 ++--
 board/freescale/mpc8548cds/tlb.c|   67 ---
 include/configs/MPC8548CDS.h|   56 -
 4 files changed, 76 insertions(+), 74 deletions(-)

diff --git a/board/freescale/mpc8548cds/law.c b/board/freescale/mpc8548cds/law.c
index 5b6943d..f0de509 100644
--- a/board/freescale/mpc8548cds/law.c
+++ b/board/freescale/mpc8548cds/law.c
@@ -31,13 +31,14 @@
  * LAW(Local Access Window) configuration:
  *
  * 0x_ 0x7fff_ DDR 2G
- * 0x8000_ 0x9fff_ PCI1 MEM512M
+ * 0x8000_ 0x8fff_ PCI1 MEM256M
+ * 0x9000_ 0x9fff_ PCI2 MEM256M
  * 0xa000_ 0xbfff_ PCIe MEM512M
  * 0xc000_ 0xdfff_ RapidIO 512M
- * 0xe000_ 0xe000_ CCSR1M
- * 0xe200_ 0xe10f_ PCI1 IO 1M
- * 0xe280_ 0xe20f_ PCI2 IO 1M
- * 0xe300_ 0xe30f_ PCIe IO 1M
+ * 0xe000_ 0xe00f_ CCSR1M
+ * 0xe200_ 0xe27f_ PCI1 IO 8M
+ * 0xe280_ 0xe2ff_ PCI2 IO 8M
+ * 0xe300_ 0xe3ff_ PCIe IO 16M
  * 0xf000_ 0xf3ff_ SDRAM   64M
  * 0xf800_ 0xf80f_ NVRAM/CADMUS (*)1M
  * 0xff00_ 0xff7f_ FLASH (2nd bank)8M
@@ -52,11 +53,11 @@
 
 struct law_entry law_table[] = {
 #ifdef CONFIG_SYS_PCI2_MEM_PHYS
-   SET_LAW(CONFIG_SYS_PCI2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2),
-   SET_LAW(CONFIG_SYS_PCI2_IO_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_PCI_2),
+   SET_LAW(CONFIG_SYS_PCI2_MEM_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_PCI_2),
+   SET_LAW(CONFIG_SYS_PCI2_IO_PHYS, LAW_SIZE_8M, LAW_TRGT_IF_PCI_2),
 #endif
-   /* LBC window - maps 256M 0xf000 -> 0x */
-   SET_LAW(CONFIG_SYS_LBC_SDRAM_BASE, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
+   /* LBC window - maps 256M */
+   SET_LAW(CONFIG_SYS_LBC_SDRAM_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
 };
 
 int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/mpc8548cds/mpc8548cds.c 
b/board/freescale/mpc8548cds/mpc8548cds.c
index 78c5895..d33ef7e 100644
--- a/board/freescale/mpc8548cds/mpc8548cds.c
+++ b/board/freescale/mpc8548cds/mpc8548cds.c
@@ -53,10 +53,10 @@ int checkboard (void)
 
uint cpu_board_rev = get_cpu_board_revision ();
 
-   printf ("Board: CDS Version 0x%02x, PCI Slot %d\n",
-   get_board_version (), pci_slot);
-
-   printf ("CPU Board Revision %d.%d (0x%04x)\n",
+   puts("Board: MPC8548CDS");
+   printf(" Carrier Rev: 0x%02x, PCI Slot %d\n",
+   get_board_version(), pci_slot);
+   printf("   Daughtercard Rev: %d.%d (0x%04x)\n",
MPC85XX_CPU_BOARD_MAJOR (cpu_board_rev),
MPC85XX_CPU_BOARD_MINOR (cpu_board_rev), cpu_board_rev);
/*
diff --git a/board/freescale/mpc8548cds/tlb.c b/board/freescale/mpc8548cds/tlb.c
index b2c1b31..04e55b1 100644
--- a/board/freescale/mpc8548cds/tlb.c
+++ b/board/freescale/mpc8548cds/tlb.c
@@ -41,63 +41,66 @@ struct fsl_e_tlb_entry tlb_table[] = {
  MAS3_SX|MAS3_SW|MAS3_SR, 0,
  0, 0, BOOKE_PAGESZ_4K, 0),
 
+   /* TLB 1 */
/*
-* TLB 0:   16M Non-cacheable, guarded
-* 0xff00   16M FLASH
-* Out of reset this entry is only 4K.
+* Entry 0: 16M Non-cacheable, guarded
+* 0xff00_  16M FLASH(cover boot page)
 */
-   SET_TLB_ENTRY(1, CONFIG_SYS_BOOT_BLOCK, CONFIG_SYS_BOOT_BLOCK,
+   SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
  MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  0, 0, BOOKE_PAGESZ_16M, 1),
 
/*
-* TLB 1:   1G  Non-cacheable, guarded
-* 0x8000   1G  PCI1/PCIE  8,9,a,b
+* Entry 1: 1M  Non-cacheable, guarded
+* 0xe000_  1M  CCSRBAR
 */
-   SET_TLB_ENTRY(1, CONFIG_SYS_PCI_VIRT, CONFIG_SYS_PCI_PHYS,
+   SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
  MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
- 0, 1, BOOKE_PAGESZ_1G, 1),
+ 0, 1, BOOKE_PAGESZ_1M, 1),
 
/*
-* TLB 2:   256MNon-cacheable, guarded
+* Entry 2: 64M Cacheable, non-guarded
+* 0xf000_  6

Re: [U-Boot] [PATCH 8/9] powerpc/mpc8548cds: Fix config according to system address map

2011-10-08 Thread Zhao Chenhui
On Fri, Oct 07, 2011 at 10:17:28AM -0500, Kumar Gala wrote:
> 
> On Sep 13, 2011, at 2:15 AM, Zhao Chenhui wrote:
> 
> > From: chenhui zhao 
> > 
> > - Fix config according to system address map in the manual.
> > - Rework tlb and law tables.
> > - Remove unnecessary macros.
> > 
> > Signed-off-by: Zhao Chenhui 
> > ---
> > board/freescale/mpc8548cds/law.c|   19 +
> > board/freescale/mpc8548cds/mpc8548cds.c |8 ++--
> > board/freescale/mpc8548cds/tlb.c|   67 
> > ---
> > include/configs/MPC8548CDS.h|   56 -
> > 4 files changed, 76 insertions(+), 74 deletions(-)
> 
> with which manual?  If its the board manual that isn't correct, the one in 
> the board manual is just an example.
> 
> - k

It's "MPC8548E Configurable Development System Reference Manual".
I made some minor changes to address map, including reserving 256M memory space 
for PCI2,
enlarging the size of PCI IO space.

-chenhui

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot