[PATCH] 2/5 GSM power on
laforge at openmoko.org
Wed Sep 5 19:29:38 CEST 2007
On Mon, Sep 03, 2007 at 09:05:09PM +0800, Willie wrote:
> This patch can test GSM module is workable.
thanks for your patch.
As you might have noticed, we now already have similar functionality in
the openmoko u-boot tree called 'neo1973 gsm (on|off)', which I created
as part of the 'gsm passthrough' / terminal functionality.
Let me comment on some of your patches anyway.
> +int neo1973_gsmtest(void)
> + S3C24X0_UART * const uart0 = S3C24X0_GetBase_UART((S3C24X0_UARTS_NR)S3C24X0_UART0);
> + S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
> + uint8_t i = 0, j = 0;
> + uint8_t str = "AT-Command";
> + uint8_t GSM_Data;
> + uint8_t c;
> + uart0->UMCON = 0x0;
> + uart0->ULCON = 0x3;
> + uart0->UCON = 0x245;
> + uart0->UMCON = 0x1;
> + udelay(100);
> + gpio->GPHCON = (gpio->GPHCON&(~0x0f))|(0x0a);
> + gpio->GPFCON = gpio->GPFCON&(~(0x03<<4))|(0x01<<4);
> + gpio->GPFDAT &= ~(0x01<<2);
> + gpio->GPBDAT |= 0x80;
> + gpio->GPBDAT &= ~0x40;
This is a lot of fairly generic S3C2410 serial code which actually
belongs into the s3c24xx serial driver. The neo1973 code should not
really deal with those details.
It's important to try to find the right place and the right layer for
every bit of code we add. Making something work is not enough, it has
to fit from an architectural point of view.
So if something is really not specific to the neo1973, it will most
likely belong into a driver, such an this case the s3c24xx serial
Thanks for your attention,
- Harald Welte <laforge at openmoko.org> http://openmoko.org/
Software for the world's first truly open Free Software mobile phone
More information about the openmoko-uboot