Quick 'indent' run on ectool with some additional manual cosmetic fixes.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4174 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Uwe Hermann 2009-04-22 12:28:14 +00:00
parent 0408bdd240
commit 257ae3f520
4 changed files with 50 additions and 53 deletions

View File

@ -5,8 +5,7 @@
*
* 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; version 2 of
* the License.
* published by the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -15,8 +14,7 @@
*
* 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., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
@ -60,8 +58,7 @@ int send_ec_data(uint8_t data)
debug(".");
}
if (!timeout) {
printf("Timeout while sending data 0x%02x to EC!\n",
data);
printf("Timeout while sending data 0x%02x to EC!\n", data);
// return -1;
}
@ -114,6 +111,6 @@ int ec_write(uint8_t addr, uint8_t data)
{
send_ec_command(0x81);
send_ec_data(addr);
return send_ec_data(data);
}

View File

@ -5,8 +5,7 @@
*
* 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; version 2 of
* the License.
* published by the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -15,13 +14,14 @@
*
* 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., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _EC_H
#define _EC_H
#include <stdint.h>
#define EC_DATA 0x62
#define EC_SC 0x66
@ -33,6 +33,7 @@
// 0: byte in data register is data
#define EC_IBF (1 << 1) // 1: input buffer full (data ready for ec)
#define EC_OBF (1 << 0) // 1: output buffer full (data ready for host)
/* EC_SC output */
#define RD_EC 0x80 // Read Embedded Controller
#define WR_EC 0x81 // Write Embedded Controller
@ -45,5 +46,5 @@ int send_ec_data(uint8_t data);
int send_ec_data_nowait(uint8_t data);
uint8_t recv_ec_data(void);
uint8_t ec_read(uint8_t addr);
#endif
#endif

View File

@ -5,8 +5,7 @@
*
* 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; version 2 of
* the License.
* published by the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -15,8 +14,7 @@
*
* 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., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
@ -94,11 +92,12 @@ int main(int argc, char *argv[])
}
printf("EC RAM:\n");
for (i=0; i < 0x100; i++) {
for (i = 0; i < 0x100; i++) {
if ((i % 0x10) == 0)
printf ("\n%02x: ", i);
printf("\n%02x: ", i);
printf("%02x ", ec_read(i));
}
printf("\n\n");
return 0;
}