xref: /freebsd/sys/contrib/alpine-hal/al_serdes.c (revision d002f039aeb370370cd2cba63ad55cc4cf16c932)
1*3fc36ee0SWojciech Macek /*******************************************************************************
2*3fc36ee0SWojciech Macek Copyright (C) 2015 Annapurna Labs Ltd.
3*3fc36ee0SWojciech Macek 
4*3fc36ee0SWojciech Macek This file may be licensed under the terms of the Annapurna Labs Commercial
5*3fc36ee0SWojciech Macek License Agreement.
6*3fc36ee0SWojciech Macek 
7*3fc36ee0SWojciech Macek Alternatively, this file can be distributed under the terms of the GNU General
8*3fc36ee0SWojciech Macek Public License V2 as published by the Free Software Foundation and can be
9*3fc36ee0SWojciech Macek found at http://www.gnu.org/licenses/gpl-2.0.html
10*3fc36ee0SWojciech Macek 
11*3fc36ee0SWojciech Macek Alternatively, redistribution and use in source and binary forms, with or
12*3fc36ee0SWojciech Macek without modification, are permitted provided that the following conditions are
13*3fc36ee0SWojciech Macek met:
14*3fc36ee0SWojciech Macek 
15*3fc36ee0SWojciech Macek     *     Redistributions of source code must retain the above copyright notice,
16*3fc36ee0SWojciech Macek this list of conditions and the following disclaimer.
17*3fc36ee0SWojciech Macek 
18*3fc36ee0SWojciech Macek     *     Redistributions in binary form must reproduce the above copyright
19*3fc36ee0SWojciech Macek notice, this list of conditions and the following disclaimer in
20*3fc36ee0SWojciech Macek the documentation and/or other materials provided with the
21*3fc36ee0SWojciech Macek distribution.
22*3fc36ee0SWojciech Macek 
23*3fc36ee0SWojciech Macek THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24*3fc36ee0SWojciech Macek ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25*3fc36ee0SWojciech Macek WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26*3fc36ee0SWojciech Macek DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
27*3fc36ee0SWojciech Macek ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28*3fc36ee0SWojciech Macek (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29*3fc36ee0SWojciech Macek LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30*3fc36ee0SWojciech Macek ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31*3fc36ee0SWojciech Macek (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32*3fc36ee0SWojciech Macek SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33*3fc36ee0SWojciech Macek 
34*3fc36ee0SWojciech Macek *******************************************************************************/
35*3fc36ee0SWojciech Macek 
36*3fc36ee0SWojciech Macek #include "al_serdes.h"
37*3fc36ee0SWojciech Macek #include "al_hal_serdes_hssp.h"
38*3fc36ee0SWojciech Macek #include "al_hal_serdes_25g.h"
39*3fc36ee0SWojciech Macek 
40*3fc36ee0SWojciech Macek static int(*handle_init[AL_SRDS_NUM_GROUPS])(void __iomem *, struct al_serdes_grp_obj *) = {
41*3fc36ee0SWojciech Macek 	al_serdes_hssp_handle_init,
42*3fc36ee0SWojciech Macek 	al_serdes_hssp_handle_init,
43*3fc36ee0SWojciech Macek 	al_serdes_hssp_handle_init,
44*3fc36ee0SWojciech Macek 	al_serdes_hssp_handle_init,
45*3fc36ee0SWojciech Macek #if CHECK_ALPINE_V2
46*3fc36ee0SWojciech Macek 	al_serdes_25g_handle_init,
47*3fc36ee0SWojciech Macek #endif
48*3fc36ee0SWojciech Macek };
49*3fc36ee0SWojciech Macek 
al_serdes_handle_grp_init(void __iomem * serdes_regs_base,enum al_serdes_group grp,struct al_serdes_grp_obj * obj)50*3fc36ee0SWojciech Macek int al_serdes_handle_grp_init(
51*3fc36ee0SWojciech Macek 	void __iomem			*serdes_regs_base,
52*3fc36ee0SWojciech Macek 	enum al_serdes_group		grp,
53*3fc36ee0SWojciech Macek 	struct al_serdes_grp_obj	*obj)
54*3fc36ee0SWojciech Macek {
55*3fc36ee0SWojciech Macek 	handle_init[grp](serdes_regs_base, obj);
56*3fc36ee0SWojciech Macek 
57*3fc36ee0SWojciech Macek 	return 0;
58*3fc36ee0SWojciech Macek }
59*3fc36ee0SWojciech Macek 
60