X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=board%2Fmicronas%2Fvct%2Febi_smc911x.c;h=9e59f0a2de23b6f06b7f67dba9e4c4dd94be99ca;hb=83d290c56fab2d38cd1ab4c4cc7099559c1d5046;hp=e1b67a075b7eb0ba6e61df7cc78f22dbe0b7f696;hpb=6c6e042ab3bbfb5428e4cdeb38fa27728c63afdd;p=platform%2Fkernel%2Fu-boot.git diff --git a/board/micronas/vct/ebi_smc911x.c b/board/micronas/vct/ebi_smc911x.c index e1b67a0..9e59f0a 100644 --- a/board/micronas/vct/ebi_smc911x.c +++ b/board/micronas/vct/ebi_smc911x.c @@ -1,23 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2008 Stefan Roese , DENX Software Engineering - * - * 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 "vct.h" @@ -45,10 +32,11 @@ int ebi_init_smc911x(void) * Accessor functions replacing the "weak" functions in * drivers/net/smc911x.c */ -u32 smc911x_reg_read(u32 addr) +u32 smc911x_reg_read(struct eth_device *dev, u32 addr) { volatile u32 data; + addr += dev->iobase; reg_write(EBI_DEV1_CONFIG2(EBI_BASE), 0x0000004F); ebi_wait(); reg_write(EBI_CPU_IO_ACCS(EBI_BASE), (EXT_DEVICE_CHANNEL_1 | addr)); @@ -58,8 +46,9 @@ u32 smc911x_reg_read(u32 addr) return (data); } -void smc911x_reg_write(u32 addr, u32 data) +void smc911x_reg_write(struct eth_device *dev, u32 addr, u32 data) { + addr += dev->iobase; reg_write(EBI_DEV1_CONFIG2(EBI_BASE), 0x0000004F); ebi_wait(); reg_write(EBI_IO_ACCS_DATA(EBI_BASE), data); @@ -68,8 +57,9 @@ void smc911x_reg_write(u32 addr, u32 data) ebi_wait(); } -void pkt_data_push(u32 addr, u32 data) +void pkt_data_push(struct eth_device *dev, u32 addr, u32 data) { + addr += dev->iobase; reg_write(EBI_DEV1_CONFIG2(EBI_BASE), 0x0000004A); ebi_wait(); reg_write(EBI_IO_ACCS_DATA(EBI_BASE), data); @@ -80,10 +70,11 @@ void pkt_data_push(u32 addr, u32 data) return; } -u32 pkt_data_pull(u32 addr) +u32 pkt_data_pull(struct eth_device *dev, u32 addr) { volatile u32 data; + addr += dev->iobase; reg_write(EBI_DEV1_CONFIG2(EBI_BASE), 0x0000004A); ebi_wait(); reg_write(EBI_CPU_IO_ACCS(EBI_BASE), (EXT_DEVICE_CHANNEL_1 | addr)); @@ -92,3 +83,12 @@ u32 pkt_data_pull(u32 addr) return data; } + +int board_eth_init(bd_t *bis) +{ + int rc = 0; +#ifdef CONFIG_SMC911X + rc = smc911x_initialize(0, CONFIG_DRIVER_SMC911X_BASE); +#endif + return rc; +}