refine code, for cubieboard to build ok.